Admin Level keep re writing on scriptfiles when relloging
#7

Quote:
Originally Posted by Rafael_Zambrano
Посмотреть сообщение
try this with that cmd
pawn Код:
CMD:setlevel(playerid, params[])
{
    new id, level, string[128], string2[128], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];

    if(pInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, -1, "Nono:You don't have the required level to execute this command");
    if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "Nana: use /setlevel [ID] [level]");
    if(level > 6) return SendClientMessage(playerid, -1, "No: Level cant be above 6");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "No: That ID isn't connected");
    else
    {
        GetPlayerName(playerid, name, sizeof(name));
        GetPlayerName(id, name2, sizeof(name2));

        pInfo[id][Adminlevel] = level;

        format(string, sizeof(string), "Admin %s has promoted you to admin level %d", name, level);
        format(string2, sizeof(string2), "You have promoted %s to admin level %d", name2, level);

        SendClientMessage(id, -1, string);
        SendClientMessage(playerid, -1, string2);
    }
    return true;
}

i guess that the problem is in register dialog
show me the regiter dialog pls
This is the register dialog:
pawn Код:
if(dialogid == DIALOG_REGISTER)
    {
        if(response)
        {
            if(!strlen(inputtext))return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Please Register your account here!","Type your password to make one your account!","Register","Leave");
            new INI:File = INI_Open(UserPath(playerid));
            INI_SetTag(File,"Data");
            INI_WriteInt(File,"Cash",0);
            INI_WriteInt(File,"Scores",0);
            INI_WriteInt(File,"Password",udb_hash(inputtext));
            INI_WriteInt(File,"Kills",0);
            INI_WriteInt(File,"Deaths",0);
            INI_WriteInt(File,"Admin Level",0);
            INI_WriteInt(File,"VIP Level",0);
            INI_Close(File);
            SendClientMessage(playerid,COLOR_GREEN,"[INFO]:You Have succesfully registered!");
            Logged[playerid] = 1;
        }
        if(!response)return Kick(playerid);
    }
Quote:
Originally Posted by iZN
Посмотреть сообщение
Show your saving thing, you are saving it on OnPlayerDisconnect I'm sure. Show the script related to saving functions not all!
This is the related functions in saving stuff:
pawn Код:
public OnPlayerDisconnect(playerid,reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"Data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin Level",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Scores",GetPlayerScore(playerid));
    INI_WriteInt(File,"VIP Level",PlayerInfo[playerid][pVip]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKill]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeath]);
    INI_Close(File);
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)