1 float autocvar_g_vehicles_crush_dmg;
2 float autocvar_g_vehicles_crush_force;
3 float autocvar_g_vehicles_delayspawn;
4 float autocvar_g_vehicles_delayspawn_jitter;
6 void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
7 void vehicles_return();
10 void vehicles_reset_colors();
11 void vehicles_clearrturn();
12 void vehicles_setreturn();
16 Send addictional points of interest to be drawn, to vehicle owner
19 .entity AuxiliaryXhair[MAX_AXH];
21 float SendAuxiliaryXhair(entity to, float sf)
24 WriteByte(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR);
26 WriteByte(MSG_ENTITY, self.cnt);
28 WriteCoord(MSG_ENTITY, self.origin_x);
29 WriteCoord(MSG_ENTITY, self.origin_y);
30 WriteCoord(MSG_ENTITY, self.origin_z);
32 WriteByte(MSG_ENTITY, rint(self.colormod_x * 255));
33 WriteByte(MSG_ENTITY, rint(self.colormod_y * 255));
34 WriteByte(MSG_ENTITY, rint(self.colormod_z * 255));
39 void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
43 axh_id = bound(0, axh_id, MAX_AXH);
44 axh = own.AuxiliaryXhair[axh_id];
46 if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
50 axh.drawonlytoclient = own;
52 Net_LinkEntity(axh, FALSE, 0, SendAuxiliaryXhair);
58 own.AuxiliaryXhair[axh_id] = axh;
62 // SVC_TEMPENTITY based, horrible with even 50 ping. hm.
63 // WriteByte(MSG_ONE, SVC_TEMPENTITY) uses reliable messagess, never use for thinsg that need continous updates.
64 void SendAuxiliaryXhair2(entity own, vector loc, vector clr, float axh_id)
68 WriteByte(MSG_ONE, SVC_TEMPENTITY);
69 WriteByte(MSG_ONE, TE_CSQC_AUXILIARYXHAIR);
71 WriteByte(MSG_ONE, axh_id);
73 WriteCoord(MSG_ONE, loc_x);
74 WriteCoord(MSG_ONE, loc_y);
75 WriteCoord(MSG_ONE, loc_z);
77 WriteByte(MSG_ONE, rint(clr_x * 255));
78 WriteByte(MSG_ONE, rint(clr_y * 255));
79 WriteByte(MSG_ONE, rint(clr_z * 255));
85 void CSQCVehicleSetup(entity own, float vehicle_id)
89 WriteByte(MSG_ONE, SVC_TEMPENTITY);
90 WriteByte(MSG_ONE, TE_CSQC_VEHICLESETUP);
91 WriteByte(MSG_ONE, vehicle_id);
94 /** vehicles_locktarget
96 Generic target locking.
98 Figure out if what target is "locked" (if any), for missile tracking as such.
100 after calling, "if(self.lock_target != world && self.lock_strength == 1)" mean
101 you have a locked in target.
103 Exspects a crosshair_trace() or equivalent to be
108 .float lock_strength;
110 .float lock_soundtime;
111 void vehicles_locktarget(float incr, float decr, float _lock_time)
113 if(self.lock_target && self.lock_target.deadflag != DEAD_NO)
115 self.lock_target = world;
116 self.lock_strength = 0;
120 if(self.lock_time > time)
123 if(self.lock_soundtime < time)
125 self.lock_soundtime = time + 0.5;
126 play2(self.owner, "vehicles/locked.wav");
133 if(trace_ent != world)
135 if(teams_matter && trace_ent.team == self.team)
138 if(trace_ent.deadflag != DEAD_NO)
141 if not (trace_ent.vehicle_flags & VHF_ISVEHICLE || trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
145 if(self.lock_target == world && trace_ent != world)
146 self.lock_target = trace_ent;
148 if(self.lock_target && trace_ent == self.lock_target)
150 if(self.lock_strength != 1 && self.lock_strength + incr >= 1)
152 play2(self.owner, "vehicles/lock.wav");
153 self.lock_soundtime = time + 0.8;
155 else if (self.lock_strength != 1 && self.lock_soundtime < time)
157 play2(self.owner, "vehicles/locking.wav");
158 self.lock_soundtime = time + 0.3;
163 // Have a locking target
164 // Trace hit current target
165 if(trace_ent == self.lock_target && trace_ent != world)
167 self.lock_strength = min(self.lock_strength + incr, 1);
168 if(self.lock_strength == 1)
169 self.lock_time = time + _lock_time;
174 self.lock_strength = max(self.lock_strength - decr * 2, 0);
176 self.lock_strength = max(self.lock_strength - decr, 0);
178 if(self.lock_strength == 0)
179 self.lock_target = world;
183 #define VEHICLE_UPDATE_PLAYER(fld,vhname) \
184 self.owner.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
186 #define vehicles_sweap_collision(orig,vel,dt,acm,mult) \
187 traceline(orig, orig + vel * dt, MOVE_NORMAL, self); \
188 if(trace_fraction != 1) \
189 acm += normalize(self.origin - trace_endpos) * (vlen(vel) * mult)
191 // Hover movement support
192 float force_fromtag_power;
193 float force_fromtag_normpower;
194 vector force_fromtag_origin;
195 vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float max_power)
197 force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
198 v_forward = normalize(v_forward) * -1;
199 traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, self);
201 force_fromtag_power = (1 - trace_fraction) * max_power;
202 force_fromtag_normpower = force_fromtag_power / max_power;
204 return v_forward * force_fromtag_power;
207 // Experimental hovermode wich uses attraction/repulstion from surface insted of gravity/repulsion
208 // Can possibly be use to move abt any surface (inclusing walls/celings)
209 vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power)
212 force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
213 v_forward = normalize(v_forward) * -1;
214 traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, self);
216 // TODO - this may NOT be compatible with wall/celing movement, unhardcode 0.25 (engine count multiplier)
217 if(trace_fraction == 1.0)
219 force_fromtag_normpower = -0.25;
223 force_fromtag_power = ((1 - trace_fraction) - trace_fraction) * max_power;
224 force_fromtag_normpower = force_fromtag_power / max_power;
226 return v_forward * force_fromtag_power;
229 // Generic vehile projectile system
230 void vehicles_projectile_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
232 self.health -= damage;
233 self.velocity += force;
236 self.takedamage = DAMAGE_NO;
237 self.event_damage = SUB_Null;
238 self.think = self.use;
239 self.nextthink = time;
244 void vehicles_projectile_explode()
246 if(self.owner && other != world)
248 if(other == self.owner.vehicle)
251 if(other == self.owner.vehicle.tur_head)
257 self.event_damage = SUB_Null;
258 RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, self.shot_force, self.totalfrags, other);
263 entity vehicles_projectile(string _mzlfx, string _mzlsound,
264 vector _org, vector _vel,
265 float _dmg, float _radi, float _force, float _size,
266 float _deahtype, float _projtype, float _health,
267 float _cull, float _clianim)
273 PROJECTILE_MAKETRIGGER(proj);
274 setorigin(proj, _org);
276 proj.shot_dmg = _dmg;
277 proj.shot_radius = _radi;
278 proj.shot_force = _force;
279 proj.totalfrags = _deahtype;
280 proj.solid = SOLID_BBOX;
281 proj.movetype = MOVETYPE_FLYMISSILE;
282 proj.flags = FL_PROJECTILE;
283 proj.bot_dodge = TRUE;
284 proj.bot_dodgerating = _dmg;
285 proj.velocity = _vel;
286 proj.touch = vehicles_projectile_explode;
287 proj.use = vehicles_projectile_explode;
289 proj.realowner = self.owner;
290 proj.think = SUB_Remove;
291 proj.nextthink = time + 30;
295 proj.takedamage = DAMAGE_AIM;
296 proj.event_damage = vehicles_projectile_damage;
297 proj.health = _health;
300 proj.flags = FL_PROJECTILE | FL_NOTARGET;
303 sound (self, CHAN_WEAPON, _mzlsound, VOL_BASE, ATTN_NORM);
306 pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
309 setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size);
311 CSQCProjectile(proj, _clianim, _projtype, _cull);
315 // End generic vehile projectile system
318 Exetuted for all vehiles on (re)spawn.
319 Sets defaults for newly spawned units.
321 void vehicles_spawn()
323 dprint("Spawning vehicle: ", self.netname, "\n");
326 self.vehicle_hudmodel.viewmodelforclient = self;
329 self.touch = vehicles_touch;
330 self.event_damage = vehicles_damage;
331 self.iscreature = TRUE;
332 self.movetype = MOVETYPE_WALK;
333 self.solid = SOLID_SLIDEBOX;
334 self.takedamage = DAMAGE_AIM;
335 self.deadflag = DEAD_NO;
336 self.bot_attack = TRUE;
337 self.flags = FL_NOTARGET;
338 self.avelocity = '0 0 0';
339 self.velocity = '0 0 0';
342 self.lock_strength = 0;
343 self.lock_target = world;
344 self.misc_bulletcounter = 0;
347 self.angles = self.pos2;
348 setorigin(self, self.pos1 + '0 0 128');
350 pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
352 vehicles_reset_colors();
353 self.vehicle_spawn();
356 // Better way of determening whats crushable needed! (fl_crushable?)
357 float vehicles_crushable(entity e)
359 if(e.classname == "player")
362 if(e.classname == "monster_zombie")
368 void vehicles_touch()
370 // Vehicle currently in use
373 // Colided with world?
376 // Apply velocity based self damage here
380 if(other.vehicle_flags & VHF_ISVEHICLE)
382 //other.velocity += self.velocity * (self.mass / other.mass);
384 else if(vehicles_crushable(other))
386 if(vlen(self.velocity) != 0)
387 Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VHCRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
393 if(other.classname != "player")
396 if(other.deadflag != DEAD_NO)
399 if(other.vehicle != world)
402 // Remove this when bots know how to use vehicles.
403 if (clienttype(other) != CLIENTTYPE_REAL)
409 void vehicles_enter()
411 // Remove this when bots know how to use vehicles
412 if (clienttype(other) != CLIENTTYPE_REAL)
415 if(self.phase > time)
420 if(self.team != other.team)
423 self.vehicle_ammo1 = 0;
424 self.vehicle_ammo2 = 0;
425 self.vehicle_reload1 = 0;
426 self.vehicle_reload2 = 0;
427 self.vehicle_energy = 0;
430 self.switchweapon = other.switchweapon;
432 // .viewmodelforclient works better.
433 //self.vehicle_hudmodel.drawonlytoclient = self.owner;
435 #ifndef VEHICLES_CSQC
436 self.vehicle_hudmodel.viewmodelforclient = self.owner;
439 self.event_damage = vehicles_damage;
441 self.owner.angles = self.angles;
442 self.owner.takedamage = DAMAGE_NO;
443 self.owner.solid = SOLID_NOT;
444 self.owner.movetype = MOVETYPE_NOCLIP;
445 self.owner.alpha = -1;
446 self.owner.vehicle = self;
447 self.owner.event_damage = SUB_Null;
448 self.owner.view_ofs = '0 0 0';
449 self.colormap = self.owner.colormap;
451 self.tur_head.colormap = self.owner.colormap;
453 self.owner.hud = self.hud;
454 self.owner.PlayerPhysplug = self.PlayerPhysplug;
456 self.owner.vehicle_ammo1 = self.vehicle_ammo1;
457 self.owner.vehicle_ammo2 = self.vehicle_ammo2;
458 self.owner.vehicle_reload1 = self.vehicle_reload1;
459 self.owner.vehicle_reload2 = self.vehicle_reload2;
461 // Cant do this, hides attached objects too.
462 //self.exteriormodeltoclient = self.owner;
463 //self.tur_head.exteriormodeltoclient = self.owner;
465 other.flags &~= FL_ONGROUND;
466 self.flags &~= FL_ONGROUND;
468 self.team = self.owner.team;
469 self.flags -= FL_NOTARGET;
471 #ifndef VEHICLES_CSQC
473 WriteByte (MSG_ONE, SVC_SETVIEWPORT);
474 WriteEntity(MSG_ONE, self.vehicle_viewport);
476 WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
479 WriteAngle(MSG_ONE, self.tur_head.angles_x + self.angles_x); // tilt
480 WriteAngle(MSG_ONE, self.tur_head.angles_y + self.angles_y); // yaw
481 WriteAngle(MSG_ONE, 0); // roll
485 WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
486 WriteAngle(MSG_ONE, self.angles_x * -1); // tilt
487 WriteAngle(MSG_ONE, self.angles_y); // yaw
488 WriteAngle(MSG_ONE, 0); // roll
493 vehicles_clearrturn();
495 CSQCVehicleSetup(self.owner, self.hud);
497 self.vehicle_enter();
500 vector vehicles_findgoodexit(vector prefer_spot)
505 tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, prefer_spot, MOVE_NORMAL, self.owner);
506 if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
509 mysize = vlen(self.maxs - self.mins);
512 v2 = 0.5 * (self.absmin + self.absmax);
513 for(i = 0; i < 100; ++i)
517 v = v2 + normalize(v) * mysize;
518 tracebox(v2, PL_MIN, PL_MAX, v, MOVE_NORMAL, self.owner);
519 if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
524 exitspot = (self.origin + '0 0 48') + v_forward * mysize;
525 tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
526 if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
529 exitspot = (self.origin + '0 0 48') - v_forward * mysize;
530 tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
531 if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
534 exitspot = (self.origin + '0 0 48') + v_right * mysize;
535 tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
536 if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
539 exitspot = (self.origin + '0 0 48') - v_right * mysize;
540 tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
541 if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
548 void vehicles_exit(float eject)
550 self.flags |= FL_NOTARGET;
554 msg_entity = self.owner;
555 WriteByte (MSG_ONE, SVC_SETVIEWPORT);
556 WriteEntity( MSG_ONE, self.owner);
558 WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
559 WriteAngle(MSG_ONE, 0); // pich
560 WriteAngle(MSG_ONE, self.angles_y); // yaw
561 WriteAngle(MSG_ONE, 0); // roll
563 setsize(self.owner, PL_MIN,PL_MAX);
565 self.owner.takedamage = DAMAGE_AIM;
566 self.owner.solid = SOLID_SLIDEBOX;
567 self.owner.movetype = MOVETYPE_WALK;
568 self.owner.effects &~= EF_NODRAW;
569 self.owner.alpha = 1;
570 self.owner.PlayerPhysplug = SUB_Null;
571 self.owner.vehicle = world;
572 self.owner.view_ofs = PL_VIEW_OFS;
573 self.owner.event_damage = PlayerDamage;
574 self.owner.hud = HUD_NORMAL;
575 self.owner.switchweapon = self.switchweapon;
576 self.owner.BUTTON_USE = 0;
579 if(self.deadflag == DEAD_NO)
580 self.avelocity = '0 0 0';
582 self.vehicle_hudmodel.viewmodelforclient = self;
583 self.tur_head.nodrawtoclient = world;
584 vehicles_setreturn();
586 self.phase = time + 1;
591 self.vehicle_exit(eject);
596 void vehicles_regen(.float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time)
598 if(self.regen_field < field_max)
599 if(self.timer + rpause < time)
601 self.regen_field = min(self.regen_field + regen * delta_time, field_max);
604 self.owner.regen_field = (self.regen_field / field_max) * 100;
608 void shieldhit_think()
613 //setmodel(self, "");
618 self.nextthink = time + 0.1;
622 void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
624 self.dmg_time = time;
626 if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
628 if (wasfreed(self.vehicle_shieldent) || self.vehicle_shieldent == world)
630 self.vehicle_shieldent = spawn();
631 self.vehicle_shieldent.effects = EF_LOWPRECISION;
633 setmodel(self.vehicle_shieldent, "models/vhshield.md3");
634 setattachment(self.vehicle_shieldent, self, "");
635 setorigin(self.vehicle_shieldent, real_origin(self) - self.origin);
636 self.vehicle_shieldent.scale = 256 / vlen(self.maxs - self.mins);
637 self.vehicle_shieldent.think = shieldhit_think;
641 self.vehicle_shieldent.colormod = '1 1 1';
642 self.vehicle_shieldent.alpha = 0.45;
643 self.vehicle_shieldent.angles = vectoangles(normalize(hitloc - (self.origin + self.vehicle_shieldent.origin))) - self.angles;
644 self.vehicle_shieldent.nextthink = time;
646 self.vehicle_shield -= damage;
648 if(self.vehicle_shield < 0)
650 self.vehicle_shieldent.colormod = '2 0 0';
651 self.vehicle_shield = 0;
652 self.vehicle_shieldent.alpha = 0.75;
653 self.vehicle_health -= fabs(self.vehicle_shield);
657 self.vehicle_health -= damage;
659 self.velocity += force; // * (vlen(force) / self.mass);
661 if(self.vehicle_health <= 0)
664 if(self.vehicle_flags & VHF_DEATHEJECT)
665 vehicles_exit(VHEF_EJECT);
667 vehicles_exit(VHEF_RELESE);
670 vehicles_setreturn();
674 void vehicles_return()
676 pointparticles(particleeffectnum("teleport"), self.enemy.origin + '0 0 64', '0 0 0', 1);
678 self.enemy.think = vehicles_spawn;
679 self.enemy.nextthink = time;
684 void vehicles_clearrturn()
687 // Remove "return helper", if any.
688 ret = findchain(classname, "vehicle_return");
691 if(ret.enemy == self)
694 ret.think = SUB_Remove;
695 ret.nextthink = time + 0.1;
703 void vehicles_setreturn()
707 vehicles_clearrturn();
710 ret.classname = "vehicle_return";
712 ret.think = vehicles_return;
713 ret.nextthink = time + self.vehicle_respawntime;
716 float vehicles_customizeentityforclient()
718 if(self.deadflag == DEAD_DEAD)
724 void vehicles_configcheck(string configname, float check_cvar)
727 localcmd(strcat("exec ", configname, "\n"));
730 void vehicles_reset_colors()
733 float _effects, _colormap;
734 vector _glowmod, _colormod;
736 if(autocvar_g_nodepthtestplayers)
737 _effects = EF_NODEPTHTEST;
739 if(autocvar_g_fullbrightplayers)
740 _effects |= EF_FULLBRIGHT;
743 _colormap = 1024 + (self.team - 1) * 17;
750 // Find all ents attacked to main model and setup effects, colormod etc.
751 e = findchainentity(tag_entity, self);
754 if(e != self.vehicle_shieldent)
756 e.effects = _effects | EF_LOWPRECISION;
757 e.colormod = _colormod;
758 e.colormap = _colormap;
764 self.vehicle_hudmodel.effects = self.effects = _effects | EF_LOWPRECISION;
765 self.vehicle_hudmodel.colormod = self.colormod = _colormod;
766 self.vehicle_hudmodel.colormap = self.colormap = _colormap;
767 self.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
770 self.avelocity = '0 0 0';
771 self.velocity = '0 0 0';
772 self.effects = _effects;
775 float vehicle_initialize(string net_name,
790 void(float extflag) exitfunc,
795 addstat(STAT_HUD, AS_INT, hud);
796 addstat(STAT_VEHICLESTAT_HEALTH, AS_INT, vehicle_health);
797 addstat(STAT_VEHICLESTAT_SHIELD, AS_INT, vehicle_shield);
798 addstat(STAT_VEHICLESTAT_ENERGY, AS_INT, vehicle_energy);
800 addstat(STAT_VEHICLESTAT_AMMO1, AS_INT, vehicle_ammo1);
801 addstat(STAT_VEHICLESTAT_RELOAD1, AS_INT, vehicle_reload1);
803 addstat(STAT_VEHICLESTAT_AMMO2, AS_INT, vehicle_ammo2);
804 addstat(STAT_VEHICLESTAT_RELOAD2, AS_INT, vehicle_reload2);
807 error("vehicles: missing bodymodel!");
810 error("vehicles: missing hudmodel!");
813 self.netname = self.classname;
815 self.netname = net_name;
817 if(self.team && !teams_matter)
820 self.vehicle_flags |= VHF_ISVEHICLE;
822 setmodel(self, bodymodel);
824 self.vehicle_viewport = spawn();
825 self.vehicle_hudmodel = spawn();
826 self.tur_head = spawn();
827 self.tur_head.owner = self;
828 self.takedamage = DAMAGE_AIM;
829 self.bot_attack = TRUE;
830 self.iscreature = TRUE;
833 //self.customizeentityforclient = vehicles_customizeentityforclient;
834 self.vehicle_die = dieproc;
835 self.vehicle_exit = exitfunc;
836 self.vehicle_enter = enterproc;
837 self.PlayerPhysplug = physproc;
838 self.event_damage = vehicles_damage;
839 self.touch = vehicles_touch;
840 self.think = vehicles_spawn;
841 self.nextthink = time;
842 self.vehicle_respawntime = _respawntime;
843 self.vehicle_spawn = spawnproc;
845 if(autocvar_g_nodepthtestplayers)
846 self.effects = self.effects | EF_NODEPTHTEST;
848 if(autocvar_g_fullbrightplayers)
849 self.effects = self.effects | EF_FULLBRIGHT;
851 setmodel(self.vehicle_hudmodel, hudmodel);
852 setmodel(self.vehicle_viewport, "null");
857 setmodel(self.tur_head, topmodel);
858 setattachment(self.tur_head, self, toptag);
859 setattachment(self.vehicle_hudmodel, self.tur_head, hudtag);
860 setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
864 setattachment(self.tur_head, self, "");
865 setattachment(self.vehicle_hudmodel, self, hudtag);
866 setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
869 setsize(self, min_s, max_s);
872 setorigin(self, self.origin);
873 tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
874 setorigin(self, trace_endpos);
877 self.pos1 = self.origin;
878 self.pos2 = self.angles;
889 self.vehicle_exit = self.vehicle_exit;
890 self.vehicle_enter = self.vehicle_exit;
891 self.vehicle_die = self.vehicle_exit;
892 self.vehicle_spawn = self.vehicle_exit;
893 self.AuxiliaryXhair = self.AuxiliaryXhair;