Jump to content

Money script [HELP]


Recommended Posts

  
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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...