Quote:
Originally Posted by HellSphinX
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).
|
It's strange, why are you setting vehicle pos? if you want to stop the vehicle you could just stop the engine... SetVehicleParamsForPlayer.
-FalconX