Helper doesn't save[+rep]
#2

Are you sure you defined pHelper everywhere?

Also try to do it like this

PlayerInfo[para1][pHelper] = level;

because i have exactly the same command in my gamemode, but to set admins

pawn Код:
if(strcmp(cmd, "/makeadmin", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: /makeadmin [id/name] [level(1-3)]");
                return 1;
            }
            new para1;
            new level;
            para1 = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 5)
            {
                if(IsPlayerConnected(para1))
                {
                    if(para1 != INVALID_PLAYER_ID)
                    {
                        GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        PlayerInfo[para1][pAdmin] = level;
                        printf("INFO: %s hat %s zum Admin gemacht [Level %d].", sendername, giveplayer, level);
                        format(string, sizeof(string), "   Stavljeni ste za level %d admina od %s", level, sendername);
                        SendClientMessage(para1, COLOR_PLAVA, string);
                        format(string, sizeof(string), "   Stavili ste %s za Level %d admina.", giveplayer,level);
                        SendClientMessage(playerid, COLOR_PLAVA, string);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_CRVENA, "[ERROR] Du bist kein Admin oder dein AdminLevel ist zu niedrig [5]");
            }
        }
        return 1;
    }
Under OnPlayerRegister i have
pawn Код:
format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
OnPlayerUpdate
pawn Код:
format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
OnPlayerLogin
pawn Код:
if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
Reply


Messages In This Thread
Helper doesn't save[+rep] - by Chris_Morrison - 14.03.2012, 10:19
Re: Helper doesn't save[+rep] - by Dripac - 14.03.2012, 10:26
Re: Helper doesn't save[+rep] - by ReneG - 14.03.2012, 10:26
Re: Helper doesn't save[+rep] - by Issam - 14.03.2012, 10:34
Re: Helper doesn't save[+rep] - by Daddy Yankee - 14.03.2012, 10:35
Re: Helper doesn't save[+rep] - by Dripac - 14.03.2012, 10:40
Re: Helper doesn't save[+rep] - by Chris_Morrison - 14.03.2012, 10:56

Forum Jump:


Users browsing this thread: 1 Guest(s)