25.04.2011, 17:02
On top of script write:
Then:
This will fix the car whenever the player pressed the "KEY_SUBMISSION" (which is '2' or '+' by default)
PHP код:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
PHP код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_SUBMISSION))
{
new id = GetPlayerVehicleID(playerid);
if(id)
{
SetVehicleHealth(id, 1000);
SendClientMessage(playerid, 0x00FF00, "Vehicle Repaired!");
}
}
return 1;
}