SA-MP Forums Archive
Not freezing players when killed? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Not freezing players when killed? (/showthread.php?tid=123473)



Not freezing players when killed? - -Rebel Son- - 25.01.2010

Ok, This code was made for me for my Objective gamemode, It was made for, when a player dies, they freeze on respawn, When a hole team is frozen, (dead) that team loose's and the oposite team wins. and restarts the server. But it did'nt work, when the player dies, they just respawn, and show's the dialog for the rules. I'm not sure why it's not working.

CODE:
Код:
new bool:playerFrozen[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
  TogglePlayerControllable(playerid, false);
  playerFrozen[playerid] = true;
}
forward TeamFreezeTimer();
public TeamFreezeTimer()
{
  new bool:t1Frozen=true, bool:t2Frozen=true;
  for(new playerid=0; playerid < GetMaxPlayers() && (t1Frozen || t2Frozen); playerid++)
  {
    if(playerFrozen[playerid]) continue;
    if(gTeam[playerid] == 1) t1Frozen=false;
    if(gTeam[playerid] == 2) t2Frozen=false;
  }
  if(t1Frozen)
  {
  GameTextForAll("|PRISONERS ~r~WIN|", 5000, 5);
  GameModeExit();
  }else if(t2Frozen)
  {
  GameTextForAll("|GUARDS ~r~WIN|", 5000, 5);
  GameModeExit();
  }
}
Picture
see i dont freeze or show that the other team wins D:


Re: Not freezing players when killed? - -Rebel Son- - 26.01.2010

anyone?


Re: Not freezing players when killed? - -Rebel Son- - 26.01.2010

bump