From 22b74b3db62b8c4d3d21f368f7c022d8da9571f9 Mon Sep 17 00:00:00 2001 From: Logan Gartner Date: Sat, 26 Mar 2022 13:18:25 -0600 Subject: [PATCH] RequestMoneyStr now can be more than 1 word long --- modules/server/sv_darkrp.txt | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/modules/server/sv_darkrp.txt b/modules/server/sv_darkrp.txt index fd167d3..b2f9b25 100644 --- a/modules/server/sv_darkrp.txt +++ b/modules/server/sv_darkrp.txt @@ -37,18 +37,24 @@ do if darkrp.canMakeMoneyRequest(target) then local money = owner():getMoney() - target:requestMoney((#args[3] > 0 and args[3] or ""), 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.") + local requestStr = "" + if #args >= 3 then + for i = 3, #args do + requestStr = requestStr.." "..args[i] end - end, - function() --Failure - core:log(log.ERROR, "Money request to "..target:getName().." failed!") 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()..".") else