[HELP][LUA] Disable extra parts from vehicle
-
Hi. I’m trying to disable one of the extras from addon vehicle. The extra name is “extra_3” so I added this line to __resource.lua file:
- void SetVehicleExtra(vehicle, extra_3, 1);
Idk if that’s correct structure but I’ve tried many combinations like:
- void SetVehicleExtra(vehicle, extra_3, 1);
- SetVehicleExtra(vehicle, 3, 1);
- void SetVehicleExtra(vehicle, 3, 1)
- SetVehicleExtra(vehicle, 3, 1)
- SetVehicleExtra(vehicle, extra_3, 1);
- void SetVehicleExtra(vehicle, extra_3, 1)
- SetVehicleExtra(vehicle, extra_3, 1)
Server is crashing or vehicle is not spawning if I use one of this commands.
Please help
-
LUA? Server? You might have some more luck on the FiveM forums
-
@ikt Posted here, because nobody give a damn about my problem. I gave up there 😫
-
The native is
void SET_VEHICLE_EXTRA(Vehicle vehicle, int extraId, BOOL toggle)
and the FiveM native probably also looks like that.Doing
SetVehicleExtra(vehicle, 3, false);
or something on a vehicle instance should work fine.Do you know how to program/script?
First you spawn the vehicle. Then you disable the extra.
__resource.lua
does not sound like a scripting thing.
-
@ikt So I can't toggle off extra parts by lua? I don't want to use trainers/commands to disable extras, because I have Roleplay server. If resource doesn't like scripting, where I should put that line?
-
You can run some server-sided scripts to keep track of the vehicles and stuff. I don't know the specifics as I don't FiveM.