18.05.2012, 15:15
Hello every one i am making Zombie Server and i wanna make Class for zombie that Can /find and Teleport to the Closest Player i got everything but ,Zombie won't Teleport to the Human
Here is the Code
Here is the Code
pawn Код:
COMMAND:find(playerid, params[])
{
new targetid,Float:x,Float:y,Float:z;
if(gTeam[playerid] == TEAM_ZOMBIES && ZombieClass[playerid] == Rotting)
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(!IsPlayerConnected(i) && gTeam[i] == TEAM_ZOMBIES)
{
return SendClientMessage(playerid,COLOR_RED,"No humans Online");
}
if(gTeam[targetid] == TEAM_HUMANS)
{
targetid = GetClosestPlayer(playerid);
GetPlayerPos(targetid,x,y,z);
SetPlayerPos(playerid,x,y,z);
}
}
else return SendClientMessage(playerid,COLOR_RED,"You are Not Rotting/Zombie");
return 1;
}