Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_vehicles.qh
Go to the documentation of this file.
1#pragma once
2#ifdef SVQC
3
5#include "vehicle.qh"
6
7// vehicle cvars
9AUTOCVAR(g_vehicles_enter, bool, false, "require pressing use key to enter a vehicle");
11AUTOCVAR(g_vehicles_steal, bool, true, "allow stealing enemy vehicles in teamplay modes");
12AUTOCVAR(g_vehicles_steal_show_waypoint, bool, true, "show a waypoint above the thief");
21
22AUTOCVAR(g_vehicles_teams, bool, true, "allow team specific vehicles");
30
32
33// flags:
35
36// vehicle definitions
37.entity gun1;
38.entity gun2;
39.entity gun3;
41.entity vehicle;
45
46.entity gunner1;
47.entity gunner2;
48
49const .float vehicle_health = _STAT(VEHICLESTAT_HEALTH);
50const .float vehicle_energy = _STAT(VEHICLESTAT_ENERGY);
51const .float vehicle_shield = _STAT(VEHICLESTAT_SHIELD);
52
53const .float vehicle_ammo1 = _STAT(VEHICLESTAT_AMMO1);
54const .float vehicle_reload1 = _STAT(VEHICLESTAT_RELOAD1);
55const .float vehicle_ammo2 = _STAT(VEHICLESTAT_AMMO2);
56const .float vehicle_reload2 = _STAT(VEHICLESTAT_RELOAD2);
57
59const float VOL_VEHICLEENGINE = 1;
60
61const float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
62const float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
63const float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
64
65const float VHSF_NORMAL = 0;
66const float VHSF_FACTORY = 2;
67
68.float dmg_time;
69
71
72.float play_time;
73
75
76const int MAX_AXH = 4;
78
80
83.float lock_time;
85
86// vehicle functions
87.void(int _spawnflag) vehicle_spawn;
88.bool(entity this, int _imp) vehicles_impulse;
89.void(entity this, int exit_flags) vehicle_exit;
90.bool(entity this, entity player) vehicle_enter;
91const int VHEF_NORMAL = 0;
92const int VHEF_EJECT = 1;
93const int VHEF_RELEASE = 2;
94
96
97// macros
98#define VEHICLE_UPDATE_PLAYER(ply,vehi,fld,vhname) \
99 ply.vehicle_##fld = (vehi.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
100
101#define VEHICLE_UPDATE_PLAYER_RESOURCE(ply,vehi,fld,vhname,res) \
102 ply.vehicle_##fld = (GetResource(vehi, res) / autocvar_g_vehicle_##vhname##_##fld) * 100
103
104.float vehicle_enter_delay; // prevent players jumping to and from vehicles instantly
105
106void vehicles_exit(entity vehic, int eject);
107bool vehicle_initialize(entity this, Vehicle info, float nodrop);
108bool vehicle_impulse(entity this, int imp);
110void vehicles_enter(entity pl, entity veh);
111
114
115#endif
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const int MAX_AXH
entity AuxiliaryXhair[MAX_AXH]
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
#define AUTOCVAR(...)
Definition cvar.qh:161
#define IL_NEW()
#define _STAT(id)
Definition stats.qh:93
int int int imp
Definition impulse.qc:90
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32
float volly_counter
Definition sv_turrets.qh:37
void vehicles_enter(entity pl, entity veh)
const float vehicle_shield
If ent is player this is 0..100 indicating precentage of energy left on vehicle. If ent is vehicle,...
const float vehicle_reload2
If ent is player this is 0..100 indicating percentage of secondary ammo left. If ent is vehicle,...
const float vehicle_ammo1
If ent is player this is 0..100 indicating precentage of shield left on vehicle. If ent is vehicle,...
float dmg_time
const float SVC_SETVIEWANGLES
float autocvar_g_vehicles_delayspawn_jitter
const float vehicle_health
float vehicle_enter_delay
const float vehicle_energy
If ent is player this is 0..100 indicating precentage of health left on vehicle. Vehicle's value is t...
float autocvar_g_vehicles_vaporizer_damagerate
entity vehicle_viewport
const float SVC_SETVIEWPORT
float pain_frame
const int VHEF_EJECT
User pressed exit key.
bool autocvar_g_vehicles_delayspawn
const float VOL_VEHICLEENGINE
const float VHSF_FACTORY
const int VHEF_NORMAL
float vehicles_exit_running
Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (n...
const int VHEF_RELEASE
User pressed exit key 3 times fast (not implemented) or vehicle is dying.
entity gun1
bool autocvar_g_vehicles
Definition sv_vehicles.qh:8
float autocvar_g_vehicles_weapon_damagerate
entity vehicle_controller
float autocvar_g_vehicles_crush_force
float autocvar_g_vehicles_crush_minspeed
float lock_time
bool vehicle_impulse(entity this, int imp)
bool vehicle_initialize(entity this, Vehicle info, float nodrop)
entity vehicle
Entity to disply the shild effect on damage.
float autocvar_g_vehicles_allow_bots
float autocvar_g_vehicles_machinegun_damagerate
int vehicle_flags
const float SVC_UPDATEENTITY
const float VHSF_NORMAL
float autocvar_g_vehicles_tag_damagerate
entity gunner1
int autocvar_g_vehicles_exit_attempts
entity gunner2
float autocvar_g_vehicles_thinkrate
entity gun3
float lock_strength
float autocvar_g_vehicles_teleportable
entity gun2
float sound_nexttime
If ent is player this is 0..100 indicating percentage of secondary reload status. If ent is vehicle,...
bool vehicles_crushable(entity e)
float autocvar_g_vehicles_rifle_damagerate
entity vehicle_hudmodel
IntrusiveList g_vehicle_returners
float autocvar_g_vehicles_vortex_damagerate
float play_time
entity vehicle_shieldent
const float vehicle_ammo2
If ent is player this is 0..100 indicating percentage of primary reload status. If ent is vehicle,...
entity wps_intruder
entity lock_target
float vehicle_last_trace
void vehicles_exit(entity vehic, int eject)
float autocvar_g_vehicles_enter_radius
float autocvar_g_vehicles_crush_dmg
float lock_soundtime
const float vehicle_reload1
If ent is player this is 0..100 indicating percentage of primary ammo left UNLESS value is already st...