23.05.2011, 10:42
pawn Код:
//Top of script
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_SUBMISSION)) // change this to what you want
{
new Float:x, Float:y, Float:z; new vehicle=GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
GetVehicleVelocity(vehicle,x,y,z);
SetVehicleVelocity(vehicle,x,y,z+2); // change the +2 with the height you want
}
else
{
GetPlayerVelocity(playerid, x, y, z);
SetPlayerVelocity(playerid, x, y, z + 2.0); //remove this if you dont want to hop with player
}
}
return 1;
}