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;
}
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");
}
pawn Код:
|
And what's that ? Btw in your command you had an extra return in the end, while you already returned the value with else statement, which i removed in my post.
|
Nah it was't extra its the main one
don't forget i made else return not just return |
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);
}
}