loading/saving skin from mysql
#1

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
Reply
#2

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.
Reply
#3

thats not an answer to my question... altrough its a good tip
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)