Jump to content

$$$ every minute


dashe123

Recommended Posts

Greetings people. My scripter can't figure out how to make a script which should work like this: A player enters a car (574) and after driving it for a minute he gets some dollars and it keeps happening every minute until he exits the vehicle. IDK why but the scripter says that the script has to be with some kind of GUI so the script activates fuction which gives money every minute...??? WHAATT?? Please help. Give me the right functions he should use, script or just help him get on the right track.

Link to comment

Meh, is he really a "Scripter"? because this has nothing to do with GUI, also, it's pretty simple to do this.

moneyTimers = {} 
  
addEventHandler("onVehicleEnter",root, 
function (thePlayer) 
    if getElementModel(source) == 574 then 
         moneyTimers[thePlayer] = setTimer(givePlayerMoney,60000,0,thePlayer,500) 
    end 
end) 
  
addEventHandler("onVehicleExit",root, 
function (thePlayer) 
    if getElementModel(source) == 574 then 
         if isTimer(moneyTimers[thePlayer]) then killTimer(moneyTimers[thePlayer]) end 
    end 
end) 

Try with that, it should work.

P.S: Is server-side.

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