61 if(!ignoredead &&
IS_DEAD(
this))
66 if(
imp == CHIMPULSE_CLONE_MOVING.impulse ||
imp == CHIMPULSE_CLONE_STANDING.impulse)
92#define BEGIN_CHEAT_FUNCTION() \
93 float cheating = 0, attempting = 0
96#define ADD_CHEATS(e,n) \
97 cheatcount_total += n; \
99#define END_CHEAT_FUNCTION() \
100 ADD_CHEATS(this, cheating); \
102#define IS_CHEAT(ent,i,argc,fr) \
103 if((++attempting, !CheatsAllowed(ent,i,argc,fr,true,false))) \
112 objerror(
this,
"Missing target. FAIL!");
126 objerror(
this,
"Too many info_autoscreenshot entitites. FAIL!");
144 case CHIMPULSE_SPEEDRUN_INIT.impulse:
169 case CHIMPULSE_CLONE_MOVING.impulse:
178 case CHIMPULSE_CLONE_STANDING.impulse:
184 case CHIMPULSE_GIVE_ALL.impulse:
188 case CHIMPULSE_SPEEDRUN.impulse:
197 sprint(
this,
"Cannot move there, cheater - only waypoints set using g_waypointsprite_personal work\n");
202 setorigin(
this, this.
personal.origin);
231 sprint(
this,
"UR DEAD AHAHAH))\n");
233 sprint(
this,
"No waypoint set, cheater (use g_waypointsprite_personal to set one)\n");
235 case CHIMPULSE_TELEPORT.impulse:
242 sprint(
this,
"Emergency teleport used info_autoscreenshot location\n");
243 setorigin(
this, e.origin);
255 sprint(
this,
"Emergency teleport used random location\n");
256 this.angles_x = -this.
angles.x;
262 sprint(
this,
"Emergency teleport could not find a good location, forget it!\n");
264 case CHIMPULSE_R00T.impulse:
273 Send_Effect(EFFECT_ROCKET_EXPLODE, e.origin,
'0 0 0', 1);
277 setorigin(e2, e.origin);
278 RadiusDamage(e2,
this, 1000, 0, 128,
NULL,
NULL, 500, DEATH_CHEAT.m_id,
DMG_NOWEP, e);
281 LOG_INFO(
"404 Sportsmanship not found.");
299 case "pointparticles":
312 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd pointparticles <effectname> <position> <velocity> <countmultiplier>\n");
313 sprint(
this,
" Where <position> is a number from 0 to 1 representing distance on the crosshair line,\n");
314 sprint(
this,
" and <velocity> is a vector \"x y z\"\n");
316 case "trailparticles":
322 effectnum = _particleeffectnum(
argv(1));
329 sprint(
this,
"Usage: sv_cheats 1; restart; cmd trailparticles <effectname>\n");
340 sprint(
this,
"cannot make stuff there (bad surface)\n");
344 entity e =
new(func_breakable);
346 e.mdl =
"rocket_explode";
359 tracebox(e.origin, e.mins, e.maxs, e.origin,
MOVE_NORMAL, e);
363 sprint(
this,
"cannot make stuff there (no space)\n");
374 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd make <modelname> <mode>\n");
375 sprint(
this,
" where <mode> can be 0, 1 or 2\n");
386 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd penalty <duration> <reason>))\n");
388 case "dragbox_spawn": {
390 entity e =
new(dragbox_box);
400 e.aiment =
new(dragbox_corner_1);
404 setsize(e.aiment,
'0 0 0',
'0 0 0');
413 e.enemy =
new(dragbox_corner_2);
417 setsize(e.enemy,
'0 0 0',
'0 0 0');
419 end.x = (end.x > 0) * 2 - 1;
420 end.y = (end.y > 0) * 2 - 1;
421 end.z = (end.z > 0) * 2 - 1;
425 setorigin(e.enemy, e.aiment.origin + 32 * end);
427 e.killindicator =
new(drag_digit);
428 e.killindicator.owner = e;
429 setattachment(e.killindicator, e,
"");
430 setorigin(e.killindicator,
'0 0 -8');
431 e.killindicator.killindicator =
new(drag_digit);
432 e.killindicator.killindicator.owner = e;
433 setattachment(e.killindicator.killindicator, e,
"");
434 setorigin(e.killindicator.killindicator,
'0 0 8');
438 case "dragpoint_spawn": {
440 entity e =
new(dragpoint);
445 setsize(e,
STAT(PL_MIN,
this),
STAT(PL_MAX,
this));
460 e.killindicator =
new(drag_digit);
461 e.killindicator.owner = e;
462 setattachment(e.killindicator, e,
"");
463 setorigin(e.killindicator,
'0 0 40');
464 e.killindicator.killindicator =
new(drag_digit);
465 e.killindicator.killindicator.owner = e;
466 setattachment(e.killindicator.killindicator, e,
"");
467 setorigin(e.killindicator.killindicator,
'0 0 56');
511 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd dragbox_setcnt <cnt>\n");
518 fputs(f,
"cmd drag_clear\n");
521 fputs(f,
strcat(
"cmd dragbox_spawn ",
ftos(e.cnt),
" \"",
vtos(e.aiment.origin),
"\" \"",
vtos(e.enemy.origin),
"\"\n"));
531 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd dragbox_save <filename>\n");
533 case "drag_saveraceent":
541 fputs(f,
"\"classname\" \"trigger_race_checkpoint\"\n");
543 fputs(f,
strcat(
"\"maxs\" \"",
ftos(e.absmax.x - e.absmin.x),
" ",
ftos(e.absmax.y - e.absmin.y),
" ",
ftos(e.absmax.z - e.absmin.z),
"\"\n"));
554 if((e.cnt <= 0 && ent.cnt == 0) || e.cnt == ent.cnt)
560 start *= 1 / effectnum;
562 fputs(f,
"\"classname\" \"info_player_race\"\n");
567 fputs(f,
"\"target\" \"checkpoint0\"\n");
568 fputs(f,
"\"race_place\" \"0\"\n");
572 fputs(f,
"\"target\" \"checkpoint0\"\n");
573 fputs(f,
"\"race_place\" \"-1\"\n");
586 if(
vlen2(ent.origin - start) <
vlen2(e.origin - start))
600 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd dragbox_save <filename>\n");
621 sprint(
this,
"godmode ON\n");
625 sprint(
this,
"godmode OFF\n");
632 sprint(
this,
"notarget ON\n");
636 sprint(
this,
"notarget OFF\n");
643 sprint(
this,
"noclip ON\n");
649 sprint(
this,
"noclip OFF\n");
657 sprint(
this,
"flymode ON\n");
663 sprint(
this,
"flymode OFF\n");
682 e2.killtarget =
argv(1);
687 case "teleporttotarget":
689 entity ent =
new(cheattriggerteleport);
690 setorigin(ent, ent.origin);
691 ent.target =
argv(1);
724 Drag(
this,
true,
true);
728 Drag(
this,
false,
false);
752float Drag(
entity this,
float force_allow_pick,
float ischeat)
770 CS(
this).impulse = 0;
775 CS(
this).impulse = 0;
798 float pick = force_allow_pick;
811 if(e.owner ==
this || e.realowner ==
this)
849 draggee.dragmovetype = draggee.move_movetype;
850 draggee.draggravity = draggee.gravity;
852 draggee.gravity = 0.00001;
854 draggee.draggedby = dragger;
856 dragger.dragentity = draggee;
858 dragger.dragdistance =
vlen(touchpoint - dragger.origin - dragger.view_ofs);
859 dragger.draglocalangle = draggee.angles.y - dragger.v_angle.y;
862 dragger.draglocalvector_x = touchpoint *
v_forward * tagscale;
863 dragger.draglocalvector_y = touchpoint *
v_right * tagscale;
864 dragger.draglocalvector_z = touchpoint *
v_up * tagscale;
866 dragger.dragspeed = 64;
871 entity draggee = dragger.dragentity;
873 dragger.dragentity =
NULL;
874 draggee.draggedby =
NULL;
876 draggee.gravity = draggee.draggravity;
878 switch(draggee.move_movetype)
889 draggee.velocity =
'0 0 0';
893 if((draggee.flags &
FL_ITEM) && (
vdist(draggee.velocity, <, 32)))
895 draggee.velocity =
'0 0 0';
912 if(draggee.classname ==
"door")
917 return ((draggee.draggable) ? draggee.draggable(draggee, dragger) :
true);
923 if(
substring(draggee.model, 0, 1) ==
"*")
930 dragger.dragdistance += dragger.dragspeed;
935 dragger.dragspeed = (2 ** s);
940 dragger.dragdistance =
max(0, dragger.dragdistance - dragger.dragspeed);
945 entity draggee = dragger.dragentity;
949 curorigin +=
v_forward * dragger.draglocalvector.x +
v_right * dragger.draglocalvector.y +
v_up * dragger.draglocalvector.z;
951 vector neworigin = dragger.origin + dragger.view_ofs +
v_forward * dragger.dragdistance;
954 while(draggee.angles.y - dragger.v_angle.y - dragger.draglocalangle > 180)
955 dragger.draglocalangle += 360;
956 while(draggee.angles.y - dragger.v_angle.y - dragger.draglocalangle <= -180)
957 dragger.draglocalangle -= 360;
960 draggee.velocity = draggee.velocity * (1 - f) + goodvelocity * f;
963 draggee.angles_y = draggee.angles.y * (1 - f) + (dragger.v_angle.y + dragger.draglocalangle) * f;
969 if(dragger.(weaponentity).movedir.x > 0)
970 vecs = dragger.(weaponentity).
movedir;
974 te_lightning1(draggee, dragger.origin + dragger.view_ofs + dv, curorigin);
984 if(!dragger.dragentity)
986 if(wasfreed(dragger.dragentity) || dragger.dragentity.draggedby != dragger)
988 dragger.dragentity =
NULL;
1003 to.draggedby = from.draggedby;
1004 to.draggedby.dragentity = to;
1005 from.draggedby =
NULL;
1013 this.origin_x = (this.
aiment.origin.x + this.
enemy.origin.x) * 0.5;
1014 this.origin_y = (this.
aiment.origin.y + this.
enemy.origin.y) * 0.5;
1015 this.origin_z = (this.
aiment.origin.z + this.
enemy.origin.z) * 0.5;
1016 this.maxs_x =
fabs(this.
aiment.origin.x -
this.enemy.origin.x) * 0.5;
1017 this.maxs_y =
fabs(this.
aiment.origin.y -
this.enemy.origin.y) * 0.5;
1018 this.maxs_z =
fabs(this.
aiment.origin.z -
this.enemy.origin.z) * 0.5;
1020 setorigin(
this, this.
origin);
1021 setsize(
this, this.
mins, this.
maxs);
1030 else if(this.
cnt == -2)
#define MUTATOR_CALLHOOK(id,...)
void func_breakable_setup(entity this)
#define END_CHEAT_FUNCTION()
float Drag_CanDrag(entity dragger)
void Drag_MoveBackward(entity dragger)
float CheatCommand(entity this, int argc)
void DragBox_Think(entity this)
void Drag_MoveDrag(entity from, entity to)
#define IS_CHEAT(ent, i, argc, fr)
#define BEGIN_CHEAT_FUNCTION()
float Drag(entity this, float force_allow_pick, float ischeat)
void info_autoscreenshot_findtarget(entity this)
void Drag_Finish(entity dragger)
float Drag_MayChangeAngles(entity draggee)
float CheatImpulse(entity this, int imp)
void Drag_Update(entity dragger)
void Drag_Begin(entity dragger, entity draggee, vector touchpoint)
float Drag_IsDraggable(entity draggee, entity dragger)
void Drag_SetSpeed(entity dragger, float s)
void Drag_MoveForward(entity dragger)
float CheatFrame(entity this)
bool drag_undraggable(entity draggee, entity dragger)
float CheatsAllowed(entity this, float imp, int argc, float cheatframe, bool logattempt, bool ignoredead)
float gamestart_sv_cheats
float Drag_IsDragging(entity dragger)
int autocvar_g_max_info_autoscreenshot
float autocvar_g_grab_range
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
#define setmodel(this, m)
#define PHYS_INPUT_BUTTON_DRAG(s)
string playername(string thename, int teamid, bool team_colorize)
void detach_sameorigin(entity e)
const int INITPRIO_FINDTARGET
const vector PL_CROUCH_MIN_CONST
const vector PL_CROUCH_MAX_CONST
float DPCONTENTS_DONOTENTER
float DPCONTENTS_PLAYERCLIP
float trace_dphitq3surfaceflags
float Q3SURFACEFLAG_NOIMPACT
vector trace_plane_normal
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void SUB_UseTargets(entity this, entity actor, entity trigger)
#define move_out_of_solid(e)
#define BITXOR_ASSIGN(a, b)
void set_movetype(entity this, int mt)
const int MOVETYPE_FLYMISSILE
const int MOVETYPE_BOUNCEMISSILE
#define UNSET_ONGROUND(s)
const int MOVETYPE_PHYSICS
const int MOVETYPE_NOCLIP
const int MOVETYPE_BOUNCE
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
IntrusiveList g_observepoints
float pauserotfuel_finished
float pauseregen_finished
float pauserothealth_finished
float pauserotarmor_finished
float GiveItems(entity e, float beginarg, float endarg)
void CopyBody(entity this, float keepvelocity)
void race_ImposePenaltyTime(entity pl, float penalty, string reason)
bool autocvar_g_allow_checkpoints
#define sound(e, c, s, v, a)
ClientState CS(Client this)
void StatusEffects_copy(StatusEffect this, entity store, float time_offset)
StatusEffect statuseffects
Entity statuseffects.
void StatusEffects_update(entity e)
Header file that describes the resource system.
void teleport_findtarget(entity this)
entity Simple_TeleportPlayer(entity teleporter, entity player)
void crosshair_trace(entity pl)
void crosshair_trace_plusvisibletriggers(entity pl)
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
#define FOREACH_CLIENT(cond, body)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
entity weaponentities[MAX_WEAPONSLOTS]
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
void InitializeEntity(entity e, void(entity this) func, int order)