rafull6 Posted February 12, 2012 Posted February 12, 2012 Hey guys. I decided to create small script for RPG server. Taxi driver should earn money when someone (passanger) is in his car. Here is my (dead) script: function betaaldeChaufeur(thePlayer, seat, jacked) theVehicleID = getElementModel ( source ) if (theVehicleID == 420) and ( seat ~= 0 ) then driver = getVehicleOccupant(source, 0) timerMoneyTaxi = setTimer( function( player ) givePlayerMoney (driver, 900) end, 5000, 1 , source ) destroyElement ( taxiOphaalBlip ) end end addEventHandler ("onVehicleEnter", getRootElement(), betaaldeChaufeur) I think my mistake somewhere here: timerMoneyTaxi = setTimer( function( player ) givePlayerMoney (driver, 900) end, 5000, 1 , source ) but idk how to fix it. Help me, please
Paper Posted February 12, 2012 Posted February 12, 2012 function betaaldeChaufeur(thePlayer, seat, jacked) theVehicleID = getElementModel ( source ) if (theVehicleID == 420) and ( seat ~= 0 ) then driver = getVehicleOccupant(source, 0) timerMoneyTaxi = setTimer( function() givePlayerMoney (driver, 900) end, 5000, 1) destroyElement ( taxiOphaalBlip ) end end addEventHandler ("onVehicleEnter", getRootElement(), betaaldeChaufeur) This should work
rafull6 Posted February 12, 2012 Author Posted February 12, 2012 Thank you very much, Paper! Works perfectly)
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