If you kill someone killerid turns into other team?
#12

Quote:
Originally Posted by sanrock
View Post
I made like
If a zombie kills human, the human turns into zombie after death

but how do I make like

If a zombie kills human, zombie turns into human?

This is the human to zombie one
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[playerid] = TEAM_ZOMBIE, GameTextForPlayer(playerid,"~r~Infected",3000,4);
^ works amazing

But I tried to make zombie into human but it doesn't work.
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[killerid] = TEAM_HUMAN, GameTextForPlayer(killerid,"~r~Cured",3000,4);
^ The zombie doesn't turn to human though. (it is under playerdeath)
I guess I have to spoon feed...

pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[playerid] = TEAM_ZOMBIE, GameTextForPlayer(playerid,"~r~Infected",3000,4);
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[killerid] = TEAM_HUMAN, GameTextForPlayer(killerid,"~r~Cured",3000,4);
That's what you're doing..You're returning before the second check, so it never happens because the function stops.

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(gTeam[killerid] == TEAM_ZOMBIE)
    {
        gTeam[playerid] = TEAM_ZOMBIE
        GameTextForPlayer(playerid,"~r~Infected",3000,4);
    }
    if(gTeam[killerid] == TEAM_HUMAN) //this was TEAM_ZOMBIE, but if you wanted it that..You would need to add a check for the players current team or the above would be useless
    {
        gTeam[killerid] = TEAM_HUMAN
        GameTextForPlayer(killerid,"~r~Cured",3000,4);
    }
    return 1;
}
Reply


Messages In This Thread
If you kill someone killerid turns into other team? - by sanrock - 09.06.2012, 19:33
Re: If you kill someone killerid turns into other team? - by ricardo178 - 09.06.2012, 19:38
Re: If you kill someone killerid turns into other team? - by sanrock - 09.06.2012, 19:40
Re: If you kill someone killerid turns into other team? - by ricardo178 - 09.06.2012, 19:48
Re: If you kill someone killerid turns into other team? - by [ABK]Antonio - 09.06.2012, 19:49
Re: If you kill someone killerid turns into other team? - by sanrock - 09.06.2012, 19:50
Re : Re: If you kill someone killerid turns into other team? - by ricardo178 - 09.06.2012, 19:56
Re: If you kill someone killerid turns into other team? - by Dubya - 09.06.2012, 19:59
Re: If you kill someone killerid turns into other team? - by sanrock - 09.06.2012, 20:00
Re : Re: If you kill someone killerid turns into other team? - by ricardo178 - 09.06.2012, 20:01
Re: If you kill someone killerid turns into other team? - by sanrock - 09.06.2012, 20:08
Re: If you kill someone killerid turns into other team? - by [ABK]Antonio - 09.06.2012, 20:15
Re: If you kill someone killerid turns into other team? - by sanrock - 09.06.2012, 20:22
Re : If you kill someone killerid turns into other team? - by ricardo178 - 09.06.2012, 20:23
Re: If you kill someone killerid turns into other team? - by milanosie - 09.06.2012, 20:26
Re: Re : If you kill someone killerid turns into other team? - by sanrock - 09.06.2012, 20:28
Re: If you kill someone killerid turns into other team? - by kikito - 09.06.2012, 20:33
Re : If you kill someone killerid turns into other team? - by ricardo178 - 09.06.2012, 20:36
Re: If you kill someone killerid turns into other team? - by sanrock - 09.06.2012, 20:41
Re : If you kill someone killerid turns into other team? - by ricardo178 - 09.06.2012, 20:45

Forum Jump:


Users browsing this thread: 3 Guest(s)