[HELP ME] /admins command - 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)
+--- Thread: [HELP ME] /admins command (
/showthread.php?tid=472513)
[HELP ME] /admins command -
jdog105 - 28.10.2013
I need help making a /admins cmd to show players what admins are online i also need a cmd to hide the admins from the list,can someone please help me.
Thanks-Jeremy
Respuesta: [HELP ME] /admins command -
RafaelZam - 29.10.2013
simple, but don't forget define this..
C:
pawn Код:
enum PlayerInfo
{
Adminlevel
}
new pInfo[MAX_PLAYERS][PlayerInfo];
here the command
pawn Код:
CMD:admins(playerid, params[]) //thats says, you must use /admins to see the admins
{
SendClientMessage(playerid, -1, "____Admins Online___");
for(new i = 0; i < MAX_PLAYERS; i++) //show you all admins online/users
{
if(pInfo[i][Adminlevel] >= 1)//checks if is admin
{
new string[128], pname[24];
GetPlayerName(i, pname, sizeof(pname)); // gets the admin name
format(string, sizeof(string), "%s {FFFFFF} Level: %d (ID:%d)", pname, pInfo[i][Adminlevel], i);
SendClientMessage(playerid, -1, string);
}
}
return 1;
}
try to learn something...Don't ask things like this here, C: we have a section about tutorials

RafaelZam
Re: Respuesta: [HELP ME] /admins command -
jdog105 - 29.10.2013
Quote:
Originally Posted by Rafael_Zambrano
simple, but don't forget define this..
C:
pawn Код:
enum PlayerInfo { Adminlevel } new pInfo[MAX_PLAYERS][PlayerInfo];
here the command
pawn Код:
CMD:admins(playerid, params[]) //thats says, you must use /admins to see the admins { SendClientMessage(playerid, -1, "____Admins Online___"); for(new i = 0; i < MAX_PLAYERS; i++) //show you all admins online/users { if(pInfo[i][Adminlevel] >= 1)//checks if is admin { new string[128], pname[24]; GetPlayerName(i, pname, sizeof(pname)); // gets the admin name format(string, sizeof(string), "%s {FFFFFF} Level: %d (ID:%d)", pname, pInfo[i][Adminlevel], i); SendClientMessage(playerid, -1, string); } } return 1; }
try to learn something...Don't ask things like this here, C: we have a section about tutorials 
RafaelZam
|
Thx man this helped