/admins help - 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 help (
/showthread.php?tid=246272)
/admins help -
tanush - 03.04.2011
When player does /admins while admins are online, it says for example "Tan_Momochi[AX] (Server Owner)" then under it shows "No Admins are connected in the server."
pawn Код:
CMD:admins(playerid, params[])
{
for(new i = 0; i < 10; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerData[i][AdminLevel] != 0)
{
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(i,name,MAX_PLAYER_NAME);
if(PlayerData[i][AdminLevel] == 1) format(string, sizeof(string), "%s level 1 (Server Moderator)",name,PlayerData[playerid][AdminLevel]);
if(PlayerData[i][AdminLevel] == 2) format(string, sizeof(string), "%s level 2 (Global Moderator)",name,PlayerData[playerid][AdminLevel]);
if(PlayerData[i][AdminLevel] == 3) format(string, sizeof(string), "%s level 3 (Administrator)",name,PlayerData[playerid][AdminLevel]);
if(PlayerData[i][AdminLevel] == 4) format(string, sizeof(string), "%s level 4 (Server Owner)",name,PlayerData[playerid][AdminLevel]);
SendClientMessage(playerid,0xFF9900AA,string);
}
}
else return SendClientMessage(playerid,0xFF0000FF,"No Admins are connected in the server.");
}
return 1;
}
Re: /admins help -
SlashPT - 03.04.2011
pawn Код:
CMD:admins(playerid, params[])
{
new
OnAdmins
;
for(new i = 0; i < 10; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerData[i][AdminLevel] != 0)
{
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(i,name,MAX_PLAYER_NAME);
if(PlayerData[i][AdminLevel] == 1) format(string, sizeof(string), "%s level 1 (Server Moderator)",name,PlayerData[playerid][AdminLevel]);
if(PlayerData[i][AdminLevel] == 2) format(string, sizeof(string), "%s level 2 (Global Moderator)",name,PlayerData[playerid][AdminLevel]);
if(PlayerData[i][AdminLevel] == 3) format(string, sizeof(string), "%s level 3 (Administrator)",name,PlayerData[playerid][AdminLevel]);
if(PlayerData[i][AdminLevel] == 4) format(string, sizeof(string), "%s level 4 (Server Owner)",name,PlayerData[playerid][AdminLevel]);
SendClientMessage(playerid,0xFF9900AA,string);
OnAdmins++;
}
}
}
if ( OnAdmins == 0 )
{
return SendClientMessage(playerid,0xFF0000FF,"No Admins are connected in the server.");
}
return 1;
}
try that..
Re: /admins help -
Mean - 03.04.2011
You don't need the
pawn Код:
PlayerData[playerid][AdminLevel]
part in the formats.