aski Posted April 23, 2014 Share Posted April 23, 2014 Jakich funkcji i gdzie użyć aby zamiast timer liczyło po metrach/klatkach przebytych? 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
PanMaszyna Posted July 22, 2014 Share Posted July 22, 2014 Możesz stworzyć event z użyciem setTimer co 100 ms i pobrać getDistanceBetweenPoints3D. 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