Not freezing players when killed?
#1

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:
Reply


Messages In This Thread
Not freezing players when killed? - by -Rebel Son- - 25.01.2010, 23:22
Re: Not freezing players when killed? - by -Rebel Son- - 26.01.2010, 06:44
Re: Not freezing players when killed? - by -Rebel Son- - 26.01.2010, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)