SA-MP Forums Archive
Deleting all components from a car - 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: Deleting all components from a car (/showthread.php?tid=246676)



Deleting all components from a car - thimo - 05.04.2011

Hey some cheaters like to put on all cars nitro and wheels and hydraulics. How can i make a command to remove them?
i got this:
pawn Code:
COMMAND:rmods(playerid, params[])
{
// Remove all mods from the vehicle (all added mods applied by hackers will hopefully be removed this way when the vehicle respawns)
    RemoveVehicleComponent(vehicleid, 1073);
    RemoveVehicleComponent(vehicleid, 1074);
    RemoveVehicleComponent(vehicleid, 1073);
}
Thanks if you can give me the code


Re: Deleting all components from a car - Vince - 05.04.2011

pawn Code:
new x, y, z, id, model;

id = GetPlayerVehicleID(playerid);

GetVehiclePos(id, x, y, z);
model = GetVehicleModel(id);
DestroyVehicle(id);
CreateVehicle(model, x, y, z);
Before you start copy-pasting: This will NOT work. It's just to give you an idea.


Re: Deleting all components from a car - Mmartin - 05.04.2011

Quote:
Originally Posted by Vince
View Post
pawn Code:
new x, y, z, id, model;

id = GetPlayerVehicleID(playerid);

GetVehiclePos(id, x, y, z);
model = GetVehicleModel(id);
DestroyVehicle(id);
CreateVehicle(model, x, y, z);
Before you start copy-pasting: This will NOT work. It's just to give you an idea.
And what about color? :/
Quote:

new Slot[14];
for(new i=0;i<=13;i++){ Slot[i]=GetVehicleComponentInSlot(vehicleid,i); RemoveVehicleComponent(vehicleid,Slot[i]); }

Something like that i think.


Re: Deleting all components from a car - Alby Fire - 05.04.2011

pawn Code:
new
   id = GetPlayerVehicleID(playerid);
for(new x; x < 1194 && x > 999; x++) {
    RemoveVehicleComponent(id, x);
}
This would be the best, I guess.


Re: Deleting all components from a car - thimo - 06.04.2011

Doesnt work....