SA-MP Forums Archive
Little help with mysql load cars. - 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: Little help with mysql load cars. (/showthread.php?tid=295163)



Little help with mysql load cars. - budelis - 05.11.2011

Hi peoples. I want to ask one thing. I have this varriable:

Код:
PlayerData[playerid][pcar];
And when is loading cars i want to set this varriable to carid,because with this varriable i do /carmapp and like that commands.

Now i do like that but this is no work:

Код:
new CreateCar = CreateVehicle(VehicleInfo[index][CModel],VehicleInfo[index][PX],VehicleInfo[index][PY],VehicleInfo[index][PZ],VehicleInfo[index][PA],VehicleInfo[index][Color1],VehicleInfo[index][Color2],-1);
mysql_get_field("Owner", savingstring);  VehicleInfo[index][owner] = strlen(savingstring);
new carowner = VehicleInfo[index][owner];
PlayerData[carowner][pcar] = CreateCar;



Re: Little help with mysql load cars. - Calgon - 05.11.2011

pawn Код:
mysql_get_field("Owner", savingstring);  VehicleInfo[index][owner] = strlen(savingstring);
This makes no sense - you're setting the vehicle owner to the length of the player's name... This means that the owner variable will be 7 if your in-game name is 'budelis'.

If 'VehicleInfo[index][owner]' is a string, you can just unload the MySQL value in to it:

pawn Код:
mysql_get_field("Owner", VehicleInfo[index][owner]);



Re: Little help with mysql load cars. - budelis - 05.11.2011

Not work.


Re: Little help with mysql load cars. - Calgon - 05.11.2011

Is "owner" an integer or string?


Re: Little help with mysql load cars. - budelis - 05.11.2011

Oh work sorry...But now another problem...Ok i load that varriable "pcar" ,but when i use it anywhere it have -1, i don't understand why,i don't set pcar to -1 just onplayerconnect....


Re: Little help with mysql load cars. - budelis - 05.11.2011

Finilly i finish do all my problems just one left. Problem is when i do paintjob on my car and then color,just save paintjob and color save,but just paintjob is on vehicle.