Multi Theft Auto: Wiki:OnVehicleSpawn
Jump to navigation
Jump to search
blabl
Source: https://google.com
Source
The source of this event is the vehicle that spawned.
Code
Click to collapse [-]
Clientside ScriptaddEventHandler("onClientElementStreamIn", root, function()
if getElementType(source) == "vehicle" then
triggerServerEvent("onVehicleSpawnCheck", localPlayer, source)
end
end)
Click to collapse [-]
Serverside ScriptaddEvent("onVehicleSpawn", true)
function onVehicleSpawnCheck(vehicle)
triggerEvent("onVehicleSpawn", vehicle)
end
addEvent("onVehicleSpawnCheck", true)
addEventHandler("onVehicleSpawnCheck", root, onVehicleSpawnCheck)