IS player admin !!
#1

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.
Reply
#2

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.
Reply
#3

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

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...
Reply
#5

not understand
sorry
Reply
#6

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!");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)