18.05.2012, 16:44
PHP код:
COMMAND:find(playerid, params[])
{
new targetid,Float:x,Float:y,Float:z, string[60];
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,"No humans online");
}
targetid = GetClosestPlayer(playerid);
GetPlayerPos(targetid,x,y,z);
SetPlayerPos(playerid,x,y,z);
format(string,sizeof(string),"Teleported to %s",GetPlayerName(targetid));
SendClientMessage(playerid,COLOR_RED,string);
return 1;
}
if(gTeam[playerid] == TEAM_HUMANS)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i) || gTeam[i] == TEAM_HUMANS) return SendClientMessage(playerid,"No zombies online");
}
targetid = GetClosestPlayer(playerid);
GetPlayerPos(targetid,x,y,z);
SetPlayerPos(playerid,x,y,z);
format(string,sizeof(string),"Teleported to %s",GetPlayerName(targetid));
SendCLientMessage(playerid,COLOR_RED,string);
}
}