Hello! Valamiért nem müködik a /givemoney se a /setmoney. Mit tegyek? a Segítségeteket előre köszönöm!
function setMoney(thePlayer, commandName, target, money)
if (exports.global:isPlayerLeadAdmin(thePlayer)) then
local money = tonumber((money:gsub(\",\",\"\")))
if not (target) then
outputChatBox(\"SYNTAX: /\" .. commandName .. \" [Partial Player Nick] [Money]\", thePlayer, 255, 194, 14)
else
local username = getPlayerName(thePlayer)
local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, target)
if targetPlayer then
exports.logs:dbLog(thePlayer, 4, targetPlayer, \"SETMONEY \"..money)
exports.global:setMoney(targetPlayer, money)
outputChatBox(targetPlayerName .. \" now has \" .. exports.global:formatMoney(money) .. \" $.\", thePlayer)
outputChatBox(\"Admin \" .. username .. \" set your money to \" .. exports.global:formatMoney(money) .. \" $.\", targetPlayer)
end
end
end
end
addCommandHandler(\"setmoney\", setMoney, false, false)
function giveMoney(thePlayer, commandName, target, money)
if (exports.global:isPlayerLeadAdmin(thePlayer)) then
local money = tonumber((money:gsub(\",\",\"\")))
if not (target) then
outputChatBox(\"SYNTAX: /\" .. commandName .. \" [Partial Player Nick] [Money]\", thePlayer, 255, 194, 14)
else
local username = getPlayerName(thePlayer)
local targetPlayer, targetPlayerName = exports.global:findPlayerByPartialNick(thePlayer, target)
if targetPlayer then
exports.logs:dbLog(thePlayer, 4, targetPlayer, \"GIVEMONEY \" ..money)
exports.global:giveMoney(targetPlayer, money)
outputChatBox(\"You have given \" .. targetPlayerName .. \" $\" .. exports.global:formatMoney(money) .. \".\", thePlayer)
outputChatBox(\"Admin \" .. username .. \" has given you $\" .. exports.global:formatMoney(money) .. \".\", targetPlayer)
end
end
end
end
addCommandHandler(\"givemoney\", giveMoney, false, false)