Freire Posted January 15, 2019 Share Posted January 15, 2019 function freeze() local money = getPlayerMoney(theplayer) respawnVehicle(veiculo) setElementFrozen(veiculo, true) takePlayerMoney(root, 50) if money > 100 then end end Error line 6: attempt to compare number with boolean Link to comment
DNL291 Posted January 16, 2019 Share Posted January 16, 2019 thePlayer isn't defined anywhere. Link to comment
MTA Anti-Cheat Team Dutchman101 Posted January 16, 2019 MTA Anti-Cheat Team Share Posted January 16, 2019 In this case "attempt to compare number with boolean" means that you cannot do if money > 100 then because "theplayer" returns false (boolean is 'false' or 'true'). You cannot check a value of something/someone that as far the script knows doesn't exist (because, as DNL291 said, it's not defined). In your case, you must pass a valid player to the script (in your local "money"). I hope this explanation helps you and other beginners Link to comment
Down MTA Posted January 23, 2019 Share Posted January 23, 2019 function freeze() if ( getPlayerMoney (source) >= 100) then respawnVehicle(veiculo) setElementFrozen(veiculo, true) takePlayerMoney(source, 50) end end Try it like this, my friend. Link to comment
Peti Posted January 23, 2019 Share Posted January 23, 2019 You need to define the player. https://wiki.multitheftauto.com/wiki/GetPlayerMoney Quote Returns Returns an integer with the amount of money the specified player has, false if the player is invalid. I think that this: local money = getPlayerMoney(theplayer) is returning "false". Link to comment
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