SA-MP Forums Archive
Sideskirt not attached to Slamvam - 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: Sideskirt not attached to Slamvam (/showthread.php?tid=525767)



Sideskirt not attached to Slamvam - YwX - 13.07.2014

Hello all!
Well, I have a system to attach components to the player's modded vehicles, reading the IDs from one file, like:
pawn Код:
if(dini_Int(pVeh, "Lights") != -1)
{
AddVehicleComponent(bought_vehicle[playerid], dini_Int(pVeh, "Lights"));
}
Well, all work right, except the Sideskirts. They won't attach to vehicle.
pawn Код:
if(dini_Int(pVeh, "Sideskirt") != -1)
{
AddVehicleComponent(bought_vehicle[playerid], dini_Int(pVeh, "Sideskirt"));
}
Why? Can anyone help me to solve this? Why all components are added, but Sideskirts no?
Thanks all in advance and I apreciate all help!


Re: Sideskirt not attached to Slamvam - darles92 - 13.07.2014

well, I expirienced sideskirts problem with every tunable car, they usually dont show for 1st time, but after adding them again, they show up.


Re: Sideskirt not attached to Slamvam - YwX - 13.07.2014

Yep, I've fixed it with a timer.
I will let the code here if someone needs. Load the variable line in dini file and put in a timer public:
pawn Код:
if(GetVehicleComponentType(Sideskirt) != Sideskirt)
            {
                AddVehicleComponent(bought_vehicle[playerid], Sideskirt);
            }
        }
The GetVehicleComponentType is only for check if the car already have a Sideskirt and not add if it have.
See ya!