I'm need a help in command admins.
#1

pawn Code:
CMD:admins( playerid, params[ ] )
{
SCM(playerid,-1,"Admins:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
        if( IsPlayerConnected( i ) && ( GetPVarInt( i , "Level" ) > 1) )
        {
        new adminslist[128];
        format(adminslist,sizeof(adminslist),"Admins Online %s [id:%d]",pName( playerid ),playerid);
        SendClientMessage(playerid,-1,adminslist);
        }
    }
return 1;}
If I'm an admin writes my name twice in "/admins" and also my friend admin and I see just me in admins.
Check the command please
Reply
#2

PHP Code:
CMD:admins(playeridparams[])
{
    new 
string[128];
    if(
PlayerInfo[playerid][pAdmin] >= 2) {
        
SendClientMessageEx(playeridCOLOR_GRAD1"Admins Online:");
        foreach(
Playeri) {
            if(
PlayerInfo[i][pAdmin] >= && PlayerInfo[i][pAdmin] <= PlayerInfo[playerid][pAdmin]) {
                new 
sstring[128], rtoken;
                new 
strFromFile[128];
                new 
monthdayyear;
                new 
playern[MAX_PLAYER_NAME];
                
GetPlayerName(iplayernsizeof(playern));
                
getdate(yearmonthday);
                
format(sstring,sizeof(sstring),"admins/rtokens/%s[%d'%d'%d]",playern,month,day,year);
                if(
fexist(sstring)) {
                    new 
Filefile fopen(sstringio_read);
                    if(
file) {
                        
fread(filestrFromFile);
                        
fclose(file);
                        
rtoken strval(strFromFile);
                    }
                }
                if(
PlayerInfo[i][pAdminDuty] == 1)
                if(
PlayerInfo[playerid][pAdmin] >= 1337) {
                    if(
PlayerInfo[i][pAdmin] == 2) {
                        
format(stringsizeof(string), "*Junior Admin: %s (Reports Today: %d)(On-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 3) {
                        
format(stringsizeof(string), "*General Admin: %s (Reports Today: %d)(On-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 4) {
                        
format(stringsizeof(string), "*Senior Admin: %s (Reports Today: %d)(On-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 1337) {
                        
format(stringsizeof(string), "*Head Admin: %s (Reports Today: %d)(On-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 1338) {
                        
format(stringsizeof(string), "*Server Helper: %s (Reports Today: %d)(On-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 99998) {
                        
format(stringsizeof(string), "*Vice Community Founder: %s (Reports Today: %d)(On-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 99999) {
                        
format(stringsizeof(string), "*Community Founder: %s (Reports Today: %d)(On-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else {
                        
format(stringsizeof(string), "*Undefined Admin (%d): %s"PlayerInfo[i][pAdmin], GetPlayerNameEx(i));
                    }
                }
                else {
                    if(
PlayerInfo[i][pAdmin] == 2) {
                        
format(stringsizeof(string), "*Junior Admin: %s (On-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 3) {
                        
format(stringsizeof(string), "*General Admin: %s (On-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 4) {
                        
format(stringsizeof(string), "*Senior Admin: %s (On-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 1337) {
                        
format(stringsizeof(string), "*Head Admin: %s (On-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 1338) {
                        
format(stringsizeof(string), "*Server Helper: %s (On-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 99998) {
                        
format(stringsizeof(string), "*Vice Community Founder: %s (On-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 99999) {
                        
format(stringsizeof(string), "*Community Founder: %s (On-Duty)"GetPlayerNameEx(i));
                    }
                    else {
                        
format(stringsizeof(string), "*Undefined Admin (%d): %s (On-Duty)"PlayerInfo[i][pAdmin], GetPlayerNameEx(i));
                    }
                }
                if(
PlayerInfo[i][pAdminDuty] == 0)
                if(
PlayerInfo[playerid][pAdmin] >= 4) {
                    if(
PlayerInfo[i][pAdmin] == 2) {
                        
format(stringsizeof(string), "*Junior Admin: %s (Reports Today: %d)(Off-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 3) {
                        
format(stringsizeof(string), "*General Admin: %s (Reports Today: %d)(Off-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 4) {
                        
format(stringsizeof(string), "*Senior Admin: %s (Reports Today: %d)(Off-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 1337) {
                        
format(stringsizeof(string), "*Head Admin: %s (Reports Today: %d)(Off-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 1338) {
                        
format(stringsizeof(string), "*Server Helper: %s (Reports Today: %d)(Off-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 99998) {
                        
format(stringsizeof(string), "*Vice Community Founder: %s (Reports Today: %d)(Off-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else if(
PlayerInfo[i][pAdmin] == 99999) {
                        
format(stringsizeof(string), "*Community Founder: %s (Reports Today: %d)(Off-Duty)"GetPlayerNameEx(i), rtoken);
                    }
                    else {
                        
format(stringsizeof(string), "*Undefined Admin (%d): %s"PlayerInfo[i][pAdmin], GetPlayerNameEx(i));
                    }
                }
                else {
                    if(
PlayerInfo[i][pAdmin] == 2) {
                        
format(stringsizeof(string), "*Junior Admin: %s (Off-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 3) {
                        
format(stringsizeof(string), "*General Admin: %s (Off-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 4) {
                        
format(stringsizeof(string), "*Senior Admin: %s (Off-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 1337) {
                        
format(stringsizeof(string), "*Head Admin: %s (Off-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 1338) {
                        
format(stringsizeof(string), "*Server Helper: %s (Off-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 99998) {
                        
format(stringsizeof(string), "*Vice Community Founder: %s (Off-Duty)"GetPlayerNameEx(i));
                    }
                    else if(
PlayerInfo[i][pAdmin] == 99999) {
                        
format(stringsizeof(string), "*Community Founder: %s (Off-Duty)"GetPlayerNameEx(i));
                    }
                    else {
                        
format(stringsizeof(string), "*Undefined Admin (%d): %s"PlayerInfo[i][pAdmin], GetPlayerNameEx(i));
                    }
                }
                if(
PlayerInfo[i][pBanAppealer]) strcat(string" [BA]");
                if(
PlayerInfo[i][pShopTech]) strcat(string" [ST]");
                if(
PlayerInfo[i][pUndercover]) strcat(string" [UC]");
                if(
PlayerInfo[i][pFactionModerator]) strcat(string" [FMOD]");
                if(
PlayerInfo[i][pGangModerator]) strcat(string" [GMOD]");
                if(
PlayerInfo[i][pTogReports]) strcat(string" [SPEC MODE]");
                
SendClientMessageEx(playeridCOLOR_GRAD2string);
            }
        }
    }
    else {
        foreach(
Playeri) {
            if(
PlayerInfo[i][pAdmin] >= 2) {
                if(
PlayerInfo[i][pAdminDuty] == 1) {
                    
format(stringsizeof(string), "%s (Level: %d)(On-Duty)"GetPlayerNameEx(i), PlayerInfo[i][pAdmin]);
                    
SendClientMessageEx(playeridCOLOR_YELLOWstring);
                }
            }
        }
        
SendClientMessageEx(playeridCOLOR_GRAD1"If you have questions regarding gameplay, or the server use /newb.");
        
SendClientMessageEx(playeridCOLOR_GRAD1"If you see suspicious happenings/players /report [id] [reason].");
    }
    return 
1;

Thats if it is a GF edit.
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=377734
Already Posted There;
And Here's How Should It Be.
And Its ''Unique''

PHP Code:
if (strcmp(cmd"/admins"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
SendClientMessage(playeridCOLOR_GREEN"|____ PUT YOU'RE GAMING NAME HERE Online Administration Team ____|"); // Dont Forget To Change THe Name There!
            
for(new 0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
PlayerInfo[i][pAdmin] >= && PlayerInfo[i][pAdmin] <= 1339 || PlayerInfo[i][pTester] >= 1)
                    {
                        new 
admtext[64];
                        if(
PlayerInfo[i][pAppearList] == 1)
                        {
                             if(
PlayerInfo[i][pAdmin] == 1339) { admtext "Owner"; }
                             else if(
PlayerInfo[i][pAdmin] == 1338) { admtext "Co-Owner"; }
                            else if(
PlayerInfo[i][pAdmin] == 1337) { admtext "Elite Admin"; }
                            else if(
PlayerInfo[i][pAdmin] == 6)    { admtext "Server Developer"; }
                            else if(
PlayerInfo[i][pAdmin] == 5) { admtext "Main Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 4) { admtext "Senior Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 3) { admtext "Administrator"; }
                            else if(
PlayerInfo[i][pAdmin] == 2)    { admtext "Global Moderator"; }
                            else if(
PlayerInfo[i][pAdmin] == 1) { admtext "Moderator"; } // Also YOu Can Edit Here The Names.
                            
else if(PlayerInfo[i][pTester] == 3) { admtext "Lead Tester"; }
                            else if(
PlayerInfo[i][pTester] == 2) { admtext "Tester"; }
                            else if(
PlayerInfo[i][pTester] == 1) { admtext "Trial Tester"; }
                            else { 
admtext "Unknown Rank"; }
                        }
                        
GetPlayerName(isendernamesizeof(sendername));
                        if(
PlayerInfo[i][pAdminDuty] == && PlayerInfo[i][pAppearList] == 1)
                        {
                            
format(stringsizeof(string), "%s - %s"admtextsendername);
                            
SendClientMessage(playeridCOLOR_WHITEstring);
                        }
                        else if(
PlayerInfo[i][pAdminDuty] == && PlayerInfo[i][pAppearList] == 1)
                        {
                            
format(stringsizeof(string), "%s - %s (On Duty)"admtextsendername);
                            
SendClientMessage(playeridTEAM_VAGOS_COLORstring);
                        }
                    }
                }
            }
        }
        return 
1;
    } 
Reply
#4

Quote:
Originally Posted by MagicClucker
View Post
Thats if it is a GF edit.
It command to the server roleplay, and my function of admin
GetPVarInt > Level
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)