Deleting all components from a car
#1

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
Reply
#2

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.
Reply
#3

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.
Reply
#4

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

Doesnt work....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)