SA-MP Forums Archive
MySQL Bug(Skin) - 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 Bug(Skin) (/showthread.php?tid=304711)



MySQL Bug(Skin) - No Fear - 19.12.2011

Hi, i have a bug with MySQL, whenever i try to create loading code for skin it just gives me CJ(0) it saves fine, but load bad :/

pawn Код:
stock LoadPlayerInfo( iPlayer )
{

new
Query[ 1024 ]
;

if( mysql_fetch_row( Query ) )
{
GLoad_From_Table( Query, "e

<|>s[24]s[35]dddddfffdddddd>"
, PVar[ iPlayer ] );
<|>
GivePlayerMoney ( iPlayer, PVar[ iPlayer ][ pMoney ] );
SetPlayerInterior ( iPlayer, PVar[ iPlayer ][ pInt ] );
SetPlayerSkin ( iPlayer, PVar[ iPlayer ][ pSkin ] );
mysql_free_result ( );
}
return true;
}
That last "d" is the skin


Re: MySQL Bug(Skin) - Hoborific - 19.12.2011

Are they spawned BEFORE this function is called?


Re: MySQL Bug(Skin) - No Fear - 19.12.2011

no it's called when they login


Re: MySQL Bug(Skin) - Hoborific - 19.12.2011

Well to my knowledge they have to be spawned to retain the skin value. I store mine to an enum variable

pawn Код:
Stats[playerid][Skin]
and use it

pawn Код:
OnPlayerRequestSpawn()
SetSpawnInfo(Stats[playerid][Skin]



Re: MySQL Bug(Skin) - No Fear - 19.12.2011

Tryed, not working, i tryed without setplayerskin, it's every time it loads it's zero


Re: MySQL Bug(Skin) - Hoborific - 19.12.2011

well are you forcing SpawnPlayer(); without actually setting any info, tried OnPlayerSpawn aswell?

OH so the variable doesn't load at all, my bad I misunderstood the problem.

Well take the integer from the table, store it somewhere else, then print it, does it come up zero then?


Re: MySQL Bug(Skin) - No Fear - 19.12.2011

yap zero it saves fine, but not loads


Re: MySQL Bug(Skin) - Hoborific - 19.12.2011

no MYSQL errors? weird.


Re: MySQL Bug(Skin) - No Fear - 19.12.2011

Nop : / Maybe query is too small?


Re: MySQL Bug(Skin) - Hoborific - 19.12.2011

Could try 2056 but I doubt it.