loading/saving skin from mysql - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: loading/saving skin from mysql (
/showthread.php?tid=152757)
loading/saving skin from mysql -
swredder - 05.06.2010
ok today i made a small code to save/load skins in mysql evrything works perfect but i want it so if there is a 0 in mysql it doesnt change the skin of the player.
here is my code:
Код:
new Query[256];
GetPlayerName(playerid, name22, sizeof(name22));
format(Query, sizeof(Query), "SELECT * FROM `accounts` WHERE `Nickname`='%s'",name22);
new string[514];
new line[1024];
samp_mysql_query(Query);
samp_mysql_store_result();
samp_mysql_fetch_row(line);
samp_mysql_get_field("Skin", string);
new value = strval(string);
SetPlayerSkin(playerid,value);
^is under onplayerspawn
can someone please help me
Re: loading/saving skin from mysql - WackoX - 05.06.2010
That's not the way it works, make a function which load an account, and load ALL tabels into variables.
Making a function for each table is waste of code and CPU.
Re: loading/saving skin from mysql -
swredder - 05.06.2010
thats not an answer to my question... altrough its a good tip