RCON Administrator Help
#1

I made this command >
PHP код:
CMD:admins(playeridparams[])
{
    
SendClientMessage(playeridgreen" ");
    
SendClientMessage(playeridgreen"___________ |- Online Admins -| ___________");
    
SendClientMessage(playeridgreen" ");
    new 
count 0;
    for(new 
0MAX_PLAYERSi++)
    {
        if(!
IsPlayerConnected(i)) continue;
        if(!
PlayerInfo[i][Level]) continue;
        new 
string[90], playersname[MAX_PLAYER_NAME];
        
GetPlayerName(iplayersnamesizeof(playersname));
        if(
IsPlayerAdmin(playerid))
        {
        
format(stringsizeof(string), "{FF0000}%s (ID:%i) - Level: %d | RCON Administrator | Playing!"playersnameiPlayerInfo[i][Level]);
        }
    else
    {
                            switch(
PlayerInfo[i][Level])
                            {
                                    case 
1format(stringsizeof(string), "{33AA33}%s (ID:%i) - Level: %d | Basic Moderator | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
2format(stringsizeof(string), "{33AA33}%s (ID:%i) - Level: %d | Moderator | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
3format(stringsizeof(string), "{FFFF00}%s (ID:%i) - Level: %d | Master Moderator | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
4format(stringsizeof(string), "{000000}%s (ID:%i) - Level: %d | Administrator | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
5format(stringsizeof(string), "{33CCFF}%s (ID:%i) - Level: %d | Master Administrator | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
6format(stringsizeof(string), "{C0C0C0}%s (ID:%i) - Level: %d | Elite Admin | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
7format(stringsizeof(string), "{FF0000}%s (ID:%i) - Level: %d | General | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
8format(stringsizeof(string), "{4169FF}%s (ID:%i) - Level: %d | Director | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
9format(stringsizeof(string), "{FF9900}%s (ID:%i) - Level: %d | Server Head | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
999format(stringsizeof(string), "{AA3333}%s (ID:%i) - Level: %d | Co-Owner | Playing!"playersnameiPlayerInfo[i][Level]);
                                    case 
99999format(stringsizeof(string), "{4169FF}%s (ID:%i) - Level: %d | Owner | Playing!"playersnameiPlayerInfo[i][Level]);
                                    default: continue;
        }
        
SendClientMessage(playeridredstring);
        
count++;
    }
    if(!
countSendClientMessage(playeridred"No admin online in the list");
    
SendClientMessage(playeridgreen"________________________________________");
    return 
1;

I found this error >
Код:
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2455) : error 017: undefined symbol "sscanf"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2485) : error 017: undefined symbol "MessageToAdmins"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2526) : error 017: undefined symbol "PlayerName2"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2528) : error 017: undefined symbol "SaveToFile"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2535) : error 017: undefined symbol "TimeStamp"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2538) : error 017: undefined symbol "TimeStamp"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2540) : error 017: undefined symbol "TimeStamp"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2543) : error 017: undefined symbol "PlayerName2"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2545) : error 017: undefined symbol "SaveToFile"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(2699) : error 017: undefined symbol "UpdateConfig"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3133) : error 017: undefined symbol "CountBusinesses"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3134) : error 017: undefined symbol "LoadBusinesses"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3140) : error 017: undefined symbol "CountVehicles"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3141) : error 017: undefined symbol "LoadVehicles"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3144) : error 017: undefined symbol "ModVehicle"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3172) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3173) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3174) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3175) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3176) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3177) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3178) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3179) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3180) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3181) : error 017: undefined symbol "AddHouse"
H:\GAME\SA-MP Server\HGTDM\Gamemodes\HGTDM~RP.pwn(3182) : error 017: undefined symbol "AddHouse"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
And if I delete the >
PHP код:
if(IsPlayerAdmin(playerid))
        {
        
format(stringsizeof(string), "{FF0000}%s (ID:%i) - Level: %d | RCON Administrator | Playing!"playersnameiPlayerInfo[i][Level]);
        }
    else
    { 
It's working very well
What should I do now to fix this error?
Please help me...
Thanks And God Bless You All
Reply
#2

If you indent your code you would see the problem...
Код:
CMD:admins(playerid, params[])
{
    SendClientMessage(playerid, green, " ");
    SendClientMessage(playerid, green, "___________ |- Online Admins -| ___________");
    SendClientMessage(playerid, green, " ");
    new count = 0;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(!PlayerInfo[i][Level]) continue;
        new string[90], playersname[MAX_PLAYER_NAME];
        GetPlayerName(i, playersname, sizeof(playersname));
        if(IsPlayerAdmin(playerid))
        {
            format(string, sizeof(string), "{FF0000}%s (ID:%i) - Level: %d | RCON Administrator | Playing!", playersname, i, PlayerInfo[i][Level]);
        }
        else
        {
            switch(PlayerInfo[i][Level])
            {
                case 1: format(string, sizeof(string), "{33AA33}%s (ID:%i) - Level: %d | Basic Moderator | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 2: format(string, sizeof(string), "{33AA33}%s (ID:%i) - Level: %d | Moderator | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 3: format(string, sizeof(string), "{FFFF00}%s (ID:%i) - Level: %d | Master Moderator | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 4: format(string, sizeof(string), "{000000}%s (ID:%i) - Level: %d | Administrator | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 5: format(string, sizeof(string), "{33CCFF}%s (ID:%i) - Level: %d | Master Administrator | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 6: format(string, sizeof(string), "{C0C0C0}%s (ID:%i) - Level: %d | Elite Admin | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 7: format(string, sizeof(string), "{FF0000}%s (ID:%i) - Level: %d | General | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 8: format(string, sizeof(string), "{4169FF}%s (ID:%i) - Level: %d | Director | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 9: format(string, sizeof(string), "{FF9900}%s (ID:%i) - Level: %d | Server Head | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 999: format(string, sizeof(string), "{AA3333}%s (ID:%i) - Level: %d | Co-Owner | Playing!", playersname, i, PlayerInfo[i][Level]);
                case 99999: format(string, sizeof(string), "{4169FF}%s (ID:%i) - Level: %d | Owner | Playing!", playersname, i, PlayerInfo[i][Level]);
                default: continue;
            }
            SendClientMessage(playerid, red, string);
            count++;
        }	
    if(!count) SendClientMessage(playerid, red, "No admin online in the list");
    SendClientMessage(playerid, green, "________________________________________");
    return 1;
}
Don't you think there's something missing?
Reply
#3

@EDIT
Reply
#4

No
I dont know about it
Reply
#5

i dont see any problem in code
Reply
#6

There's a missing bracket right before if (!count) in your code.
I only posted the indented version, which makes it more clear.
Reply
#7

Stinged, Your code working very well.
But I dont know where is my problem from
Thank You For Helping Me!
Reply
#8

sorry its not working
If I login as RCON Administrator and type /admins, It's says "No admin online in the list"
Reply
#9

That's because you're not increasing the count, and you're also not sending the formatted string when you check if the player is an rcon admin.
Reply
#10

Can you give me the right codes?
Please...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)