If you kill someone killerid turns into other team? -
sanrock - 09.06.2012
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)
Re: If you kill someone killerid turns into other team? -
ricardo178 - 09.06.2012
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?
Re: If you kill someone killerid turns into other team? -
sanrock - 09.06.2012
It does nothing on mine, no message, no change, does the killer need to die or something?
Re: If you kill someone killerid turns into other team? -
ricardo178 - 09.06.2012
Quote:
Originally Posted by sanrock
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.
Re: If you kill someone killerid turns into other team? -
[ABK]Antonio - 09.06.2012
Read what you're doing
Re: If you kill someone killerid turns into other team? -
sanrock - 09.06.2012
probably because I set it as onplayer death? Where can I set it so when he kills he turn into human then?
Re : Re: If you kill someone killerid turns into other team? -
ricardo178 - 09.06.2012
Quote:
Originally Posted by sanrock
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.
Re: If you kill someone killerid turns into other team? -
Dubya - 09.06.2012
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.
Re: If you kill someone killerid turns into other team? -
sanrock - 09.06.2012
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.
Re : Re: If you kill someone killerid turns into other team? -
ricardo178 - 09.06.2012
Quote:
Originally Posted by Dubya
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..
Re: If you kill someone killerid turns into other team? -
sanrock - 09.06.2012
This is kinda annoying for me, lol.
Re: If you kill someone killerid turns into other team? -
[ABK]Antonio - 09.06.2012
Quote:
Originally Posted by sanrock
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;
}
Re: If you kill someone killerid turns into other team? -
sanrock - 09.06.2012
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!.
Re : If you kill someone killerid turns into other team? -
ricardo178 - 09.06.2012
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;
}
Re: If you kill someone killerid turns into other team? -
milanosie - 09.06.2012
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;
}
Re: Re : If you kill someone killerid turns into other team? -
sanrock - 09.06.2012
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.
Re: If you kill someone killerid turns into other team? - kikito - 09.06.2012
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
Re : If you kill someone killerid turns into other team? -
ricardo178 - 09.06.2012
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.
Re: If you kill someone killerid turns into other team? -
sanrock - 09.06.2012
Both don't work.
Re : If you kill someone killerid turns into other team? -
ricardo178 - 09.06.2012
That's really weird. Post all the OnPlayerDeath code.