public OnPlayerUpdate(playerid)
{
new Float:NewArmor;
new Float:NewHP;
GetPlayerHealth(playerid,NewHP);
GetPlayerArmour(playerid,NewArmor);
if(NewHP < OldHP[playerid])
{
if(NewArmor < OldArmor[playerid])
{
new Skin = GetPlayerSkin(playerid);
if(Skin == 280 || Skin == 104 || Skin == 12 || Skin == 277)
{
format(string, sizeof(string), "~r~Infected",playerid);
GameTextForPlayer(playerid, string, 2000,5);
ZombieTeam(playerid);
SetPlayerSkin(playerid,137);
}
}
}
OldHP[playerid] = NewHP;
OldArmor[playerid] = NewArmor;
return 1;
}
Originally Posted by ZzZzZ
if u got more time,can someone make me code if u die u will be zombie,thanks
|
public OnPlayerDeath(playerid, killerid, reason)
{
if(NonZombieTeam)
{
SetZombieTeamHere
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[playerid] == TEAM_CIVILIANS)
{
gTeam[playerid] = TEAM_ZOMBIES;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[playerid] == TEAM_CIVILIANS && gTeam[killerid] == TEAM_ZOMBIES)
{
gTeam[playerid] = TEAM_ZOMBIES;
}
return 1;
}
Originally Posted by ZzZzZ
wtf,the team still stays human if i make this -.-
|
public OnPlayerDeath(playerid, killerid, reason) { if(gTeam[playerid] == TEAM_HUMAN) { GameTextForPlayer(playerid,"~r~Infected",2000,5); SetPlayerSkin(playerid,137); gTeam[playerid] = TEAM_ZOMBIE; SetPlayerTeam(playerid,2); SetPlayerColor(playerid,TEAM_ZOMBIE_COLOR); ResetPlayerWeapons(playerid); SetPlayerArmour(playerid,0); SetPlayerHealth(playerid,200); GivePlayerWeapon(playerid,WEAPON1_ZOMBIE,9999); } return 1; }
public OnPlayerSpawn(playerid) { SetPlayerInterior(playerid,0); if(gTeam[playerid] == TEAM_HUMAN) { SetPlayerHealth(playerid,50.0); GameTextForPlayer(playerid,"~w~Stay With other Survivors!",6000,5); SendClientMessage(playerid,0xFF000096,"if you need help /help"); SendClientMessage(playerid,0xFF000096,"NB: Zombies have 200 Health"); TextDrawHideForPlayer(playerid,Textdraw); TextDrawHideForPlayer(playerid,Textdraw); TextDrawHideForPlayer(playerid,Textdraw2); TextDrawHideForPlayer(playerid,Textdraw2); TogglePlayerClock(playerid, 1); } else if(gTeam[playerid] == TEAM_ZOMBIE) { GameTextForPlayer(playerid,"~w~Kill All The ~g~ Survivors",6000,5); SendClientMessage(playerid,0xFF000096,"Type /commands"); TextDrawHideForPlayer(playerid,Textdraw); TextDrawHideForPlayer(playerid,Textdraw); TextDrawHideForPlayer(playerid,Textdraw2); TextDrawHideForPlayer(playerid,Textdraw2); TogglePlayerClock(playerid, 1); new iRandom = random(sizeof(RandomSpawn)); SetPlayerPos(playerid, RandomSpawn[iRandom][0], RandomSpawn[iRandom][1],RandomSpawn[iRandom][2]); SetPlayerFacingAngle(playerid, RandomSpawn[iRandom][3]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); } return 1; }