i need help please read
#1

i need help

i have server humans vs. zombies

is there a way

if everyone is zombie to automatically end a round?

thanks for help
Reply
#2

pawn Код:
// mode init
Settimer("called",time);

//
public called(playerid)
{
       if(GetPlayerTeam(playerid) == ZOMBIES) return OnPlayerSpawn(playerid);
       return 1;
}
Reply
#3

thank you soo much i made it
Reply
#4

Quote:
Originally Posted by TheGarfield
Посмотреть сообщение
pawn Код:
// mode init
Settimer("called",time);

//
public called(playerid)
{
       if(GetPlayerTeam(playerid) == ZOMBIES) return OnPlayerSpawn(playerid);
       return 1;
}
That won't work. The function 'called' will get called with a parameter of 0. Always. Also, this will just respawn that player id 0. Always. Everytime a human gets infected you need to check and see if any survivors remained and then restart.

pawn Код:
//When someone gets infected
new bool:StillAlive;
for(new i; i<MAX_PLAYERS; i++)
{
     if(gTeam[i] == SURVIVOR)//Change this to whatever would indicate he's on team survivor.  GetPlayerTeam, etc..
     {
          StillAlive = true;
          break;
     }
}

if(StillAlive)//There is still at least one survivor alive
{

}
else//There are no survivors
{

}
Reply
#5

okay i will use this then
Reply
#6

there is no need for timer , you can do that same OnPlayerDeath,

pawn Код:
OnPlayerDeath(playerid, killerid, reason){
  for(new i; i<MAX_PLAYERS; i++)
{
     if(gTeam[i] == SURVIVOR)//Change this to whatever would indicate he's on team survivor.  GetPlayerTeam, etc..
     {
          StillAlive = true;
          break;
     }
}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)