SA-MP Forums Archive
i need help please read - 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: i need help please read (/showthread.php?tid=259045)



i need help please read - dorotej - 02.06.2011

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


Re: i need help please read - TheGarfield - 02.06.2011

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

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



Re: i need help please read - dorotej - 02.06.2011

thank you soo much i made it


Re: i need help please read - Backwardsman97 - 02.06.2011

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
{

}



Re: i need help please read - dorotej - 03.06.2011

okay i will use this then


Re: i need help please read - CoaPsyFactor - 03.06.2011

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;
     }
}
}