13.05.2011, 16:28
(
Последний раз редактировалось CrunkBankS; 13.05.2011 в 17:30.
)
[ame]http://www.youtube.com/watch?v=vI62TuatpFg[/ame]
How to make this?
How to make this?
public OnPlayerKeyStateChange(playerid, oldkeys, newkeys)
{
if(newkeys & KEY_FIRE)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
new Float:X,Float:Y,Float:Z;
GetVehiclePos(vehicleid, X, Y, Z);
SetVehiclePos(vehicleid, X, Y, Z +10);
}
return 1;
}
if(newkeys & KEY_HANDBRAKE)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
AddVehicleSpeed(vehicleid, 10.0)
}
return 1;
}
return 1;
}
stock AddVehicleSpeed(vid, Float:howmuch)
{
static Float:T[3];
GetVehicleVelocity(vid, T[0], T[1], T[2]);
return SetVehicleVelocity(vid,T[0] * howmuch , T[1] * howmuch , T[2]);
}