Skin doesn't load
#1

Howdy, I made a nice saving/loading system a while ago, and apparently my saving works better then loading. The systems are made in mysql.

The skin saves into my database, but the skin doesn't load. It always sets skin to Cjs skin. Heres my loading code:

pawn Код:
if(mysql_fetch_row(szQuery)) { sscanf(str, "e<p<|>s[24]s[64]s[16]fffdddddd>", User[playerid]); }
                format(szQuery, sizeof(szQuery), "UPDATE "SQL_ACCOUNT_TABLE" SET IP = '%s' WHERE Username = '%s'", pIP(playerid), pName(playerid));
                mysql_query(szQuery);
That loads it all, and this is the enums, incase you want to base it off:

pawn Код:
enum pInfo
{
    Username[24],
    Password[64],
    IP[16],
    Float:pX,
    Float:pY,
    Float:pZ,
    Interior,
    VWorld,
    Level,
    Money,
    Skin,
    Gender,
   
   
}

And the spawn code, with setting of the Skin:

pawn Код:
SetSpawnInfo(playerid, 0, User[playerid][Skin], User[playerid][pX], User[playerid][pY], User[playerid][pZ], 0.0, 0, 0, 0, 0, 0, 0);
    SpawnPlayer(playerid);

    SetPlayerInterior(playerid, User[playerid][Interior]);
    SetPlayerVirtualWorld(playerid, User[playerid][VWorld]);
    GivePlayerMoney(playerid, User[playerid][Money]);

Thanks in advance for anyone who helps out.
Reply
#2

Your code doesn't show anything about the skin, it only shows IP saving.
Reply
#3

The saving part works fully as I stated, loading is the issue, and the loading is shown.
Reply
#4

I'm not familiar with this method of loading, sorry, can't help you there.
But this is how I do it:

pawn Код:
format(String,75,"SELECT * FROM accounts WHERE Name = '%s' LIMIT 1",escapename); //Nevermind the indentation, the tags did it.
    mysql_query(String);
    mysql_store_result();
    mysql_fetch_row_format(row, "|");
    explode(row,field, "|");
    mysql_free_result();
    PlayerData[playerid][Level] = strval(field[2]);//This would be field 3 in the table
    PlayerData[playerid][AdminLevel] = strval(field[3]);//field 4 in the table
    PlayerData[playerid][Cash] = strval(field[4]);//Field 5.
That's just an example of how I do it, if it helps.
Reply
#5

Well the method I use is sscanf2, from what i heard its suppose to be good which is why I use it. If no one else could support, i guess ill try your method
Reply
#6

Hope you get help. The method I use (won't call it mine) works fine. That's how I load everything in my server, and I do load alot of stuff (dynamic stuff).
Reply
#7

Do you use strickenkids mysql plugin?
Reply
#8

Blue-G's (G-Stylezzz) Link
Reply
#9

Alright, let's see if anyone else could possibly reply with help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)