aski Posted April 23, 2014 Share Posted April 23, 2014 This is system Taxi. How to convert it took and gave the money but not the time for the meters? taxi_ids = { [420] = true, [438] = true } local sekundy = 5 --seconds local kasa = 5 --money addEventHandler ( "onVehicleEnter", root, function ( player, seat ) if ( taxi_ids [ getElementModel ( source ) ] ) then if ( seat ~= 0 ) then local kierowca = getVehicleController ( source ) if ( kierowca ) then local timer = setTimer ( function ( ) takePlayerMoney ( player, kasa ) givePlayerMoney ( kierowca, kasa ) end, sekundy * 1000, 0 ) setElementData ( player, "timer:taxi", timer ) end end end end ) addEventHandler ( "onVehicleExit", root, function ( player, seat ) if ( taxi_ids [ getElementModel ( source ) ] ) then if ( seat ~= 0 ) then local timer = getElementData ( player, "timer:taxi" ) if ( isTimer ( timer ) ) then killTimer ( timer ) end end end end ) Link to comment
TrapLord Studios™ Posted April 24, 2014 Share Posted April 24, 2014 You have to make a timer seperate to count the amount of time the player is in the Taxi, and then calculate it to suit to your liking, use getTickCount Link to comment
aski Posted April 24, 2014 Author Share Posted April 24, 2014 Can you explain how to do it from scratch, and where every insert? want to hone it. 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