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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admins command (
/showthread.php?tid=83325)
Admins command -
[TouchX]Ash - 24.06.2009
Код:
if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_WHITE, "| - - - Admins currently connected - - - |");
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));
new playerlevel = PlayerInfo[i][pAdmin];
new ftext1[20];
if(ahidden[i] == 1) { ftext1 = "Anonymous"; }
else if(aduty[i] == 0) { ftext1 = "Off Duty"; }
else if(aduty[i] == 1) { ftext1 = "On Duty"; }
format(string, 256, "| Admin: %s | Level: %d | Duty: %s |", sendername , playerlevel , ftext1);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
}
return 1;
}
How would I make it so if the admin is hidden it shows nothing about them on the string?
Thanks in advance =]
If you need any other information please ask.
Re: Admins command -
Flo_White - 24.06.2009
Код:
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
{
if(ahidden[i] == 0)
{
do it like this
Re: Admins command -
[TouchX]Ash - 24.06.2009
Thank you, I'll have a go when I've finished my coursework =]
Edit: Works brilliantly! Thanks very much =]