Tete omar Posted May 16, 2012 Share Posted May 16, 2012 if getPlayerMoney == "99999" then setPlayerName (getRootElement, Cheater) outputChatBox ( "Don't cheat or you get banned" , source, 0, 159, 255 ) end Why doesn't run ? i want when the player get 99999 set his name to cheater and outputchatbox etc... Link to comment
Kenix Posted May 16, 2012 Share Posted May 16, 2012 You should call function getPlayerMoney and in arguments use element player. Also getPlayerMoney return number value (integer) not string. setPlayerName (getRootElement, Cheater) First argument should be element player but not function value. I guess variables Cheater, source not defined. Learn https://forum.multitheftauto.com/viewtop ... 7cb5717055 https://wiki.multitheftauto.com/wiki/Scr ... troduction Link to comment
mjr Posted May 16, 2012 Share Posted May 16, 2012 setPlayerName (getRootElement, "Cheater") Link to comment
Stanley Sathler Posted May 16, 2012 Share Posted May 16, 2012 It has many errors. First, as Kenix said, in the condition you don't use quotes, because 99999 is a number (integer), and not a string. And getPlayerMoney needs an argument (the player that you want get money). | Second, the function setPlayerName needs a string on second argument (Cheater, in your example, is a variable not declared). So, you must use with quotes (as mjr said: "Cheater"). HINT: Learn Lua. You don't know how to program, so you must learn "walk" before "run". 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