Jump to content

money scripting


Vercetti1010

Recommended Posts

k, here is the situation. i need some help on making a script that sets a players money to x amount when he spawns. ive been around the forums and the example scripts dont work. yes, i put it at the end of broph. please give me information that a person new to lua would understand, dont just give me a link to the wiki. oh one more note, id rather this be a separate script so we dont have to rely on broph.

Link to comment

Make a folder in C:\Program Files\MTA San Andreas\server\mods\deathmatch\resources\

call it "joinmoney" (or whatever)

Open up a text editor and put this.

You can change the 10000 to whatever amount to whatever you want.

  
function consoleMoneyOnJoin ( )      
    givePlayerMoney ( source, 10000 ) 
    outputChatBox ("There's $10k for you!", source, 255, 255, 0, true ) 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), consoleMoneyOnJoin ) 
  

save it as money.lua

now create a file called meta.xml and put this in it.

  

"Yourname" description="Description" type="server" /> 

Place these two files in the moneyj folder and done, now you just do /start moneyj to get it to work.

MAybe you could also add it in the mta server config file to start automatically when the server starts.

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...