problem password Zgaming
#1

Hi guys

sometimes i get delete password for player acount ( users | Password = ... ) i don't know how but please help me

this system register and login

Pinfo
pawn Код:
enum pInfo
{
    // Temp Values
    pLoggedIn,
    pSpawn,
    // Permanent Values
    pIP[16],
    pOwner,
    pLevel,
    pMinutes,
    pHours,
    pGender,
    pAge,
    pMoney,
    pBank,
    pModel,
    pAdmin,
    pBanned,
    Float:pX,
    Float:pY,
    Float:pZ,
    pInt,
    pVW,
    pFac,
    pFacRank,
    pFacLeader,
    pWeapon[13],
    pWeaponAmmo[13],
    pHospital,
    pFacDuty,
    pFacDiv,
    pFacDivLeader,
    pBiz,
    pVBiz,
    pHouse,
    pVHouse,
    pJob,
    pJobSkill[MAX_JOBS],
    pTPackages,
    pMPackages,
    pDPackages,
    pMaterials,
    pWeed,
    pCrack,
    pHasCellphone,
    pCellphone,
    pPhonebook,
    pDice,
    pCigar,
    pSpeedo,
    pSprunk,
    pSpray,
    pRope,
    pBlindfold,
    pWT,
    pWTC,
    pGas,
    pRadio,
    Float:pHealth,
    Float:pArmor,
    pInternet,
    pSong[MAX_MUSIC],
    pPrison,
    pPrisonTime,
    pPrisonReason[64],
    pPrisonBy[32],
    pWanted,
    pWanted1[64],
    pWanted2[64],
    pWanted3[64],
    pWanted4[64],
    pWanted5[64],
    pWanted6[64],
    pCrimes,
    pArrested,
    pContract,
    pContractBy[32],
    pTutorial,
    pWarns,
    pWarn1[64],
    pWarn2[64],
    pWarn3[64],
    pFlag[65],
    pNMute,
    pSpawnFreeze,
    pFam,
    pFamRank,
    pCSuccess,
    pCFail,
    pHelper,
    pVeh,
    vModel,
    Float:vX,
    Float:vY,
    Float:vZ,
    Float:vA,
    vC1,
    vC2,
    vPJ,
    pVehMod[14],
    vLocked,
    pGangMod,
    pFacMod,
    pBanAppealer,
    pCarLic,
    pAccent[16],
    // VIP
    pVIP,
    pVIPDay,
    pVIPMonth,
    pVIPHour,
    pVIPTemp,
    // VIP Job
    pVIPJob,
    // VIP Car
    pVVeh,
    vVModel,
    Float:vVX,
    Float:vVY,
    Float:vVZ,
    Float:vVA,
    vVC1,
    vVC2,
    vVPJ,
    pVVehMod[14],
    vVLocked,
    pVIPBuddy,
    pDeliverTruck,
    pNew,
    pRefPoints,
    pTester,
    pFightStyle,
    pScope,
    pCookies,
    pOldskool,
    // Toys
    pToyModel[10],
    Float:pToyX[10],
    Float:pToyY[10],
    Float:pToyZ[10],
    Float:pToyRX[10],
    Float:pToyRY[10],
    Float:pToyRZ[10],
    Float:pToySX[10],
    Float:pToySY[10],
    Float:pToySZ[10],
    pReward,
    pFish[5],
    pLoyal,
    pLoyalTag,
    pLPoints,
    pStoned,
    pGate[3],
    pSafeAdmin
}
new PlayerInfo[MAX_PLAYERS][pInfo];
register :

pawn Код:
[   else if(dialogid == 1) // Register
    {
        if(response)
        {
            if(strlen(inputtext) > 256)
            {
                SendClientMessage(playerid, COLOR_GREY, "Password can't be longer than 256 characters.");
                ShowDialog(playerid, 1);
                return 1;
            }
            new file[64], IP[16], string[128], password[256];
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            if(!dini_Exists(file))
            {
                GetPlayerIp(playerid, IP, sizeof(IP));
                dini_Create(file);
                WP_Hash(password, sizeof(password), inputtext);
                dini_Set(file, "Password", password);
                dini_Set(file, "IP", IP);
                PlayerInfo[playerid][pLevel] = 1;
                dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
                format(string, sizeof(string), "SERVER: {FFFFFF}You have successfully registered on {FF6347}Nest-Life Roleplay{FFFFFF}. (Password: %s)", inputtext);
                SendClientMessage(playerid, COLOR_LIGHTRED, string);
                ShowDialog(playerid, 2);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You have chosen to quit the server.");
            Kick(playerid);
        }
    }
Login
pawn Код:
else if(dialogid == 2) // Login
    {
        if(response)
        {
            new file[64], password[256], IP[16], password2[256];
            format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
            WP_Hash(password2, sizeof(password2), inputtext);
            format(password, sizeof(password), "%s", dini_Get(file, "Password"));
            if(strcmp(password, inputtext,true) && strcmp(password, password2, true))
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}Invalid password.");
                ShowDialog(playerid, 2);
                return 1;
            }
            if(dini_Int(file, "AdminAccount") == 1)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You can't login directly from an admin account.");
                Kick(playerid);
                return 1;
            }
            else if(sscanf(inputtext, "s[128]", inputtext))
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You must enter a password to procceed.");
                ShowDialog(playerid, 2);
                return 1;
            }
            else
            {
                format(PlayerInfo[playerid][pIP], 16, "%s", dini_Get(file, "IP"));
                GetPlayerIp(playerid, IP, sizeof(IP));
                dini_Set(file, "IP", IP);
                PlayerInfo[playerid][pGender] = dini_Int(file, "Gender");
                PlayerInfo[playerid][pAge] = dini_Int(file, "Age");
                if(!PlayerInfo[playerid][pGender] || !PlayerInfo[playerid][pAge])
                {
                    ShowDialog(playerid, 3);
                }
                else
                {
                    LoadChar(playerid);
                    SpawnPlayer(playerid);
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: {FFFFFF}You have chosen to quit the server.");
            Kick(playerid);
        }
    }





and i'm sorry for my english
Reply


Messages In This Thread
problem password Zgaming - by morocco - 31.05.2013, 22:43
Re: problem password Zgaming - by Stanford - 01.06.2013, 05:47
Re : Re: problem password Zgaming - by morocco - 01.06.2013, 10:26

Forum Jump:


Users browsing this thread: 1 Guest(s)