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

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

pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[killerid] = TEAM_HUMAN;
It should work, no idea why it doesn't for you. But, what happens when zombie kill human in this code? It returns the message at least?
Reply
#3

It does nothing on mine, no message, no change, does the killer need to die or something?
Reply
#4

Quote:
Originally Posted by sanrock
View Post
It does nothing on mine, no message, no change, does the killer need to die or something?
Not sure as i am more for RP scripts but try killing him by setting HP to 0.. Or Spawning him and setting team again.
Reply
#5

Read what you're doing
Reply
#6

probably because I set it as onplayer death? Where can I set it so when he kills he turn into human then?
Reply
#7

Quote:
Originally Posted by sanrock
View Post
probably because I set it as onplayer death? Where can I set it so when he kills he turn into human then?
It's under onplayerdeath..
I don't see anything wrong to be honest, but i don't know, try by setting a timmer for 2 or 3 seconds(3000), than it changes the team of player.
Reply
#8

Change this:
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[killerid] = TEAM_HUMAN, GameTextForPlayer(killerid,"~r~Cured",3000,4);
To this:
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[playerid] = TEAM_HUMAN, GameTextForPlayer(killerid,"~r~Cured",3000,4);
On this"
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[killerid] = TEAM_HUMAN, GameTextForPlayer(killerid,"~r~Cured",3000,4);
You for got to change gTeam[killerid] = TEAMHUMAN to gTeam[playerid] = TEAM_HUMAN.
Reply
#9

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.
Reply
#10

Quote:
Originally Posted by Dubya
View Post
Change this:
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[killerid] = TEAM_HUMAN, GameTextForPlayer(killerid,"~r~Cured",3000,4);
To this:
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[playerid] = TEAM_HUMAN, GameTextForPlayer(killerid,"~r~Cured",3000,4);
On this"
pawn Code:
if(gTeam[killerid] == TEAM_ZOMBIE) return gTeam[killerid] = TEAM_HUMAN, GameTextForPlayer(killerid,"~r~Cured",3000,4);
You for got to change gTeam[killerid] = TEAMHUMAN to gTeam[playerid] = TEAM_HUMAN.
Not really. Your code will make the KILLED person turn into human, he wants the KILLER to turn human.. So he has to set the KILLER id to human team, and not PLAYERID, as PLAYERID, is the killed one..
Reply
#11

This is kinda annoying for me, lol.
Reply
#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
#13

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!.
Reply
#14

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

Try this one:

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);
        gTeam[killerid] = TEAM_HUMAN;
    }
    return 1;
}
Reply
#16

Quote:
Originally Posted by ricardo178
View Post
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.
Reply
#17

I still did not found the else if...
From ricardo178, but EDITED a bit.
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(gTeam[killerid] == TEAM_HUMAN)//If the killer id is human
    {
        gTeam[playerid] = TEAM_ZOMBIE; // will for for zombie
        GameTextForPlayer(playerid,"~r~Infected",3000,4);
    }
    else if(gTeam[killerid] == TEAM_ZOMBIE)//If killerid is zombie
    {
        gTeam[killerid] = TEAM_HUMAN;//will get moved for human
        GameTextForPlayer(killerid,"~r~Cured",3000,4);
    }
    return 1;
}
Test this one, should work
Reply
#18

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.
Reply
#19

Both don't work.
Reply
#20

That's really weird. Post all the OnPlayerDeath code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)