SA-MP Forums Archive
when all death all spawn - 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)
+--- Thread: when all death all spawn (/showthread.php?tid=379614)



when all death all spawn - DexXxo - 22.09.2012

Hi guys,
can you show me how I do it when all the players are all dead be spawned simultaneously resist and stay dead when they die?

PS: sry for my bad English iґm German


Re: when all death all spawn - RedJohn - 22.09.2012

pawn Код:
forward DeadTimer();
public DeadTimer()
{
    for(new i=0;i < MAX_PLAYERS; i++) // foreach(Player, i) - if using foreach (Recommended)
    {
        if(GetPlayerHealth(i) < 1 && IsPlayerConnected(i) == 1)
        {
            SpawnPlayer(i);
        }
    }
}
Try it.

SOURCE: https://sampforum.blast.hk/showthread.php?tid=245683

PS: If your english sucks post it here: http://forum.sa-mp.com/forumdisplay.php?f=28


AW: when all death all spawn - DexXxo - 22.09.2012

I have a warning on this line:
if(GetPlayerHealth(i) < 1 && IsPlayerConnected(i) == 1)

warning 202: number of arguments does not match definition


Re: when all death all spawn - clarencecuzz - 22.09.2012

GetPlayerHealth stores a variable in health.

pawn Код:
new Float:health;
GetPlayerHealth(i, health);
if(health < 1 && IsPlayerConnected(i))
{
    //etc.



AW: when all death all spawn - DexXxo - 22.09.2012

now i have this error
error 017: undefined symbol "i"

please send me the whole time on pawn code

PS: Iґm beginner.


Re: when all death all spawn - RedJohn - 22.09.2012

pawn Код:
forward DeadTimer();
public DeadTimer()
{
    for(new i=0;i < MAX_PLAYERS; i++) // foreach(Player, i) - if using foreach (Recommended)
    {
        new Float:health;
        GetPlayerHealth(i, health);
        if(health < 1 && IsPlayerConnected(i))
        {
            SpawnPlayer(i);
        }
    }
}



AW: when all death all spawn - DexXxo - 22.09.2012

yuhu nice ty its work DDDD


Re: when all death all spawn - RedJohn - 22.09.2012

Don't forget to set timer on game mode init.


AW: when all death all spawn - DexXxo - 22.09.2012

What for a Timer? xD send me code pls


Re: when all death all spawn - RedJohn - 22.09.2012

pawn Код:
SetTimer("DeadTimer", 1, true);