ZOMBIE/ HUMAN kill problem
#1

Hi, I have a small problem with this code I would like when a human player is killed by a zombie (Team 1) with a chainsaw he becomes a zombie and respawn next to the place where he and death.


Код:
public OnPlayerDeath(playerid, killerid, reason)
{
	if (reason == 9)//Si le tueur а l'arme ID 9
	{
	new pName[MAX_PLAYER_NAME], string[48];
	new rand = random(sizeof(RandomSpawn));
  SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
  SetPlayerInterior(playerid,0);
  SetPlayerColor(playerid,COLOR_ZOMBIE);
  SetPlayerTeam(playerid,1);
  SetPlayerHealth(playerid, 200);
  GivePlayerWeapon(playerid, 9, 9999);
  GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), "%s et devenu un zombie.", pName );//turned into zombie
  SendClientMessageToAll(0xBAC80BFF, string);
  GameTextForPlayer(playerid, "~y~ZOMBIE", 15000, 4);
	}
	return 1;
}

//----------------------
public OnPlayerSpawn(playerid)
{
 new rand = random(sizeof(RandomSpawn));
 SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
 SetPlayerInterior(playerid,0);
 PlayerPlaySound(playerid,1184,0.0,0.0,0.0);
 if (gTeam[playerid] == 0)
 {
 SetPlayerInterior(playerid,0);
 SetPlayerColor(playerid,COLOR_CIVIL);
 SetPlayerTeam(playerid,0);
 SetPlayerHealth(playerid, 100);
 GameTextForPlayer(playerid, "~b~CIVIL", 15000, 4);
 }
 else if (gTeam[playerid] == 1)
 {
 SetPlayerInterior(playerid,0);
 SetPlayerColor(playerid,COLOR_ZOMBIE);
 SetPlayerTeam(playerid,1);
 SetPlayerHealth(playerid, 200);
 GivePlayerWeapon(playerid, 9, 9999);
 GameTextForPlayer(playerid, "~y~ZOMBIE", 15000, 4);
 
 }
 return 1;
}

Thanks for your help
Reply
#2

person to answer ?
Reply
#3

Quote:
Originally Posted by vardanega
person to answer ?
i would but i dont have a server yet, im getting one hopefully, do you need the game to make it? i have it but wont work on this pc when this pc is the one that is up the most
Reply
#4

ok ok answer please !
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)