[Solved] Need help with my little command
#8

Thanks for replies,
coop>
pawn Код:
dcmd_admins(playerid,params[])
{
#pragma unused params
new Count[2], i, string[128];
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
if(dUserINT(PlayerName(i)).("Adminlvl") == 0) Count[0]++;
}

if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && dUserINT(PlayerName(i)).("Adminlvl") == 0) ) return SendClientMessage(playerid, COLOR_BLUE, "Admins Online: None");

if(Count[0] == 1)
{
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && dUserINT(PlayerName(i)).("Adminlvl") > 0)
{
format(string, sizeof(string), "Admins Online: %s (%d)",PlayerName2(i), PlayerData[i][Adminlvl] ); SendClientMessage(playerid, COLOR_BLUE, string);
}
}

if(Count[0] > 1)
{
new x; format(string, sizeof(string), "Admins Online: ");
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && dUserINT(PlayerName(i)).("Adminlvl") > 0)
{
format(string,sizeof(string),"%s%s (%d)",string,PlayerName2(i),PlayerData[i][Adminlvl]);
x++;
if(x >= 5)
{
SendClientMessage(playerid, COLOR_BLUE, string); format(string, sizeof(string), "Admins Online: "); x = 0;
}
else format(string, sizeof(string), "%s, ", string);
}
if(x <= 4 && x > 0)
{
string[strlen(string)-3] = '.';
SendClientMessage(playerid, COLOR_BLUE, string);
}
}
return 1;
}
Why did you used PlayerName2(i) here:
pawn Код:
format(string,sizeof(string),"%s%s (%d)",string,PlayerName2(i),PlayerData[i][Adminlvl]);
?
Shouldn't it be PlayerName ?
Cause I only have stock PlayerName(playerid)

And...
Quote:

error 017: undefined symbol "PlayerData"

Did you copied this from GF ?
Reply


Messages In This Thread
[Solved] Need help with my little command - by SiJ - 02.07.2009, 17:09
Re: Need help with my little command - by Kyosaur - 02.07.2009, 17:12
Re: Need help with my little command - by refshal - 02.07.2009, 17:22
Re: Need help with my little command - by Nero_3D - 02.07.2009, 18:43
Re: Need help with my little command - by refshal - 02.07.2009, 18:45
Re: Need help with my little command - by Nero_3D - 02.07.2009, 19:17
Re: Need help with my little command - by refshal - 02.07.2009, 19:23
Re: Need help with my little command - by SiJ - 03.07.2009, 10:18
Re: Need help with my little command - by refshal - 03.07.2009, 10:19
Re: Need help with my little command - by SiJ - 03.07.2009, 10:20

Forum Jump:


Users browsing this thread: 1 Guest(s)