AddVehicleComponent not working [rep++] -
EnforcerDon - 17.11.2014
OK, so I'm trying to make a mod saving system for my server, and so far the entire system is up and works perfectly, but for one simple problem.
The side skirts components (for testing I am using 1017 (left side) and 1007 (right side), which are the standard transfender side skirts and work on most cars) will save using my system, but when I try to load all the car mods to a vehicle, all the mods load fine except for the side skirts, which will not show, despite being added to the vehicle by my script. In short, I am calling the AddVehicleComponent function, but certain components will not add themselves.
Here is the section my code responsible, note that it will print "left side skirt 1017" and something similar for the right, showing that my mod saving system is working. Also note that this code work fine for any other car mods, all it won't do is load the side skirt mods to a vehicle.
pawn Код:
if(vehicleStat[vehstatid][vMod03] != 0) {
AddVehicleComponent(vehicleid, vehicleStat[vehstatid][vMod03]);
componentsAdded++;
printf("left side skirt %d", vehicleStat[vehstatid][vMod03]);
}
if(vehicleStat[vehstatid][vMod04] != 0) {
AddVehicleComponent(vehicleid, vehicleStat[vehstatid][vMod04]);
componentsAdded++;
printf("right side skirt %d", vehicleStat[vehstatid][vMod04]);
}
I don't know if this is a bug in samp, or if there is something I don't know, or if there may be a way around this. I am just asking in the hope that someone who has made this work for them will be able go guide me as to how to do it myself.
Thanks in advance for any help.
Re : AddVehicleComponent not working [rep++] -
Dutheil - 17.11.2014
Код:
AddVehicleComponent(vehstatid, vehicleStat[vehstatid][vMod03]); // no ?
Re: Re : AddVehicleComponent not working [rep++] -
EnforcerDon - 17.11.2014
Quote:
Originally Posted by Dutheil
Код:
AddVehicleComponent(vehstatid, vehicleStat[vehstatid][vMod03]); // no ?
|
that is effectively what I am doing, except in my code vehicleid refers to the vehicle and vehstatid refers to the vehicles stats. That part works fine, and always has. Note that this code works for all the other mods, just not the side skirts.
Re : AddVehicleComponent not working [rep++] -
Dutheil - 17.11.2014
What is the model of the vehicle ?
Re: Re : AddVehicleComponent not working [rep++] -
EnforcerDon - 22.11.2014
Quote:
Originally Posted by Dutheil
What is the model of the vehicle ?
|
I've tried this with a Solair and a Blista Compact, just random vehicles that were spawned nearby.
Re: AddVehicleComponent not working [rep++] -
EnforcerDon - 30.11.2014
No one knows why this is?