RegisterCommand("unrack", function(source, args, rawCommand)
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
local class = GetVehicleClass(vehicle)
if( class == 18) then
GiveWeaponToPed(GetPlayerPed(-1), "WEAPON_CARBINERIFLE", 1000, false, false)
end
end)
RegisterCommand("rack", function(source, args, rawCommand)
local vehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)
local class = GetVehicleClass(vehicle)
if( class == 18) then
GiveWeaponToPed(GetPlayerPed(-1), "WEAPON_CARBINERIFLE", 1000, false, false)
end
end)
Havnt tested this but something like this should work, just replace the server file with this
Hello i get this error whenever i put the script in.
stack traceback:
[C]: in upvalue ‘_in’
citizen:/scripting/lua/natives_server.lua:273: in function ‘RegisterCommand’
server/main.lua:9: in main chunk
i restarted the server and then it gave this
stack traceback:
[c]: in upvalue ‘_in’
citizen:/scripting/lua/natives_server.lua:273: in function ‘RegisterCommand’
server.lua:1: in main chunk
failed to load script server.lua