27.05.2011, 07:17
Simple ...
Create a variable
Now as the player connects , we gonna have to set his SecretAdmin to 0 , witch means he isnt a secret admin.
Now, the command that will make you secret or not .
now for the /admins command(fixed) .
Create a variable
pawn Код:
new SecretAdmin[MAX_PLAYERS];
pawn Код:
public OnPlayerConnecte(playerid)
{
if(PlayerInfo[playerid][pAdmin] > 0) { SecretAdmin[playerid] = 0; }
return 1;
}
pawn Код:
if(strcmp(cmd,"/secret",true) == 0)
{
if(PlayerInfo[playerid][pAdmin] > 0)
{
if(SecretAdmin[playerid] == 0) return SecretAdmin[playerid] = 1;
if(SecretAdmin[playerid] == 1) return SecretAdmin[playerid] = 0;
}
return 1;
}
pawn Код:
if(strcmp(cmd,"/admins",true) == 0)
{
if(IsPlayerConnected(playerid))
{
new giveplayer[MAX_PLAYER_NAME],string[256];
SendClientMessage(playerid,COLOR_WHITE," Admins Online :");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) && PlayerInfo[i][pAdmin] > 0 && SecretAdmin[i] == 0)
{
GetPlayerName(i,giveplayer,sizeof(giveplayer));
format(string,sizeof(string),"%d Administratior: %s",PlayerInfo[i][pAdmin],giveplayer);
SendClientMessage(playerid,COLOR_GREY,string);
}
}
}
return 1;
}