FSXTim Posted September 24, 2012 Posted September 24, 2012 Hello, I have more than 61000 dollars and I type "/givemoney FSXTim 100", but the console says: "You don't have enough money!" (line 9 in the script) function giveMoney(player, command, target, m) local target = getPlayerFromName(target) local money = tonumber(m) if isElement(target) then if tonumber(getElementData(player, "Geld") == money) or tonumber(getElementData(player, "Geld") > money) then setElementData(player, "Geld", getElementData(player, "Geld") - money) setElementData(target, "Geld", getElementData(target, "Geld") + money) else outputChatBox("You don't have enough money!", player, 255, 48, 48) end end end addCommandHandler("givemoney", giveMoney) Greets
Guest Guest4401 Posted September 24, 2012 Posted September 24, 2012 Replace this if tonumber(getElementData(player, "Geld") == money) or tonumber(getElementData(player, "Geld") > money) then with this if tonumber(getElementData(player,"Geld")) >= money then
FSXTim Posted September 24, 2012 Author Posted September 24, 2012 Thanks you, it's working now. Greets
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now