Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

-- CAR cor

-----------------------------------------------------------------------------------
------------------------------------------------------
RegisterCommand('carcolor',function(source,args,rawCommand)
local user_id = vRP.getUserId(source)
if vRP.hasPermission(user_id,"owner.permissao") then
local vehicle = vRPclient.getNearestVehicle(source,7)
if vehicle then
local rgb = vRP.prompt(source,"RGB Color(255 255 255):","")
rgb = sanitizeString(rgb,"\"[]{}+=?!_()#@%/\\|,.",false)
local r,g,b = table.unpack(splitString(rgb," "))

TriggerClientEvent('vcolorv',source,vehicle,tonumber(r),tonumber(g),tonumber(b))

TriggerClientEvent('chatMessage',source,"ALERTA",{255,70,50},"Cor
^1alterada")
end
end
end)

-- CAR cor
-----------------------------------------------------------------------------------
------------------------------------------------------
RegisterNetEvent("vcolorv")
AddEventHandler("vcolorv",function(veh,r,g,b)
if IsEntityAVehicle(veh) then
SetVehicleCustomPrimaryColour(veh,r,g,b)
end
end)

You might also like