SA-MP Forums Archive
Need Help on sscanf2 to onplayerlogin - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need Help on sscanf2 to onplayerlogin (/showthread.php?tid=470148)



Need Help on sscanf2 to onplayerlogin - RaZvY - 16.10.2013

playerinfo

pawn Код:
enum pInfo
{
    pSQLID,
    pKey[128],
    pLevel,
    pAdmin,
    pDonateRank,
    gPupgrade,
    pConnectTime,
    pReg,
    pSex,
    pAge,
    pOrigin,
    pCK,
    pMuted,
    pExp,
    pCash,
    pAccount,
    pCrimes,
    pKills,
    pDeaths,
    pArrested,
    pWantedDeaths,
    pPhoneBook,
    pLottoNr,
    pFishes,
    pBiggestFish,
    pJob,
    pPayCheck,
    pHeadValue,
    pJailed,
    pJailTime,
    pMats,
    pDrugs,
    pLeader,
    pMember,
    pRank,
    pCharacter,
    pContractTime,
    pDetSkill,
    pSexSkill,
    pBoxSkill,
    pLawSkill,
    pMechSkill,
    pJackSkill,
    pCarSkill,
    pNewsSkill,
    pDrugsSkill,
    pCookSkill,
    pFishSkill,
    Float:pHealth,
    Float:pSHealth,
    pInt,
    pLocal,
    pTeam,
    pModel,
    pPnumber,
    pPhousekey,
    pPbiskey,
    Float:pPos_x,
    Float:pPos_y,
    Float:pPos_z,
    pCarLic,
    pFlyLic,
    pBoatLic,
    pFishLic,
    pGunLic,
    pGun1,
    pGun2,
    pGun3,
    pGun4,
    pAmmo1,
    pAmmo2,
    pAmmo3,
    pAmmo4,
    pCarTime,
    pPayDay,
    pPayDayHad,
    pCDPlayer,
    pWins,
    pLoses,
    pAlcoholPerk,
    pDrugPerk,
    pMiserPerk,
    pPainPerk,
    pTraderPerk,
    pTut,
    pMissionNr,
    pWarns,
    pAdjustable,
    pFuel,
    pMarried,
    pMarriedTo[128],
    pLocked,
    pCardPassword,
    pDate[2],
    pBirthday,
    pDateRegistered[12],
};
new PlayerInfo[MAX_PLAYERS][pInfo];

pawn Код:
if(mysql_fetch_row_format(Query,"|")) // Splits the row
        {
            sscanf(Query, "p<|>e<is[128]iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffiiiiiiifffiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii>",PlayerInfo[playerid]);
        }
        MySQLUltLog(PlayerInfo[playerid][pSQLID], "MarriedTo", PlayerInfo[playerid][pMarriedTo]);
        mysql_store_result();
my problem: is not work i get random valou i have admin level 6 after relog i have admin level 50 or is have password 123 after login the password is my name
pls help me


Re: Need Help on sscanf2 to onplayerlogin - Misiur - 16.10.2013

Show my your sql query. I assume you are doing something like SELECT *, so it includes all fields. I can also assume that before your password field there is name field - which causes makes your password to be your nick, and screws up all futher fields by one.