Weird thing
#1

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

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

It worked Thanks Alot mate
Reply


Forum Jump:


Users browsing this thread: