SA-MP Forums Archive
Removing all components - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Removing all components (/showthread.php?tid=213188)



Removing all components - yanir3 - 18.01.2011

How can I remove all components from car like this function
https://sampwiki.blast.hk/wiki/RemoveVehicleComponent
But all components... from 1 to 99999


Re: Removing all components - Backwardsman97 - 18.01.2011

That's for removing components like nitro and such.


Re: Removing all components - PowerPC603 - 18.01.2011

pawn Код:
new componentid;

for (new i; i < 14; i++)
{
    componentid = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), i);
    if (componentid != 0)
        RemoveVehicleComponent(GetPlayerVehicleID(playerid), componentid);
}
That should do it.
It checks every component slot for a component-id.
If there is one installed, componentid will not be 0 and the component will be removed from the player's vehicle.


Re: Removing all components - yanir3 - 18.01.2011

Thanks.