25.11.2012, 04:13
Hello guys i have organization script and in org script a command is /members if any one join the org and he is not online then leader cant see his name in member list. I want if some one join any org and if he is not online then leader can his name /members please help me here is the code of /members
pawn Код:
CMD:members(playerid, params[])
{
#pragma unused params
if (!IsLeader(playerid)) return SendClientMessage(playerid, COLOR_RED,"You're not the leader of an organization");
new string[60];
new count = 0;
SendClientMessage(playerid, COLOR_YELLOW,"Employees online");
for (new i=0;i<MAX_PLAYERS;i++)
{
if (IsPlayerConnected(i))
{
if (PlayerOrg[i] == PlayerOrg[playerid] && i != playerid)
{
format(string,sizeof(string),"%s - %s", PlayerName(i), PlayerRank[i]);
SendClientMessage(playerid, COLOR_WHITE, string);
count++;
}
}
}
if (count == 0)
{
SendClientMessage(playerid, COLOR_YELLOW,"None of your employees are online");
}
else
{
format(string,sizeof(string),"%d member(s) online", count);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}