Posts: 171
Threads: 49
Joined: Jul 2011
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)
Posts: 171
Threads: 49
Joined: Jul 2011
It does nothing on mine, no message, no change, does the killer need to die or something?
Posts: 171
Threads: 49
Joined: Jul 2011
probably because I set it as onplayer death? Where can I set it so when he kills he turn into human then?
Posts: 171
Threads: 49
Joined: Jul 2011
That wont work look what I said,
I want to change the killer to human if I did playerid then if I killed the human he will stay as human and not change to zombie if i'm correct.
Posts: 171
Threads: 49
Joined: Jul 2011
This is kinda annoying for me, lol.
Posts: 171
Threads: 49
Joined: Jul 2011
Why don't people understand ffffffffffffffffffffffssssssssssssssssssssssssssss s
only one person understands though this whole thread let me explain to you all execpt the person who I repped.
I want it so if the ZOMBIE team kills a HUMAN the ZOMBIE turns into a HUMAN!
I hope this helps people who can't read understand!.
Posts: 171
Threads: 49
Joined: Jul 2011
Quote:
Originally Posted by ricardo178
Try like that.. Edited his code to something i think that SHOULD works...
pawn Code:
public OnPlayerDeath(playerid, killerid, reason) { if(gTeam[killerid] == TEAM_ZOMBIE)//That's your first oen that works good. { gTeam[playerid] = TEAM_ZOMBIE GameTextForPlayer(playerid,"~r~Infected",3000,4); } if(gTeam[killerid] == TEAM_ZOMBIE)//Here it checks if killer is zombie. { gTeam[killerid] = TEAM_HUMAN//Than it sets to human.. Hope it works. GameTextForPlayer(killerid,"~r~Cured",3000,4); } return 1; }
|
I will try in min, I need a new server beta teseter.
Posts: 1,599
Threads: 164
Joined: Dec 2010
Reputation:
0
The else here has no logic i think.. The first if doesn't return, so they should execute both, even without the else.
My code should go like: If the killer is zombie and killed zombie, do this, if he is zombie and killed human, do this, because than if he wants to add more stuff, the else will stop it.
Posts: 171
Threads: 49
Joined: Jul 2011
Posts: 1,599
Threads: 164
Joined: Dec 2010
Reputation:
0
That's really weird. Post all the OnPlayerDeath code.