How can i make a anti spawn kill and teamkill
#2

You need to use a timer with SetTimerEx under OnPlayerSpawn. Try this out.

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;
}
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.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)