SA-MP Forums Archive
ZOMBIE/ HUMAN kill problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ZOMBIE/ HUMAN kill problem (/showthread.php?tid=129591)



ZOMBIE/ HUMAN kill problem - vardanega - 22.02.2010

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



Re: ZOMBIE/ HUMAN kill problem - vardanega - 22.02.2010

person to answer ?


Re: ZOMBIE/ HUMAN kill problem - diamondred123 - 22.02.2010

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


Re: ZOMBIE/ HUMAN kill problem - vardanega - 26.02.2010

ok ok answer please !