09.06.2012, 10:05
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_CROUCH))
{
if(IsPlayerInAnyVehicle(playerid)) // checks if playrid in a vehicle
{
new
Float:x,
Float:y,
Float:z,
playerveh = GetPlayerVehicleID(playerid); // gets the id of the player's vehicle and store it into playerveh so we can use it in Get/SetVehiclePos
GetVehiclePos(playerveh, x, y, z);
SetVehiclePos(playerveh, x, y, z + 2.0);
}
}
return 1;
}
Edit:
No, the vehicle won't go forward actually it will stop (That's tested).