SA-MP Forums Archive
Bite System Help. - 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)
+--- Thread: Bite System Help. (/showthread.php?tid=432932)



Bite System Help. - Richard Steinheimer - 25.04.2013

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);
}
}
}




Re: Bite System Help. - Onfroi - 25.04.2013

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);
}
}
}



Re: Bite System Help. - Richard Steinheimer - 25.04.2013

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.