23.08.2010, 03:53
(
Последний раз редактировалось Backwardsman97; 23.08.2010 в 04:08.
)
You need to use a timer with SetTimerEx under OnPlayerSpawn. Try this out.
As far as team kill goes, you could use the default SetPlayerTeam functions in sa-mp. They have a built in anti-team kill. Other than that, you could just punish those who team kill.
pawn Код:
forward FixHealth(playerid);
#define SPAWN_PROTECTION_TIME 8 //In seconds
//OnPlayerSpawn
SetPlayerHealth(playerid,1000.0);
SetTimerEx("FixHealth",SPAWN_PROTECTION_TIME*1000,0,"d",playerid);
//Elsewhere in your script
public FixHealth(playerid)
{
SetPlayerHealth(playerid,100.0);
return 1;
}