18.03.2014, 13:36
Hi i need make a timer when i holding the key the timer are true when i released the timer are false
my code:
gtspeed public:
when i my timer starts it wont stop, my car going until 100000km/h speed i want to make when i'm holding key_sprint then my car every 1 second speed up :/ but i don't know how to make that, if anyone can help my i be really thankful.
my code:
Код:
if(HOLDING(KEY_SPRINT)) { SetTimer("GTSpeed", 1000, true); return 1; } if (RELEASED(KEY_SPRINT)) { SetTimer("GTSpeed", 100000000, false); }
Код:
public GTSpeed(playerid) { new Float:sXxx,Float:sYxx,Float:SZxx; GetVehicleVelocity( GetPlayerVehicleID( playerid ),sXxx,sYxx,SZxx); SetVehicleVelocity( GetPlayerVehicleID( playerid ),sXxx*1.1,sYxx*1.1,SZxx*1.1); return 1; }