Help in this command.
#1

pawn Код:
CMD:oadmin(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] > 100001) return SendClientMessage(playerid, COLOR_GRAD, "You are not authorized to use this command!");
    for(new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        format(string, sizeof(string), "users/%s.ini", i);
        new alevel = dini_Get(string, "AdminLvl")
        if(alevel > 0)
        {
            format(string, sizeof(string), "%s -level %s lastlogin [%s]",i, alevel, dini_Get(string, "LastLogin"));
            SendClientMessage(playerid, COLOR_WHITE, string);
            break;
        }
    }
}
I made a command to list all offline admin. Is this correct?
Reply
#2

Quote:
Originally Posted by krytans
Посмотреть сообщение
pawn Код:
for(new i = 0; i < MAX_PLAYER_NAME; i++)
This will add 1 to i every time it's not equal to 24.
So you're just opening a file called 0, 1, 2, 3, 4, 5 etc...
Reply
#3

Is there anyway to make command?
Reply
#4

yes there is but i also don't know how to do it i have the idea but its difficult you need to run an loop from all the players stored and then find the value that you want or easier way is if you know the name just load that file using params for this will be good
Reply
#5

Then how to record who are all admins in separate place?
Reply
#6

There are 2 ways:
1) You add them in pawn
2) You add something using file functions in your set admin command that gets the player's name and stores it into 'admins file'.
Reply
#7

What do i add in pawn?
Reply
#8

The admin names.
For example "users/Myadmin1.ini" "users/Myadmin2.ini"
Reply
#9

Alright, Thanks.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)