spAik Posted August 3, 2013 Posted August 3, 2013 Hi, I try to make a nos command...it should allow the player to only allow to buy it every 60secs. But its not working. Whats wrong? Accountdata "cash" exists. Elementdata Limit should also exist ;X function BuyNos (player, command) local account = getPlayerAccount(player) if (getAccountData(account,"cash") > 3000) and (getElementData(player,"Limit") = 0) then local auto = getPedOccupiedVehicle(player) local nick = getPlayerName(player) addVehicleUpgrade(auto,1010) setAccountData(account, "cash", getAccountData(account,"cash") - 3000 ) setElementData(player, "Limit", 1) outputChatBox("#FFFFFF" .. nick .. " #ff0000bought nitro for $3000! #FFFFFF(/nitro)", getRootElement(), 255, 85, 0, true) SetTimer(resetlimit, 60000, 1 , player) else outputChatBox("#FF0000Not enough money.", player, 255, 85, 0, true) end end addCommandHandler("nitro", BuyNos) function resetlimit (player) setElementData(player,"Limit",0) end
Castillo Posted August 3, 2013 Posted August 3, 2013 You put "SetTimer" uppercase "S" and it's "setTimer".
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