Server

Event Handler - Serverside

Entering Vehicle

Will be called when entering a vehicle

Returns plate - string - Plate of the vehicle seat - number - Steat of the vehicle the player is entering netId - number - Vehicles NetworkId isEngineOn - boolean - whether the engine is on or off isDamaged - boolean - whether the vehicle is damaged or not

RegisterNetEvent('msk_enginetoggle:enteringVehicle', function(plate, seat, netId, isEngineOn, isDamaged)
    local vehicle = NetworkGetEntityFromNetworkId(netId)
    -- Do something here
end)

Entered Vehicle

Will be called when entered a vehicle

Returns plate - string - Plate of the vehicle seat - number - Steat of the vehicle the player has entered netId - number - Vehicles NetworkId isEngineOn - boolean - whether the engine is on or off isDamaged - boolean - whether the vehicle is damaged or not

RegisterNetEvent('msk_enginetoggle:enteredVehicle', function(plate, seat, netId, isEngineOn, isDamaged)
    local vehicle = NetworkGetEntityFromNetworkId(netId)
    -- Do something here
end)

Exited Vehicle

Will be called when exited a vehicle

Returns plate - string - Plate of the vehicle seat - number - Steat of the vehicle the player has exited netId - number - Vehicles NetworkId isEngineOn - boolean - whether the engine is on or off isDamaged - boolean - whether the vehicle is damaged or not

RegisterNetEvent('msk_enginetoggle:exitedVehicle', function(plate, seat, netId, isEngineOn, isDamaged)
    local vehicle = NetworkGetEntityFromNetworkId(netId)
    -- Do something here
end)

Last updated