23.05.2011, 08:27
Can someone pls tell me how to make /hop command so I can hop my vehicle in air? And can it be used by pressing for example NUMPAD 4?
//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;
}
if (PRESSED(KEY_SUBMISSION))