Copy AddEventHandler( 'rm_decalv2:server:onDecalAdded' , function ( data )
if data.type == 'graffiti' then
-- print(data.source)
-- print(data.fileName)
-- print(vec3(data.posX, data.posY, data.posZ))
elseif data.type == 'sticker' then
-- print(data.source)
-- print(data.fileName)
-- print(data.plate)
end
end )
Copy AddEventHandler( 'rm_decalv2:server:onDecalRemoved' , function ( data )
if data.type == 'graffiti' then
-- print(data.source)
-- print(data.fileName)
-- print(vec3(data.posX, data.posY, data.posZ))
elseif data.type == 'sticker' then
-- print(data.source)
-- print(data.fileName)
-- print(data.plate)
end
end )
If the vehicle stickers are not properly placed after you have put your vehicle in and out of the garage, place this function under the vehicle creation event of your garage script.
Copy exports['rm_decalv2']:initializeStickers(vehicle--[[entity]])
Copy QBCore.Functions.CreateCallback( 'qb-garages:server:spawnvehicle' , function ( source , cb , plate , vehicle , coords )
local vehType = QBCore.Shared.Vehicles[vehicle] and QBCore.Shared.Vehicles[vehicle].type or GetVehicleTypeByModel(vehicle)
local veh = CreateVehicleServerSetter(GetHashKey(vehicle), vehType, coords.x, coords.y, coords.z, coords.w)
local netId = NetworkGetNetworkIdFromEntity(veh)
SetVehicleNumberPlateText(veh, plate)
local vehProps = {}
local result = MySQL.rawExecute.await( 'SELECT mods FROM player_vehicles WHERE plate = ?' , { plate })
if result and result[ 1 ] then vehProps = json.decode(result[ 1 ].mods) end
OutsideVehicles[plate] = { netID = netId, entity = veh }
cb(netId, vehProps, plate)
exports[ 'rm_decalv2' ]:initializeStickers(veh)
end )