SA-MP Forums Archive
Weird thing - 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: Weird thing (/showthread.php?tid=529142)



Weird thing - devil shill - 31.07.2014

Hey guys something weird here going on i these lines but they dont save in the database all the fields are there but it keeps 0 after executing the command where this line belongs to nothing in the mysql logs saying that it has updated that line so im wondering why it isnt updating it.

Код:
				PlayerInfo[playerid][pPcarvw] = GetPlayerVirtualWorld(playerid);
                PlayerInfo[playerid][pPcarint] = GetPlayerInterior(playerid);
   				format(string,sizeof(string),"UPDATE `samp_users` SET `carint`='%d', `carvw`='%d', WHERE `PlayerID`='%d'",PlayerInfo[playerid][pPcarint],PlayerInfo[playerid][pPcarvw],PlayerInfo[playerid][pDBID]);
    	    	mysql_query(string,THREAD_UPDATE,playerid);
Still though it fetches the fields onplayerconnect.


Re: Weird thing - arko123 - 31.07.2014

Try removing the '' around the %d, they are only meant to be for strings for example
pawn Код:
PlayerInfo[playerid][pPcarvw]  = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][pPcarint] = GetPlayerInterior(playerid);

format(string, sizeof string, "UPDATE samp_users SET carint = %d, carvw = %d WHERE PlayerID = %d",
      PlayerInfo[playerid][pPcarint],
      PlayerInfo[playerid][pPcarvw],
      PlayerInfo[playerid][pDBID]
);

mysql_query(string, THREAD_UPDATE, playerid);
Also back slashes aren't really needed.


Re: Weird thing - devil shill - 31.07.2014

It worked Thanks Alot mate