SA-MP Forums Archive
Problem with mysql fuel saving. - 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: Problem with mysql fuel saving. (/showthread.php?tid=257313)



Problem with mysql fuel saving. - Vvolk - 25.05.2011

I make an fuel system and in my system I can buy tanks of fuel, but if I buy it I do that: SetPVarInt(playerid,"Tanks",1); But problem this: I want to save this tanks to mysql but it doesn't. There is my code:
Код:
public OnPlayerDisconnect( playerid, reason )
{
	new tanks[30],pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid,pName,sizeof(pName));
	if ( Logged[ playerid ] )
	{
	   MySQLCheck();
	   format(tanks,sizeof(tanks),"UPDATE `"TABLENAME"` SET `Tanks`='%d' WHERE (`Name` = '%s')",GetPVarInt(playerid,"Tanks"),pName);
	   mysql_query(tanks);
	}
	return 1;
}
But this code doesn't save to mysql DB... And I have buoght tanks of fuel but it doesn't save it Please help me with this


Re: Problem with mysql fuel saving. - Raimis_R - 25.05.2011

Check mysql_log and tanks value "30" i think it's to small. You need set "100".

pawn Код:
new tanks[100];