[HELP]Can't make myself admin!
#1

Hello guys. I have login/register using this tutorial link and he had AdminLevel. But, when i tried /kick, /ban command its says that i'm not admin. I change AdminLevel from 0 to 5 but still not recognizing me as admin. But when i type /rcon login pw it's working. I want (i'd like to) that those command are available to smaller level admins not just to RCONs! Thank you in advance.
Sincerely,
anito
Reply
#2

Instead of use this.
pawn Код:
IsPlayerAdmin(playerid)
You should use this:
pawn Код:
if(Adminlevel <= 5 && !IsPlayerAdmin(playerid) return 0;// For levels below 5 and different of Rcon will return 0.
Reply
#3

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
Instead of use this.
pawn Код:
IsPlayerAdmin(playerid)
You should use this:
pawn Код:
if(Adminlevel <= 5 && !IsPlayerAdmin(playerid) return 0;// For levels below 5 and different of Rcon will return 0.
I knew it was something with it! Last 5 minutes i tried /makeadmin and it's working, i can kick and ban, but when i reconnect, i'm still non admin! I think I need to add Write_INI and it will add AdminLevel, but again it will not load adminlevel as I said before.
Reply
#4

Let me see your OnPlayerDisconnect..
Reply
#5

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
Let me see your OnPlayerDisconnect..
Sir, here it is!
Код:
{
    
    if(fexist(Path(playerid)))
    {
        new INI:file = INI_Open(Path(playerid));
        INI_SetTag(file,"Player's Data");
        INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]);
        INI_WriteInt(file,"VIPLevel",pInfo[playerid][VIPlevel]);
        INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
        INI_WriteInt(file,"Scores",GetPlayerScore(playerid));
        INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
        INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
        INI_Close(file);
        return 1;
    }
    return 1;
}
Reply
#6

Nothing is wrong there. Maybe a problem with your /makeadmin command. Try this
pawn Код:
CMD:makeadmin(playerid,params[])
{
    if(IsPlayerAdmin(playerid) || pInfo[playerid][AdminLevel] >= 4)
    {
        new tid, tname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], str[128], level;
        if(sscanf(params,"ui",tid,level)) return SendClientMessage(playerid,-1,"[USAGE] /makeadmin [ID] [level 1 - 5]");
        if(tid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"Player is not online!");
        if(level > 5) return SendClientMessage(playerid,-1,"Only level 1 - 5 only");
        GetPlayerName(playerid,name,sizeof(name));
        GetPlayerName(tid,tname,sizeof(tname));
        format(str,sizeof(str),"`` Admin %s has made %s(%d) as an admin level %i",name,tname,tid,level);
        pInfo[tid][Admin] = level;
        SendClientMessageToAll(-1,str);
        return 1;
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
Nothing is wrong there. Maybe a problem with your /makeadmin command. Try this
pawn Код:
CMD:makeadmin(playerid,params[])
{
    if(IsPlayerAdmin(playerid) || pInfo[playerid][AdminLevel] >= 4)
    {
        new tid, tname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], str[128], level;
        if(sscanf(params,"ui",tid,level)) return SendClientMessage(playerid,-1,"[USAGE] /makeadmin [ID] [level 1 - 5]");
        if(tid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"Player is not online!");
        if(level > 5) return SendClientMessage(playerid,COLOR_RED,"Only level 1 - 5 only");
        GetPlayerName(playerid,name,sizeof(name));
        GetPlayerName(tid,tname,sizeof(tname));
        format(str,sizeof(str),"`` Admin %s has made %s(%d) as an admin level %i",name,tname,tid,level);
        pInfo[tid][Admin] = level;
        SendClientMessageToAll(-1,str);
        return 1;
    }
    return 1;
}
Ok, i'll try it sir. I made my /makeadmin using this tutorial on SA-MP Wiki link
Reply
#8

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
Nothing is wrong there. Maybe a problem with your /makeadmin command. Try this
pawn Код:
CMD:makeadmin(playerid,params[])
{
    if(IsPlayerAdmin(playerid) || pInfo[playerid][AdminLevel] >= 4)
    {
        new tid, tname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], str[128], level;
        if(sscanf(params,"ui",tid,level)) return SendClientMessage(playerid,-1,"[USAGE] /makeadmin [ID] [level 1 - 5]");
        if(tid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"Player is not online!");
        if(level > 5) return SendClientMessage(playerid,-1,"Only level 1 - 5 only");
        GetPlayerName(playerid,name,sizeof(name));
        GetPlayerName(tid,tname,sizeof(tname));
        format(str,sizeof(str),"`` Admin %s has made %s(%d) as an admin level %i",name,tname,tid,level);
        pInfo[tid][Admin] = level;
        SendClientMessageToAll(-1,str);
        return 1;
    }
    return 1;
}
OK, i tried it. It changes players admin level but still "You are not admin!". Maybe it's something wrong with admin commands. Can you please find some admin commands that will working with my code. +REP
Reply
#9

Quote:
Originally Posted by anito
Посмотреть сообщение
Ok, i'll try it sir. I made my /makeadmin using this tutorial on SA-MP Wiki link
Under OnPlayerConnect, remove PlayerInfo[playerid][AdminLevel] = 0;
Reply
#10

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
Under OnPlayerConnect, remove PlayerInfo[playerid][AdminLevel] = 0;
There is no PlayerInfo[playerid][AdminLevel] = 0; in my script!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)