31.01.2010, 11:44
pawn Код:
SetTimer("ImortalPerson",100,true);
SetTimer("ImortalVehicle",100,true);
public ImortalVehicle() ; no
pawn Код:
forward ImortalVehicle();
public ImortalVehicle()
{
//func.....
return 1;
}
pawn Код:
#include <a_samp>
//public OnGameModeInit()
public OnFilterScriptInit()
{
SetTimer("godplayerorvehicle",1000,true);
return 1;
}
forward godplayerorvehicle();
public godplayerorvehicle()
{
new
MaxPlayers = GetMaxPlayers();
for(new i; i < MaxPlayers; i++)
{
if(!IsPlayerConnected(i)) continue;
new
Float:HP,
VehicleID = GetPlayerVehicleID(i);
if(VehicleID)
{
GetVehicleHealth(VehicleID, HP);
if(HP < 500) { RepairVehicle(VehicleID); }
} else {
GetPlayerHealth(i, HP);
if(HP < 99) { SetPlayerHealth(i, 100); }
}
}
return 1;
}