Allow money.add to add money to "frozen" users
This commit is contained in:
parent
347c24381c
commit
727628c087
5
core.lua
5
core.lua
|
@ -85,11 +85,12 @@ function money3.add(name, amount)
|
||||||
return "The amount specified must be a positive non-NaN number."
|
return "The amount specified must be a positive non-NaN number."
|
||||||
end
|
end
|
||||||
|
|
||||||
if not money3.user_exists(name) then
|
local credit = money3.get(name)
|
||||||
|
if not credit then
|
||||||
return name .. " does not exist."
|
return name .. " does not exist."
|
||||||
end
|
end
|
||||||
|
|
||||||
money3.set(name, money3.get(name) + amount)
|
money3.set(name, credit + amount)
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue