28.08.2012, 13:42
Can anyone teach me how to do this. Example; Im a zombie, when i kill a human,
the human will turn into a zombie.
I will gave you 1+rep ;(
the human will turn into a zombie.
I will gave you 1+rep ;(
if(gTeam[killerid] == TEAM_ZOMBIE)
{
gTeam[playerid] = TEAM_ZOMBIE;
GameTextForPlayer(playerid,"~y~Infected",3000,4);
SendClientMessage(playerid,COLOR_RED,"You have been infected by a zombie, You're now one of them");
return 1;
}
new Infected[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Infected[playerid] = 0;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[killerid] == ZOMBIE)
{
Infected[playerid] = 1;
ForceClassSelection(playerid);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(Infected[playerid] == 1)
{
gTeam[playerid] = ZOMBIE;
Infected[playerid] = 0;
SpawnPlayer(playerid); //it is to set his skin and spawn..
}
return 1;
}