when all death all spawn
#1

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
Reply
#2

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
Reply
#3

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

warning 202: number of arguments does not match definition
Reply
#4

GetPlayerHealth stores a variable in health.

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

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

please send me the whole time on pawn code

PS: Iґm beginner.
Reply
#6

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);
        }
    }
}
Reply
#7

yuhu nice ty its work DDDD
Reply
#8

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

What for a Timer? xD send me code pls
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)