HUD
Functions

GM: can Toggle Lights

Called before vehicles lights are toggled. Currently possible light types: running, fog, lowbeam, highbeam, hazards, blinkers_left, blinkers_right.

Used in: VCMod Main addon.

Shared GM:VC_canToggleLights(Entity ent, String ltype, Boolean on)

Arguments

1. Entity ent; Vehicle
Vehicle whos lights are being toggled.

2. String ltype; Type
Light type that is being toggled.

3. Boolean on; Lights are on
Current state of this light type prior to toggling.

Returns

1. Boolean If it should allow it or not.

Example

hook.Add("VC_canToggleLights", "VC_canToggleLights", function(ent, ltype, on)
	if ltype == "hazards" and !on then
		print("Vehicle :"..ent:VC_getName().." is attempting to shut down its hazard lights, lets not allow that.")
		local can = false
		return can
	end
end)
Page modified:
...2018-11-02 09:24:35