20.06.2012, 20:47
then use
pawn Код:
forward vehiclecheck(playerid, vehicleid);
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
{
SetTimerEx("vehiclecheck", 500, true, "id" playerid, vehicleid);
}
return 1;
}
public vehiclecheck(playerid, vehicleid)
{
new Float:vhealth;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, vhealth);
if(vhealth <= 100)
{
SetVehicleHealth(veh,1000);
}
return 1;
}