--所有颜色列表:https://pastebin.com/pwHci0xK
--输入命令例子 /paint 1 2 其中1 是主要颜色,2是次要颜色
RegisterCommand("paint", function(source, args, rawCommand)
-- If the source is > 0, then that means it must be a player.
if (source > 0) then
local ped = PlayerPedId()
if not IsPedInAnyVehicle(ped, false) then
print('not in vehicle, enter vehicle please.')
return
end
local veh = GetVehiclePedIsIn(ped, false)
local p = tonumber(args[1])
local s = tonumber(args[2])
setVehicleColors(veh, p, s)
end, false --[[this command is not restricted, everyone can use this.]])