04.12.2015, 21:28
Okay so the problem is simple as it can be. The query will always insert FactionID as 0.
I printed the result
[pawn][23:22:43] INSERT INTO `vehicles` (`MasterID`,`ModelID`,`Color1`,`Color2`,`PosX`,`Po sY`,`PosZ`,`PosA`,`RespawnTime`,`Price`,`Damage`,` FuelStatus`,`EngineStatus`,`Kilometrage`,`Siren`,` Owned`,`VirtualWorld`,`Interior`,`FactionID`) VALUES ('0','411','0','0','1585.514','-1625.23','13.383','273.748','0','220000','1000','0 ','0','0.0',0,1,0,0,'0')[/php]
Code used
Everything gets inserted correctly besides AccInfo[playerid][PlayerFaction], which always stores as 0. I printed out the AccInfo[playerid][PlayerFaction] and it gave me correct result
No errors inside the SQL log
I printed the result
[pawn][23:22:43] INSERT INTO `vehicles` (`MasterID`,`ModelID`,`Color1`,`Color2`,`PosX`,`Po sY`,`PosZ`,`PosA`,`RespawnTime`,`Price`,`Damage`,` FuelStatus`,`EngineStatus`,`Kilometrage`,`Siren`,` Owned`,`VirtualWorld`,`Interior`,`FactionID`) VALUES ('0','411','0','0','1585.514','-1625.23','13.383','273.748','0','220000','1000','0 ','0','0.0',0,1,0,0,'0')[/php]
Code used
PHP код:
mysql_format(mysql, query, sizeof(query),"INSERT INTO `vehicles` (`MasterID`,`ModelID`,`Color1`,`Color2`,`PosX`,`PosY`,`PosZ`,`PosA`,`RespawnTime`,`Price`,`Damage`,`FuelStatus`,`EngineStatus`,`Kilometrage`,`Siren`,`Owned`,`VirtualWorld`,`Interior`,`FactionID`,`Locked`) VALUES ('%i','%i','%i','%i','%f','%f','%f','%f','%i','%i','%i','%i','%i','%f',0,1,0,0,'%i',0)",\
0,vid,0,0,Pos[0],Pos[1],Pos[2],Pos[3],0,GetVehiclePrice(vid),1000,0,0,0,0,0,0,0,AccInfo[playerid][PlayerFaction],0);
mysql_tquery(mysql, query, "OnVehicleCreation", "i", playerid);
PHP код:
printf("%i faction ID || 2nd %i ",VehInfo[vehicleid][VehFaction],AccInfo[playerid][PlayerFaction]);
[23:22:43] 1 faction ID || 2nd 1