SA-MP Forums Archive
IS player admin !! - 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: IS player admin !! (/showthread.php?tid=596539)



IS player admin !! - aysam7 - 19.12.2015

Hello guys !!

I have a script about admin base , but in the script when I want to change

IsPlayerAdmin(playerid))

To
if(PlayerInfo[playerid][Level] >= 3) {

I got some error

How can I fix it

__________________________________________________ ______________________________________________

*Sorry for bad english.
*don't insult me please because im newbie.


Re: IS player admin !! - TwinkiDaBoss - 19.12.2015

Quote:
Originally Posted by aysam7
Посмотреть сообщение
Hello guys !!

I have a script about admin base , but in the script when I want to change

IsPlayerAdmin(playerid))

To
if(PlayerInfo[playerid][Level] >= 3) {

I got some error

How can I fix it

__________________________________________________ ______________________________________________

*Sorry for bad english.
*don't insult me please because im newbie.
Show us the error and the full code.


Re: IS player admin !! - GeneralAref - 19.12.2015

do you have this code?
Код:
#define PATH "/Users/%s.ini"
enum pInfo
{
    pPass,
    pMoney,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];



Re: IS player admin !! - J0sh... - 19.12.2015

Quote:
Originally Posted by GeneralAref
Посмотреть сообщение
do you have this code?
Код:
#define PATH "/Users/%s.ini"
enum pInfo
{
    pPass,
    pMoney,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Yeah, copy and pasting won't help, he wants Level not pAdmin...


Re: IS player admin !! - aysam7 - 19.12.2015

not understand
sorry


Re: IS player admin !! - GeneralAref - 19.12.2015

easy exp of this in command
Код:
CMD:setlevel(playerid, params[])
{
    new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
    if(PlayerInfo[playerid][pAdmin] >=7 || IsPlayerAdmin(playerid))
    {
        if (sscanf(params, "ui", id, admlvl)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setlevel [id] [adminlevel]");
        if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "[ERROR]:Invalid ID");
        if (admlvl > 10 || admlvl < 0) return SendClientMessage(playerid, COLOR_RED,"[ERROR]: Valid Admin Levels: 1-10!");
        PlayerInfo[id][pAdmin] = admlvl;
        GetPlayerName(id, victimname, sizeof(victimname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        new str[128];
        format(str,128,"Admin %s [ID %d] has set %s [ID %d] admin level to %i",adminname, playerid, victimname, id, admlvl);
        SendClientMessage(playerid,COLOR_BLUE,str);
        return 1;
    }
    else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");
}