Hide my admin status - 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: Hide my admin status (
/showthread.php?tid=550388)
Hide my admin status -
VictorCreed - 12.12.2014
Well, guys I'm actually using Raven's roleplay latest release and as you know that gamemode uses a static admin system (which is in-script) and I want to add a function like "/hide" which hides me in that "/admins" cmd. I tried to use some other filterscript admin systems like fadmin but I don't like them. And I'm not that good about scripting to write it myself. So I decided to ask you guys here. It will be a good favor of yours if you write an add-on cmd in that script for me. Best regards.
Re: Hide my admin status -
Arastair - 12.12.2014
Why don't you delete the /Admins command in total?
Re: Hide my admin status -
VictorCreed - 12.12.2014
That's nice to show people who's the current admin with which rank but sometimes I need to track them as undercover and they can easily see me in /admins. That causes my need into that command
Re: Hide my admin status -
Sledgehammer - 12.12.2014
Mind sharing your /admins code?
Re: Hide my admin status -
VictorCreed - 12.12.2014
PHP код:
if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, "|____ WhiteCrow's Roleplay Online Administration Team ____|");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 1338 || PlayerInfo[i][pTester] >= 1)
{
new admtext[64];
if(PlayerInfo[i][pAppearList] == 1)
{
if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Chairman"; }
else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Chief Executive Officer"; }
else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Head Administrator"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Lead Administrator"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Administrator"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Head Moderator"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Moderator"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Administrative Assitant"; }
else if(PlayerInfo[i][pTester] == 3) { admtext = "Lead Tester"; }
else if(PlayerInfo[i][pTester] == 2) { admtext = "Tester"; }
else if(PlayerInfo[i][pTester] == 1) { admtext = "Helping Tester"; }
else { admtext = "Undefined Rank"; }
}
GetPlayerName(i, sendername, sizeof(sendername));
if(PlayerInfo[i][pAdminDuty] == 0 && PlayerInfo[i][pAppearList] == 1)
{
format(string, sizeof(string), "%s - %s", admtext, sendername);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(PlayerInfo[i][pAdminDuty] == 1 && PlayerInfo[i][pAppearList] == 1)
{
format(string, sizeof(string), "%s - %s (On Duty)", admtext, sendername);
SendClientMessage(playerid, TEAM_VAGOS_COLOR, string);
}
}
}
}
}
return 1;
}
Re: Hide my admin status -
AdHaM612 - 12.12.2014
On top of your GM:
Now, we will create /hide command under OnPlayerCommandText:
pawn Код:
if (strcmp(cmd, "/hide", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] <= 0) return SendClientMessage(playerid,-1,"You are not allowed to use this command.");
if(Hidden[playerid] == 1)
{
SendClientMessage(playerid,0xFFFFFFC8,"{00FF00}[HIDE]{FFFFFF} You aren't hidden from admin list (/admins) anymore.");
Hidden[playerid] = 0;
return 1;
}
else
{
SendClientMessage(playerid,0xFFFFFFC8,"{00FF00}[HIDE]{FFFFFF} You are now hidden from admin list (/admins).");
Hidden[playerid] = 1;
}
return 1;
}
//You can edit the colors as you like.
Now, we will edit your /admins command:
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, "|____ WhiteCrow's Roleplay Online Administration Team ____|");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 1338 && Hidden[i] == 0 || PlayerInfo[i][pTester] >= 1) //You will just add if the playerid isn't hidden.
{
new admtext[64];
if(PlayerInfo[i][pAppearList] == 1)
{
if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Chairman"; }
else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Chief Executive Officer"; }
else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Head Administrator"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Lead Administrator"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Administrator"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Head Moderator"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Moderator"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Administrative Assitant"; }
else if(PlayerInfo[i][pTester] == 3) { admtext = "Lead Tester"; }
else if(PlayerInfo[i][pTester] == 2) { admtext = "Tester"; }
else if(PlayerInfo[i][pTester] == 1) { admtext = "Helping Tester"; }
else { admtext = "Undefined Rank"; }
}
GetPlayerName(i, sendername, sizeof(sendername));
if(PlayerInfo[i][pAdminDuty] == 0 && PlayerInfo[i][pAppearList] == 1)
{
format(string, sizeof(string), "%s - %s", admtext, sendername);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(PlayerInfo[i][pAdminDuty] == 1 && PlayerInfo[i][pAppearList] == 1)
{
format(string, sizeof(string), "%s - %s (On Duty)", admtext, sendername);
SendClientMessage(playerid, TEAM_VAGOS_COLOR, string);
}
}
}
}
}
return 1;
}