Key System
warning
Please note that the implementation for car key systems is only included in Bus Driver Pro version 1.6.2 or newer.
info
Please note that this is a client side event. If your car key system needs server side implementation you will have to implement the bridge yourself.
Bus Driver Pro has an event called BusDriverPro:CarSpawned
that is triggered whenever a bus is being spawned for the player.
Parametersβ
-
Vehicle Handle
Can be used to retrieve the vehicle object or for native calls
-
License Plate
Can be used as identifier for some key resources
Example implementationβ
EventHandlers["BusDriverPro:CarSpawned"] += new Action<int, string>(TargetFunction);
private void TargetFunction(int handle, string plate)
{
myKeyScript.unlockCar(handle);
}
AddEventHandler("BusDriverPro:CarSpawned", function(handle, plate)
myKeyScript.unlockCar(handle)
end)
on('BusDriverPro:CarSpawned', (handle, plate) => {
myKeyScript.unlockCar(handle);
});