23.12.2008, 13:42
Over main()
OnGameModeInit()
OnGameModeExit()
Anywhere in script
Not tested, but should work
pawn Код:
new SafeZoneTimer;
new hasBeenInSafeZone[MAX_PLAYERS];
forward SafeZone();
pawn Код:
SafeZoneTimer = SetTimer("SafeZone", 200, true);
pawn Код:
KillTimer(SafeZoneTimer);
pawn Код:
public SafeZone()
{
for(new i=0, m=MAX_PLAYERS; i<m; i++)
{
if(IsPlayerInArea(i, 1319.6, -2755.979, 2207.118, -2125.373) && !hasBeenInSafeZone[i])
{
GameTextForPlayer(i, "~g~Safe Zone", 2000, 5);
//Add timer for god here
hasBeenInSafeZone[i] = 1;
}
else if(hasBeenInSafeZone[i])
{
GameTextForPlayer(i, "~r~Left Safe Zone", 2000, 5);
//Kill godtimer
hasBeenInSafeZone[i] = 0;
}
}
return true;
}