08.06.2012, 16:35
hey guys,
i have made some things witrh NOS system, but then when i conpiled and started server it constantly crashed... it was very nice but it made the server crash so i removed it...
anyways my question is: how can i make this NOS system like it is in RL? like in fast and furious... when they press the N20 button they get a hughe boost and the screen gets shaky etc...
anyways here is my nos codes:
thats under onplayerkeystatechange
the stock for it
and now i had made with some timers and variables that when they were over 140 kmh they could press LMB and they get a boost, but then after 2 seconds the nos get removed and after 15 seconds they can use their NOS again and they get nos...
and in the code it all seemed to be alright etc, but it made my server crash so i removed it
anyways does anyone can make a small simple code for me that doesnt makes my server crash?
also is it possible to let the screen shake in samp like in gta sa single player when press NOS? it would be really nice
greets niels
i have made some things witrh NOS system, but then when i conpiled and started server it constantly crashed... it was very nice but it made the server crash so i removed it...
anyways my question is: how can i make this NOS system like it is in RL? like in fast and furious... when they press the N20 button they get a hughe boost and the screen gets shaky etc...
anyways here is my nos codes:
pawn Код:
if(newkeys & KEY_FIRE)
{
if(GetPlayerSpeed(playerid) >= 140)
{
new vid = GetPlayerVehicleID(playerid);
new Float:dis = 0.24;
new Float:T[4];
GetVehicleVelocity(vid, T[0], T[1], T[2]);
GetVehicleZAngle(vid, T[3]);
SetVehicleVelocity(vid,floatadd(T[0],floatmul(dis,floatsin(-T[3],degrees))), floatadd(T[1],floatmul(dis,floatcos(-T[3],degrees))), T[2]);
return 1;
}
else if(GetPlayerSpeed(playerid) <= 140) return 0;
}
pawn Код:
stock GetPlayerSpeed(playerid)
{
new Float:ST[4];
if(IsPlayerInAnyVehicle(playerid))
GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
return floatround(ST[3]);
}
and now i had made with some timers and variables that when they were over 140 kmh they could press LMB and they get a boost, but then after 2 seconds the nos get removed and after 15 seconds they can use their NOS again and they get nos...
and in the code it all seemed to be alright etc, but it made my server crash so i removed it
anyways does anyone can make a small simple code for me that doesnt makes my server crash?
also is it possible to let the screen shake in samp like in gta sa single player when press NOS? it would be really nice
greets niels