Sziasztok. Az if miért nem használható így? A PAWN után ez volt a megszokott és azt gondoltam, hogy ez működhet így is.
function giveMoney(player, command, amount)
local amount = amount
if (amount >= 0) then
outputChatBox(\"0 - 10000\", player)
else
givePlayerMoney(player, amount)
outputChatBox(\"\".. amount ..\"$\", player)
end
end
addCommandHandler(\"givemoney\", giveMoney)
Illetve valaki le tudnád írni, hogy maga az if hogyan működik? Láttam ilyen megoldást, hogy (amount > 0 or amount = 0) de így sem működik.
addCommandHandler(\"givemoney\",
function (source, commandName, penz)
if tonumber(penz) < 1 or tonumber(penz) > 10000 then
outputChatBox(\"0 - 10000\", source)
else
givePlayerMoney(source, tonumber(penz))
outputChatBox(penz, source)
end
end
)