25.01.2010, 04:30
Ok, i want help making a Function or command that wins a player dies, they are frozen, and when a hole team is frozen the oposite team wins, Any ideas on how to make this
new bool:playerFrozen[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
TogglePlayerControl(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(/*your player team system team 1*/) t1Frozen=false;
if(/*your player team system team 2*/) t2Frozen=false;
}
if(t1Frozen)
{
//Whatever you want to do at the end of the round
}else if(t2Frozen)
{
//Whatever you want to do at the end of the round
}
}
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=true; } if(t1Frozen) { GameTextForAll("|PRISONERS ~r~WIN|", 5000, 5); GameModeExit(); }else if(t2Frozen) { GameTextForAll("|GUARDS ~r~WIN|", 5000, 5); GameModeExit(); } }