Little help with mysql load cars.
#1

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

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]);
Reply
#3

Not work.
Reply
#4

Is "owner" an integer or string?
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)