vehicle components
#1

I'm keeping the vehicle components this way:

Код:
for(new i = 0; i <= 13; i++)
{
    var[playerid][component][i] = GetVehicleComponentInSlot(vehicleid, i);
}
new components[70];
format(components,70,"%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d",
var[playerid][component][0],
var[playerid][component][1],
var[playerid][component][2],
var[playerid][component][3],
var[playerid][component][4],
var[playerid][component][5],
var[playerid][component][6],
var[playerid][component][7],
var[playerid][component][8],
var[playerid][component][9],
var[playerid][component][10],
var[playerid][component][11],
var[playerid][component][12],
var[playerid][component][13]);
//I do update the DB
and load it

Код:
//load the string of DB to "components"
//and set in your respective variables
sscanf(components,"p<|>iiiiiiiiiiiiii",
var[playerid][component][0],
var[playerid][component][1],
var[playerid][component][2],
var[playerid][component][3],
var[playerid][component][4],
var[playerid][component][5],
var[playerid][component][6],
var[playerid][component][7],
var[playerid][component][8],
var[playerid][component][9],
var[playerid][component][10],
var[playerid][component][11],
var[playerid][component][12],
var[playerid][component][13]);

//and add it to vehicle

for(new i = 0; i <= 13; i++)
{
	AddVehicleComponent(vehicleid, var[playerid][component][i]);
}
It keep and load correctly but apparently some are not added to the vehicle visually, e.g. tunings to the bonnet and trims (I see that the trims modifications are loading places as if they were tires lol). It's bug SA-MP? because even I made a cmd to verify the current components of the vehicle and are exactly the same in the order of the table, and it are listed as the vehicle has it but not visually. (Also I checked the values of the variables and well)

should I make an additional condition?

sorry for my bad english?
Reply
#2

Try to respawn the car. The Server will automaticly attach the components.
Reply
#3

Quote:
Originally Posted by GangstaSunny
Посмотреть сообщение
Try to respawn the car. The Server will automaticly attach the components.
Nothing.

Vehicle components are not attached when I add using AddVehicleComponent (but using GetVehicleComponentInSlot yes they are there). When they are added with ModShop default are visible.

It only happens with the modifications to the bonnet and trims.
Reply
#4

The problem is the function AddVehicleComponent don't work well when the vehicle is without driver. (with these components)

Any idea for solution?
Reply
#5

up .
Reply
#6

Some tuning parts works only in pairs, such as bonnet vents and low-riders trims, you have to apply them in pairs.
Reply
#7

Quote:
Originally Posted by ikey07
Посмотреть сообщение
Some tuning parts works only in pairs, such as bonnet vents and low-riders trims, you have to apply them in pairs.
Yes, I had already solved in this way, but not quite. Likewise I need to have a player inside the vehicle to implement these components. (twice as you said).

If I want to create vehicles tuning for the map I'm having difficulties with these.
Reply
#8

Oh, I just remembered what I did to solve it, whenever vehicle streams in re-apply tuning ( without loading parts from database )
Reply
#9

Quote:
Originally Posted by ikey07
Посмотреть сообщение
Oh, I just remembered what I did to solve it, whenever vehicle streams in re-apply tuning ( without loading parts from database )
You're the fucking master. I just had to do that and solves everything. Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)