13.10.2011, 01:20
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
printf("key: %d",newkeys);
....
rest
pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(key number))
{
if(!GetPlayerVehicleSeat(playerid))
{
new Float:z,veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleZAngle(veh, z);
SetVehicleZAngle(veh, z+0.1);
//SetVehicleHealth(veh,1000.0);
RepairVehicle(veh);
AddVehicleComponent(veh,1010);
return 1;
}
}
return 1;
}