Bite System Help.
#1

So i scripted this system and the problem is... Zombies can bite Zombies.. I need help with making it so they cannot bite each other.. They may only bite Humans.

Quote:

if(newkeys == 12
{
new victim = GetClosestPlayer(playerid);
if(PlayerInfo[playerid][Zombie] == 0)
{
SendClientMessage(playerid, COLOR_UNEMD, "SERVER: You are not a Zombie.");
return 1;
}
if(PlayerInfo[playerid][Zombie] == 1)
{
if(GetDistanceBetweenPlayers(playerid, victim))
{
GameTextForPlayer(victim,"[Zombie]: ~w~Arghh!",6000,5);
PlayerPlaySound(victim, 1130, 0.0, 0.0, 0.0);
PlayerPlaySound(playerid, 1130, 0.0, 0.0, 0.0);//
PlayerInfo[victim][Zombie] = 1;
format(string, sizeof(string), "%s rushes over to %s biting him.", GetPlayerNameEx(playerid), GetPlayerNameEx(victim));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GetPlayerHealth(victim, health);
SetPlayerHealth(victim, health-31);

}
else
{
GameTextForPlayer(playerid,"[ZOMBIE:] There is no one around.",6000,5);
}
}
}

Reply
#2

pawn Код:
if(newkeys == 12
{
new victim = GetClosestPlayer(playerid) && if(PlayerInfo[playerid][Human] == 1);
if(PlayerInfo[playerid][Zombie] == 0)
{
SendClientMessage(playerid, COLOR_UNEMD, "SERVER: You are not a Zombie.");
return 1;
}
if(PlayerInfo[playerid][Zombie] == 1)
{
if(GetDistanceBetweenPlayers(playerid, victim))
{
GameTextForPlayer(victim,"[Zombie]: ~w~Arghh!",6000,5);
PlayerPlaySound(victim, 1130, 0.0, 0.0, 0.0);
PlayerPlaySound(playerid, 1130, 0.0, 0.0, 0.0);//
PlayerInfo[victim][Zombie] = 1;
format(string, sizeof(string), "%s rushes over to %s biting him.", GetPlayerNameEx(playerid), GetPlayerNameEx(victim));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GetPlayerHealth(victim, health);
SetPlayerHealth(victim, health-31);

}
else
{
GameTextForPlayer(playerid,"[ZOMBIE:] There is no one around.",6000,5);
}
}
}
Reply
#3

Quote:
Originally Posted by Onfroi
Посмотреть сообщение
pawn Код:
if(newkeys == 12
{
new victim = GetClosestPlayer(playerid) && if(PlayerInfo[playerid][Human] == 1);
if(PlayerInfo[playerid][Zombie] == 0)
{
SendClientMessage(playerid, COLOR_UNEMD, "SERVER: You are not a Zombie.");
return 1;
}
if(PlayerInfo[playerid][Zombie] == 1)
{
if(GetDistanceBetweenPlayers(playerid, victim))
{
GameTextForPlayer(victim,"[Zombie]: ~w~Arghh!",6000,5);
PlayerPlaySound(victim, 1130, 0.0, 0.0, 0.0);
PlayerPlaySound(playerid, 1130, 0.0, 0.0, 0.0);//
PlayerInfo[victim][Zombie] = 1;
format(string, sizeof(string), "%s rushes over to %s biting him.", GetPlayerNameEx(playerid), GetPlayerNameEx(victim));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GetPlayerHealth(victim, health);
SetPlayerHealth(victim, health-31);

}
else
{
GameTextForPlayer(playerid,"[ZOMBIE:] There is no one around.",6000,5);
}
}
}
That did not work at all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)