SA-MP Forums Archive
How to change player's team after death? - 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: How to change player's team after death? (/showthread.php?tid=576959)



How to change player's team after death? - KillerDVX - 07.06.2015

I was wondering of how to change player after death,

I have zombie vs soldiers gamemode,

I wan't if soldier dies, he become zombie, and same thing for zombies


Re: How to change player's team after death? - ironmen - 08.06.2015

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	SetPlayerTeam(playerid, zombies);//zombies is the team name!
return 1;
}
Please +1 reply me


Re : How to change player's team after death? - KillerDVX - 08.06.2015

Lol, we didn't define which player gonna to become a zombie didn't we ?

I wan't just survivers to become Zombies, ^_^


Re: How to change player's team after death? - DarkLored - 08.06.2015

This is just an example of how it should look, change the code I gave you to yours and try it out.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(gTeam[playerid] == Survivors) //Change this code and transform it to yours
    {
       gTeam[playerid] = Zombie; //this sets the player to a zombie if he was a survivor before his death
       return 1;
    }
    return 1;
}



Re : How to change player's team after death? - KillerDVX - 08.06.2015

Oh, i am so selly xD

Thanks @DarkLored,

+Rep.