Module core.plugins.vehicles.sv_init
Serverside Vehicle Plugin.
Module Overview
Functions
| vmRepositionPlayer(ply, veh) | Adjust a players sitting position based on pre-defined configs. |
| getVehicleFilter(veh) | Fetch a vehicle filter for a given vehicle. |
| vmEnterVehicle(ply, vehicle, role) | Hook called when a player enters a vehicle. |
| vmGetVehicleExit(player, vehicle, force) | Hook called when a player exits a vehicle. |
| vmDoVehicleExit(ply) | Hook called when a player attempts to exit the vehicle. |
| vmDoEnterVehicle(player, vehicle) | Hook called when a player requests to enter a vehicle. |
| vmExitCar(ply, key) | Called when a player presses a key to request exit from the vehicle. |
| vmSpawnedVehicle(player, vehicle) | Called when a vehicle has been spawned. |
| PLUGIN.SpawnVehicle(ply, item, meta) | Called when a player attempts to spawn a vehicle. |
| PLUGIN.FillVehicle(ply, item) | Fill a car with petrol. |
| PLUGIN.CreateCan(player, item) | Create the petrol can. |
| PLUGIN.ChargeVehicle(ply, item) | Charge a car with volt. |
| PLUGIN.RepairVehicle(player, item) | Repair the vehicle the player is facing. |
| CanPlayerEnterVehicleexitloc(ply, vehicle, role) | Set data regarding the player enting a vehicle, so they can be spat back out into the same place. |
| PlayerLeaveVehicleexitloc(ply, vehicle, role) | Set up so a player leaves to the same point they entered the vehicle from. |
| cityrp.remotedoor(ply) | Toggle a remote door. |
| onVehicleLightsUsed(ply, group) | Inventory function called when attempting to load up civilian emergency lighting on a vehicle. |
| PLUGIN.horn(ply) | Honk a vehicle's horn. |
- vmRepositionPlayer(ply, veh)
-
Adjust a players sitting position based on pre-defined configs.
Parameters:
- ply The player having their position ajusted.
- veh The vehicle of which the player is sitting in.
- getVehicleFilter(veh)
-
Fetch a vehicle filter for a given vehicle.
Parameters:
- veh Entity The vehicle to generate a filter for.
- vmEnterVehicle(ply, vehicle, role)
-
Hook called when a player enters a vehicle.
Handles interactions with emergency lighting, team restricted vehicles and such.
Parameters:
- ply The player entering the vehicle.
- vehicle The vehicle being entered.
- role Unused.
Returns:
-
boolean If the entry was allowed.
- vmGetVehicleExit(player, vehicle, force)
-
Hook called when a player exits a vehicle.
Parameters:
- player Player The player exiting the vehicle.
- vehicle Entity The vehicle being exited.
- force bool ] Should the player be forced out of the vehicle? (i.e. if hostaged/cuffed)
Returns:
-
boolean
If the player was allowed to exit.
- vmDoVehicleExit(ply)
-
Hook called when a player attempts to exit the vehicle.
Calls vmGetVehicleExit.
Deals with third person, being injured from ejecting, etc.
Parameters:
- ply Player The player attempting to exit.
- vmDoEnterVehicle(player, vehicle)
-
Hook called when a player requests to enter a vehicle.
Parameters:
- player Player The player entering.
- vehicle Entity The vehicle being entered.
Returns:
-
boolean If the entry was allowed.
- vmExitCar(ply, key)
-
Called when a player presses a key to request exit from the vehicle.
Handles internal locking and passes onto exits.
Parameters:
- vmSpawnedVehicle(player, vehicle)
-
Called when a vehicle has been spawned.
Sets up skins, bodygroups, fixes collisions.
Parameters:
- player The player who spawned the vehicle.
- vehicle The vehicle which was spawned.
- PLUGIN.SpawnVehicle(ply, item, meta)
-
Called when a player attempts to spawn a vehicle.
Parameters:
- PLUGIN.FillVehicle(ply, item)
-
Fill a car with petrol.
Parameters:
- ply Player The player attempting to fill the fuel.
- item tab The item table used to call the function.
- PLUGIN.CreateCan(player, item)
-
Create the petrol can.
Parameters:
- player The player attempting to create the can.
- item The item table used to call the function.
- PLUGIN.ChargeVehicle(ply, item)
-
Charge a car with volt.
Parameters:
- ply Player The player attempting to fill the fuel.
- item tab The item table used to call the function.
- PLUGIN.RepairVehicle(player, item)
-
Repair the vehicle the player is facing.
Parameters:
- player The player attempting to repair the vehicle.
- item The item table used to call the function.
- CanPlayerEnterVehicleexitloc(ply, vehicle, role)
-
Set data regarding the player enting a vehicle, so they can be spat back out into the same place.
Parameters:
- ply The player entering the vehicle.
- vehicle the vehicle being entered.
- role Unused.
- PlayerLeaveVehicleexitloc(ply, vehicle, role)
-
Set up so a player leaves to the same point they entered the vehicle from.
Parameters:
- ply The player leaving the vehicle.
- vehicle the vehicle being left.
- role Unused.
- cityrp.remotedoor(ply)
-
Toggle a remote door.
Parameters:
- ply The player firing off a remote door request.
- onVehicleLightsUsed(ply, group)
-
Inventory function called when attempting to load up civilian emergency lighting on a vehicle.
Parameters:
- ply The player loading lighting.
- group The type of lighting.
- PLUGIN.horn(ply)
-
Honk a vehicle's horn.
Parameters:
- ply The horny player.