Skip to content

Servers

David edited this page Dec 14, 2018 · 6 revisions

Welcome server owners! This short guide will teach you how to customize SWVR for your own server experience.

Settings

In order to allow servers to make SWVR their own experience for their players, we've added the option to customize almost anything about the vehicles.

Hooks

Servers are capable of also controlling some of the inner workings of vehicles using any of the many available hooks.

All SWVR hooks are prefixed with the "SWVR." prefix. Please refer to the hooks page for a complete list of hooks and examples.

Due to the nature of the event system, you must use hooks if you want to control and prevent actions. The ENT:AddEvent() callback cannot be used to control events.

Some likely hooks that may be used by servers are included below.

Note: Never return any explicit value (except false to prevent the action) unless you know what you are doing!

Example 1: Restrict Ship Access

hook.Add("SWVR.CanEnter", "PilotJobCheck", function(ent, ply)
  if ply:Team() ~= TEAM_PILOT then return false end
end)
Clone this wiki locally