Only shows your name on /admins. -
MaDsON - 10.04.2014
Basically when you do this command IG, it only shows one admin online (yourself) and there is always more then that.. I need it to show ALL of the administrators.
pawn Код:
CMD:admins(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= PlayerInfo[playerid][pAdmin])
{
new string[128];
if(PlayerInfo[i][pAdminDuty] == 1) { format(string, sizeof(string), "%s: {00FF00}%s", GetPlayerAdminLevel(i), GetPlayerNameEx(i)); }
if(PlayerInfo[i][pAdminDuty] == 0) { format(string, sizeof(string), "%s: {FF0000}%s", GetPlayerAdminLevel(i), GetPlayerNameEx(i)); }
ShowPlayerDialog(playerid, 4458, DIALOG_STYLE_MSGBOX, "Online Admins", string, "Okay", "");
return 1;
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "Have questions? Ask on /n chat.");
SendClientMessageEx(playerid, COLOR_GRAD1, "If you need to report about something, type /report [id] [reason].");
}
return 1;
}
Re: Only shows your name on /admins. -
Gus_Stone - 10.04.2014
Have you tried to change the string value? try 1024 instead of 128.
Re: Only shows your name on /admins. -
Dubya - 10.04.2014
Код:
%s: {00FF00}%s
%s: {FF0000}%s
The first %s should be changed to %d or %i |
Код:
%d: {00FF00}%s
%d: {FF0000}%s
Re: Only shows your name on /admins. -
Lidor124 - 10.04.2014
Post GetPlayerAdminLevel function
Re: Only shows your name on /admins. -
PrivatioBoni - 10.04.2014
What's with this line?
if(PlayerInfo[playerid][pAdmin] >= 1)
That's checking if the person who executed the command is >= 1.
Re: Only shows your name on /admins. -
AphexCCFC - 10.04.2014
pawn Код:
CMD:admins(playerid, params[])
{
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] > 0)
{
new string[128];
if(PlayerInfo[i][pAdminDuty] == 1) { format(string, sizeof(string), "%d: {00FF00}%s", GetPlayerAdminLevel(i), GetPlayerNameEx(i)); }
if(PlayerInfo[i][pAdminDuty] == 0) { format(string, sizeof(string), "%d: {FF0000}%s", GetPlayerAdminLevel(i), GetPlayerNameEx(i)); }
ShowPlayerDialog(playerid, 4458, DIALOG_STYLE_MSGBOX, "Online Admins", string, "Okay", "");
}
}
SendClientMessageEx(playerid, COLOR_GRAD1, "Have questions? Ask on /n chat.");
SendClientMessageEx(playerid, COLOR_GRAD1, "If you need to report about something, type /report [id] [reason].");
return 1;
}
Gonna have to sort out the indents though, typed it on my phone.
Re: Only shows your name on /admins. -
Bingo - 10.04.2014
pawn Код:
%d - Use this when numeric comes. (Eg: Date, time, Level etc)
pawn Код:
%s - Use this whe text comes. (Eg: Text, Names, Parameters like getting ip)
Beaware of small small mistakes too

.
Re: Only shows your name on /admins. -
AphexCCFC - 10.04.2014
Kinda removed few things but can add them back, you also put "return 1" in the loop so that's why it shows one admin.
Re: Only shows your name on /admins. -
MaDsON - 10.04.2014
I know the differences between %d and %s, the ranks are in letters, not a numerical value.