SA-MP Forums Archive
Help with dini - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with dini (/showthread.php?tid=536783)



Help with dini - krytans - 12.09.2014

I want to list the admin accounts? Could anyone tell me how to do it?


Re: Help with dini - ]Rafaellos[ - 12.09.2014

You can only do that by saving in a file all Admin Names and then loop through the file. The best eay is by using MySQL/SQLite. Dini is too old and inefficient.


Re: Help with dini - krytans - 12.09.2014

I made this command. Is this right?
pawn Код:
CMD:oadmin(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin]< 100001) return SendClientMessage(playerid, COLOR_GREY, " You are not authorized to use this command!");
    foreach(Player, i)
    {
        for(new i = 0; i < MAX_PLAYER_NAME; i++)
        {
            format(string, sizeof(string), "users/%s.ini", i);
            new alevel = dini_Int(string, "AdminLvl");
            new las = dini_Int(string, "LastLogin");
            if(alevel > 0)
            {
                format(string, sizeof(string), " Name- %s Level- %s LastLogin- %s", i, alevel, las);
                SendClientMessage(playerid, COLOR_WHITE, string);
                return 1;
            }
        }
    }
    return 1;
}



Re: Help with dini - Stinged - 12.09.2014

That will not work. Are your admins called "1" "2" "3" to "23"?