Compare commits
2 commits
7977f0129a
...
205bdc0272
Author | SHA1 | Date | |
---|---|---|---|
205bdc0272 | |||
22b74b3db6 |
2 changed files with 19 additions and 11 deletions
|
@ -37,18 +37,24 @@ do
|
||||||
|
|
||||||
if darkrp.canMakeMoneyRequest(target) then
|
if darkrp.canMakeMoneyRequest(target) then
|
||||||
local money = owner():getMoney()
|
local money = owner():getMoney()
|
||||||
target:requestMoney((#args[3] > 0 and args[3] or ""), amount,
|
local requestStr = ""
|
||||||
function() --Success
|
if #args >= 3 then
|
||||||
if owner():getMoney() + amount >= money then
|
for i = 3, #args do
|
||||||
core:log(log.INFO, "Successfully received "..darkrp.formatMoney(amount).." from "..target:getName().."!")
|
requestStr = requestStr.." "..args[i]
|
||||||
else
|
|
||||||
-- This probably won't happen here
|
|
||||||
core:log(log.ERROR, "An unknown error occured! Transaction status is unknown.")
|
|
||||||
end
|
end
|
||||||
end,
|
|
||||||
function() --Failure
|
|
||||||
core:log(log.ERROR, "Money request to "..target:getName().." failed!")
|
|
||||||
end
|
end
|
||||||
|
target:requestMoney(requestStr, amount,
|
||||||
|
function() --Success
|
||||||
|
if owner():getMoney() + amount >= money then
|
||||||
|
core:log(log.INFO, "Successfully received "..darkrp.formatMoney(amount).." from "..target:getName().."!")
|
||||||
|
else
|
||||||
|
-- This probably won't happen here
|
||||||
|
core:log(log.ERROR, "An unknown error occured! Transaction status is unknown.")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
function() --Failure
|
||||||
|
core:log(log.ERROR, "Money request to "..target:getName().." failed!")
|
||||||
|
end
|
||||||
)
|
)
|
||||||
core:log(log.INFO, "Requested "..darkrp.formatMoney(amount).." from "..target:getName()..".")
|
core:log(log.INFO, "Requested "..darkrp.formatMoney(amount).." from "..target:getName()..".")
|
||||||
else
|
else
|
||||||
|
|
|
@ -349,7 +349,9 @@ end
|
||||||
|
|
||||||
-- Get's a player's entity by searching for it via an inputted string
|
-- Get's a player's entity by searching for it via an inputted string
|
||||||
function core:get_entity(ply)
|
function core:get_entity(ply)
|
||||||
if type(ply) == "Player" then
|
if ply == nil then
|
||||||
|
return nil
|
||||||
|
elseif type(ply) == "Player" then
|
||||||
return ply
|
return ply
|
||||||
elseif ply == "^" then
|
elseif ply == "^" then
|
||||||
return owner()
|
return owner()
|
||||||
|
|
Loading…
Reference in a new issue