Skin doesn't load - 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: Skin doesn't load (
/showthread.php?tid=305317)
Skin doesn't load -
Abreezy - 22.12.2011
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.
Re: Skin doesn't load -
Tee - 22.12.2011
Your code doesn't show anything about the skin, it only shows IP saving.
Re: Skin doesn't load -
Abreezy - 22.12.2011
The saving part works fully as I stated, loading is the issue, and the loading is shown.
Re: Skin doesn't load -
Tee - 22.12.2011
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.
Re: Skin doesn't load -
Abreezy - 22.12.2011
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
Re: Skin doesn't load -
Tee - 22.12.2011
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).
Re: Skin doesn't load -
Abreezy - 22.12.2011
Do you use strickenkids mysql plugin?
Re: Skin doesn't load -
Tee - 22.12.2011
Blue-G's (G-Stylezzz)
Link
Re: Skin doesn't load -
Abreezy - 22.12.2011
Alright, let's see if anyone else could possibly reply with help.