[help] whats wrong with this

TriggerEvent(‘es:addGroupCommand’, ‘fix’, “mod”, function(source, args, user)
TriggerEvent(“SetVehicleFixed”, source)
end, function(source, args, user)
TriggerClientEvent(‘chatMessage’, source, “SYSTEM”, {255, 0, 0}, “Insufficienct permissions!”)
end)

can you help me i dont know what is wrong with this?

You have this sv_admin.lua script ?

indeed i do have it in there

https://hastebin.com/oruneniyep.lua thats how i have it

Should be TriggerClientEvent, I believe

I had it as that and didnt work so i changed

anyone else have an idea what it is?

so its registering the command but it just doesn’t fix the car

Could you provide more code rather than just a snippet?

It’s kinda hard to help you when we don’t have any context and a small snippet to work with.

I’m going to assume you’ve already done the following on the client

RegisterNetEvent("SetVehicleFixed")
AddEventHandler("SetVehicleFixed", function()
   -- Some code here
end)

If so then you need to listen to what @Briglair said and use TriggerClientEvent.

You can find more on TriggerClientEvent here.

i posted the whole file [quote=“ExoticNx, post:4, topic:19995, full:true”]
https://hastebin.com/oruneniyep.lua thats how i have it
[/quote]

Right, so you haven’t written any client-side code?

There’s the problem. The event “SetVehicleFixed” doesn’t exist on the server (you haven’t got a handler for it) and it should probably be a client event (assuming you’re going to be calling natives).

So,

  1. Create a client event called “SetVehicleFixed”
  2. Add code to the event to fix the vehicle.
  3. Make sure to call TriggerClientEvent("SetVehicleFixed", source)

RegisterNetEvent(“SetVehicleFixed”)
AddEventHandler(“SetVehicleFixed”, function()
SetVehicleFixed(GetVehiclePedIsUsing)
end)

put this in cl_admin