25.01.2010, 23:22
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:
Picture
see i dont freeze or show that the other team wins D:
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(); } }
see i dont freeze or show that the other team wins D: