22.12.2011, 01:41
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:
That loads it all, and this is the enums, incase you want to base it off:
And the spawn code, with setting of the Skin:
Thanks in advance for anyone who helps out.
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);
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.