SA-MP Forums Archive
mysql can't fetch data or ? - 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: mysql can't fetch data or ? (/showthread.php?tid=616275)



mysql can't fetch data or ? - venomlivno8 - 03.09.2016

pawn Код:
forward USYS_LoadPlayer(playerid);
public USYS_LoadPlayer(playerid) {
    new temp[24+1], passw[64+1];
    cache_get_row(0, 1, temp); PlayerInfo[playerid][pName] = temp;
    cache_get_row(0, 2, temp); GivePlayerMoney(playerid, strval(temp));
    cache_get_row(0, 3, passw); PlayerInfo[playerid][pPass] = passw;
    cache_get_row(0, 4, passw); PlayerInfo[playerid][pPassSalt] = passw;
    cache_get_row(0, 5, temp); PlayerInfo[playerid][pAge] = strval(temp);
    cache_get_row(0, 6, temp); PlayerInfo[playerid][pGender] = strval(temp);
    cache_get_row(0, 7, temp); PlayerInfo[playerid][pSkin] = strval(temp);

    SetPlayerCameraPos(playerid, 783.5763, -316.3381, 114.9783);
    SetPlayerCameraLookAt(playerid, 783.2093, -317.2744, 114.5583);
   
    printf("Player [%s] loaded and sent to login screen!", GetName(playerid));

    format(gstring, sizeof(gstring), DialogText[4], GetName(playerid));
    ShowPlayerDialog(playerid, USYS_LOGIN, DIALOG_STYLE_PASSWORD, " Reloaded Roleplay - Login ", gstring, "Login", "Cancel");
    return 1;
}
it loads everything except pPass and pPassSalt, pPass and pPassSalt are 64+1 variables.

What's the problem?


Respuesta: mysql can't fetch data or ? - HidroDF - 03.09.2016

Check if in the enum, pPass and pPassSalt is pPass[64+1] and pPassSalt[64+1].
If yes, post the compilation error.


Re: mysql can't fetch data or ? - venomlivno8 - 03.09.2016

There is no compilation error, and yes, in pInfo enum pPass and pPassSalt are [64+1], i'm not a newb.

I found out about this bug when strcmp returned 0 even if strings were not the same, I did a little bit of debugging using printf and it simply doesn't want to write pPass into pw var.


edit: when I printf the passw variable it gives me the value from the database, but when I printf PlayerInfo[playerid][pPass] or [pPassSalt] it gives me blank?