Why my Admin Level is "0" lol?
#1

I want my Level 3 but It showing my level "0"



Here is my /admins Command:

pawn Code:
CMD:admins( playerid, params[ ] )
{
    new
        count
    ;
    SendClientMessage( playerid, COLOR_YELLOW, "[ ! ] List of Online Administrators:" );
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if( !IsPlayerConnected( i ) ) continue;
        if( pInfo[i][pAdminlevel] > 1 )
        {
            new
                temp[ 32 ],
                name_[ MAX_PLAYER_NAME ]
            ;
            GetPlayerName( i, name_, MAX_PLAYER_NAME );
            format( temp, sizeof( temp ), "<%d> %s Level %d", i, name_, pInfo[i][pAdminLevel]);
            SendClientMessage( playerid, 0xFF0000FF, temp );
            count++;
        }
    }
    if(count == 0)
    {
        SendClientMessage( playerid, COLOR_RED1, "- No Admins Currently Online." );
        SendClientMessage( playerid, COLOR_YELLOW, "[ ! ] End of List !" );
    }
    else SendClientMessage( playerid, COLOR_YELLOW, "[ ! ] End of List !" );
    return 1;
}
Help Please
Reply
#2

Because your level in pInfo[i][pAdminLevel] is 0. Load your stats when you login and if your level was saved as 3 and it was loaded correctly (assigning the level to the variable too) then it will work.
Reply
#3

You have your scriptfiles/ *blah, blah, blah* /Users.*duh*, right ?

Open it, then,

change your AdminLevel into Maximum Admin Level.


[EDIT :- and as Konstantinos said ]
Reply
#4

Already did to AdminLevel: 3 but still the same Problem.
Reply
#5

Show us the loading system for your GM, when a player connects, how all the variables get saved.
Reply
#6

pawn Code:
CMD:admins(playerid)
{
    SendClientMessage(playerid, color, "List of online admins.");
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(pInfo[i][pAdminlevel] => 1)
        {
            {
                new temp[99];
                format(temp, sizeof(temp),"ID : %s | Admin Level : %s",i, pInfo[i][pAdminLevel]);
                SendClientMessage(playerid, color, temp);
            }
        }
    }
return 1;
}
About getting the player name I suggest you to make a stock intead using GetPlayerName in every command.

And once again make sure if the variable in yourscript file is not 0.
Reply
#7

Quote:
Originally Posted by JamesH
View Post
pawn Code:
CMD:admins(playerid)
{
    SendClientMessage(playerid, color, "List of online admins.");
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if((pInfo[i][pAdminlevel] => 1)
        {
            {
                new temp[99];
                format(temp, sizeof(temp),"ID : %s | Admin Level : %s",i, pInfo[i][pAdminLevel]);
                SendClientMessage(playerid, color, temp);
            }
        }
    }
return 1;
}
About getting the player name I suggest you to make a stock intead using GetPlayerName in every command.

And once again make sure if the variable in yourscript file is not 0.
Since when was a playerid & pAdmin a string? It's an integer.
Reply
#8

I dont understand you though I can bet its working. But I did make a mistake there
pawn Code:
if((pInfo[i][pAdminlevel] => 1)
should be only one (. edited
Reply
#9

Quote:
Originally Posted by Konstantinos
View Post
Because your level in pInfo[i][pAdminLevel] is 0. Load your stats when you login and if your level was saved as 3 and it was loaded correctly (assigning the level to the variable too) then it will work.
Did, Now It is showing that "No Admins Online"

Quote:
Originally Posted by DanishHaq
View Post
Show us the loading system for your GM, when a player connects, how all the variables get saved.
Here It is.



And that is my User File.


Code:
[Player's Data]
Password = 9D9F7789E168B9FF1016A0D693178361A4AEA1CB90147CA3A854D535D9191B7DA82DF6DB2BA8E1165F3CED5737B69BEA819CBD25DBAAFFC6731F72FCD853B87D
VIPLevel = 0
Money = 0
Scores = 0
Kills = 24
Deaths = 38
AdminLevel = 3
Reply
#10

Your AdminLevel in the file might be 3, but if you do not load it from the file and assign it to:
pawn Code:
pInfo[playerid][pAdminLevel]
It's not gonna work.

By the way, I just noticed that if the player's admin is > 1, it will send the message but it sends 0 then. It seems weird to me.

@JamesH: What DanishHaq was trying to say is that when you format, the placeholder is %d or %i for integers. %s is used for strings. Also about the stock about getting the player's name. Why to re-call the function everytime to get the player's name when you can just get it ONCE they connect and then use it as long as they're online?

pawn Code:
// Global
new
    User_Name[ MAX_PLAYERS ]
;

// OnPlayerConnect:
GetPlayerName( playerid, User_Name[ playerid ], MAX_PLAYER_NAME );

// Anywhere you want to get the name:
User_Name[ playerid ]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)