[Help] /admins command. [SOLVED] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] /admins command. [SOLVED] (
/showthread.php?tid=94336)
[Help] /admins command. [SOLVED] -
Nakash - 29.08.2009
I have a problem with this command,when i type /admins it gives the LEVEL and the ID of the first admin,
for example i logged in first so when i type /admins it shows my ID and my LEVEL to all the admin!
i think it's something with the loop but i haven't figured it out yet.
Quote:
if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 133
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "[Level:%d] %s (ID:%d)", sendername,PlayerInfo[playerid][pAdmin],playerid);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
}
}
return 1;
}
|
thanks alot!
Re: [Help] /admins command. -
gijsmin - 29.08.2009
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "[Level:%d] %s (ID:%d)", PlayerInfo[i][pAdmin],sendername,playerid);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
}
}
return 1;
}
Try that
Re: [Help] /admins command. -
ded - 29.08.2009
Quote:
|
Originally Posted by Gijs (TSG-Hosting.de)
pawn Код:
if (strcmp(cmd, "/admins", true) == 0) { if(IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "[Level:%d] %s (ID:%d)", PlayerInfo[i][pAdmin],sendername,playerid);
SendClientMessage(playerid, COLOR_GREEN, string);
} } } } return 1; }
Try that
|
Lol? You just copied and pasted the same code
Re: [Help] /admins command. -
Correlli - 29.08.2009
Quote:
|
Originally Posted by » ded «
Lol? You just copied and pasted the same code 
|
No, he didn't.
But you should read
this.
Re: [Help] /admins command. -
ded - 29.08.2009
Quote:
|
Originally Posted by Don Correlli
Quote:
|
Originally Posted by » ded «
Lol? You just copied and pasted the same code 
|
No, he didn't.
But you should read this.
|
What did he change then ...
Re: [Help] /admins command. -
gijsmin - 29.08.2009
i think you need to learn some pawn
Because PlayerInfo[playerid][pAdmin] is
[red]NOT[/red] the same as PlayerInfo[pAdmin]
some of your stuff is not good try my code and tell us what happens
Re: [Help] /admins command. -
ded - 29.08.2009
Ahhh gay, forgive me I misread.
Re: [Help] /admins command. -
MenaceX^ - 29.08.2009
Quote:
|
Originally Posted by » ded «
Ahhh gay, forgive me I misread. 
|
The 'gay' part wasn't necessary.
Go to the GF topic as it's related to the GF..
Re: [Help] /admins command. -
Nakash - 29.08.2009
Quote:
|
Originally Posted by Gijs (TSG-Hosting.de)
pawn Код:
if (strcmp(cmd, "/admins", true) == 0) { if(IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "[Level:%d] %s (ID:%d)", PlayerInfo[i][pAdmin],sendername,playerid);
SendClientMessage(playerid, COLOR_GREEN, string);
} } } } return 1; }
Try that
|
thanks! it works now hehe,but the id still 1 ;p maybe i'll change playerid to I?
Re: [Help] /admins command. -
gijsmin - 29.08.2009
Quote:
|
Originally Posted by Nakash
Quote:
|
Originally Posted by Gijs (TSG-Hosting.de)
pawn Код:
if (strcmp(cmd, "/admins", true) == 0) { if(IsPlayerConnected(playerid)) { SendClientMessage(playerid, COLOR_GRAD1, "Admins Online:"); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338) { GetPlayerName(i, sendername, sizeof(sendername)); format(string, 256, "[Level:%d] %s (ID:%d)", PlayerInfo[i][pAdmin],sendername,playerid);
SendClientMessage(playerid, COLOR_GREEN, string);
} } } } return 1; }
Try that
|
thanks! it works now hehe,but the id still 1 ;p maybe i'll change playerid to I?
|
yes if you do that then it will work
Gijs