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 waypoint_personal_here work\n");
202 setorigin(
this, this.
personal.origin);
231 sprint(
this,
"UR DEAD AHAHAH))\n");
233 sprint(
this,
"No waypoint set, cheater (use waypoint_personal_here 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":
320 effectnum = _particleeffectnum(
argv(1));
327 sprint(
this,
"Usage:^3 [sv_cheats 1; restart;] cmd trailparticles <effectname>\n");
338 sprint(
this,
"cannot make stuff there (bad surface)\n");
341 entity e =
new(func_breakable);
343 e.mdl =
"rocket_explode";
360 sprint(
this,
"cannot make stuff there (no space)\n");
371 sprint(
this,
"Usage:^3 [sv_cheats 1; restart;] cmd make <modelname> <mode>\n");
372 sprint(
this,
" where <mode> can be 0, 1 or 2\n");
383 sprint(
this,
"Usage:^3 [sv_cheats 1; restart;] cmd penalty <duration> <reason>\n");
385 case "dragbox_spawn": {
387 entity e =
new(dragbox_box);
397 e.aiment =
new(dragbox_corner_1);
401 setsize(e.aiment,
'0 0 0',
'0 0 0');
412 e.enemy =
new(dragbox_corner_2);
416 setsize(e.enemy,
'0 0 0',
'0 0 0');
417 end =
normalize(view_org - e.aiment.origin);
418 end.x = (end.x > 0) * 2 - 1;
419 end.y = (end.y > 0) * 2 - 1;
420 end.z = (end.z > 0) * 2 - 1;
424 setorigin(e.enemy, e.aiment.origin + 32 * end);
426 e.killindicator =
new(drag_digit);
427 e.killindicator.owner = e;
428 setattachment(e.killindicator, e,
"");
429 setorigin(e.killindicator,
'0 0 -8');
430 e.killindicator.killindicator =
new(drag_digit);
431 e.killindicator.killindicator.owner = e;
432 setattachment(e.killindicator.killindicator, e,
"");
433 setorigin(e.killindicator.killindicator,
'0 0 8');
437 case "dragpoint_spawn": {
439 entity e =
new(dragpoint);
444 setsize(e,
STAT(PL_MIN,
this),
STAT(PL_MAX,
this));
459 e.killindicator =
new(drag_digit);
460 e.killindicator.owner = e;
461 setattachment(e.killindicator, e,
"");
462 setorigin(e.killindicator,
'0 0 40');
463 e.killindicator.killindicator =
new(drag_digit);
464 e.killindicator.killindicator.owner = e;
465 setattachment(e.killindicator.killindicator, e,
"");
466 setorigin(e.killindicator.killindicator,
'0 0 56');
512 sprint(
this,
"Usage:^3 [sv_cheats 1; restart;] cmd dragbox_setcnt <cnt>\n");
519 fputs(f,
"cmd drag_clear\n");
522 fputs(f,
strcat(
"cmd dragbox_spawn ",
ftos(e.cnt),
" \"",
vtos(e.aiment.origin),
"\" \"",
vtos(e.enemy.origin),
"\"\n"));
532 sprint(
this,
"Usage:^3 [sv_cheats 1; restart;] cmd dragbox_save <filename>\n");
534 case "drag_saveraceent":
542 fputs(f,
"\"classname\" \"trigger_race_checkpoint\"\n");
544 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"));
555 if((e.cnt <= 0 && ent.cnt == 0) || e.cnt == ent.cnt)
561 start *= 1 / effectnum;
563 fputs(f,
"\"classname\" \"info_player_race\"\n");
568 fputs(f,
"\"target\" \"checkpoint0\"\n");
569 fputs(f,
"\"race_place\" \"0\"\n");
573 fputs(f,
"\"target\" \"checkpoint0\"\n");
574 fputs(f,
"\"race_place\" \"-1\"\n");
587 if(
vlen2(ent.origin - start) <
vlen2(e.origin - start))
601 sprint(
this,
"Usage:^3 [sv_cheats 1; restart;] cmd dragbox_save <filename>\n");
622 sprint(
this,
"godmode ON\n");
626 sprint(
this,
"godmode OFF\n");
633 sprint(
this,
"notarget ON\n");
637 sprint(
this,
"notarget OFF\n");
644 sprint(
this,
"noclip ON\n");
650 sprint(
this,
"noclip OFF\n");
658 sprint(
this,
"flymode ON\n");
664 sprint(
this,
"flymode OFF\n");
683 e2.killtarget =
argv(1);
688 case "teleporttotarget":
690 entity ent =
new(cheattriggerteleport);
691 setorigin(ent, ent.origin);
692 ent.target =
argv(1);
725 Drag(
this,
true,
true);
729 Drag(
this,
false,
false);
753float Drag(
entity this,
float force_allow_pick,
float ischeat)
771 CS(
this).impulse = 0;
776 CS(
this).impulse = 0;
799 float pick = force_allow_pick;
812 if(e.owner ==
this || e.realowner ==
this)
850 draggee.dragmovetype = draggee.move_movetype;
851 draggee.draggravity = draggee.gravity;
853 draggee.gravity = 0.00001;
855 draggee.draggedby = dragger;
857 dragger.dragentity = draggee;
859 dragger.dragdistance =
vlen(touchpoint - dragger.origin - dragger.view_ofs);
860 dragger.draglocalangle = draggee.angles.y - dragger.v_angle.y;
863 dragger.draglocalvector_x = touchpoint *
v_forward * tagscale;
864 dragger.draglocalvector_y = touchpoint *
v_right * tagscale;
865 dragger.draglocalvector_z = touchpoint *
v_up * tagscale;
867 dragger.dragspeed = 64;
872 entity draggee = dragger.dragentity;
874 dragger.dragentity =
NULL;
875 draggee.draggedby =
NULL;
877 draggee.gravity = draggee.draggravity;
879 switch(draggee.move_movetype)
890 draggee.velocity =
'0 0 0';
894 if((draggee.flags &
FL_ITEM) && (
vdist(draggee.velocity, <, 32)))
896 draggee.velocity =
'0 0 0';
913 if(draggee.classname ==
"door")
918 return ((draggee.draggable) ? draggee.draggable(draggee, dragger) :
true);
924 if(
substring(draggee.model, 0, 1) ==
"*")
931 dragger.dragdistance += dragger.dragspeed;
936 dragger.dragspeed = (2 ** s);
941 dragger.dragdistance =
max(0, dragger.dragdistance - dragger.dragspeed);
946 entity draggee = dragger.dragentity;
950 curorigin +=
v_forward * dragger.draglocalvector.x +
v_right * dragger.draglocalvector.y +
v_up * dragger.draglocalvector.z;
952 vector neworigin = dragger.origin + dragger.view_ofs +
v_forward * dragger.dragdistance;
955 while(draggee.angles.y - dragger.v_angle.y - dragger.draglocalangle > 180)
956 dragger.draglocalangle += 360;
957 while(draggee.angles.y - dragger.v_angle.y - dragger.draglocalangle <= -180)
958 dragger.draglocalangle -= 360;
961 draggee.velocity = draggee.velocity * (1 - f) + goodvelocity * f;
964 draggee.angles_y = draggee.angles.y * (1 - f) + (dragger.v_angle.y + dragger.draglocalangle) * f;
970 if(dragger.(weaponentity).movedir.x > 0)
971 vecs = dragger.(weaponentity).
movedir;
975 te_lightning1(draggee, dragger.origin + dragger.view_ofs + dv, curorigin);
985 if(!dragger.dragentity)
987 if(wasfreed(dragger.dragentity) || dragger.dragentity.draggedby != dragger)
989 dragger.dragentity =
NULL;
1004 to.draggedby = from.draggedby;
1005 to.draggedby.dragentity = to;
1006 from.draggedby =
NULL;
1014 this.origin_x = (this.
aiment.origin.x + this.
enemy.origin.x) * 0.5;
1015 this.origin_y = (this.
aiment.origin.y + this.
enemy.origin.y) * 0.5;
1016 this.origin_z = (this.
aiment.origin.z + this.
enemy.origin.z) * 0.5;
1017 this.maxs_x =
fabs(this.
aiment.origin.x -
this.enemy.origin.x) * 0.5;
1018 this.maxs_y =
fabs(this.
aiment.origin.y -
this.enemy.origin.y) * 0.5;
1019 this.maxs_z =
fabs(this.
aiment.origin.z -
this.enemy.origin.z) * 0.5;
1021 setorigin(
this, this.
origin);
1022 setsize(
this, this.
mins, this.
maxs);
1031 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.
#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
const float MOVE_NOMONSTERS
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)
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void SUB_UseTargets(entity this, entity actor, entity trigger)
vector WarpZone_TransformOrigin(entity wz, vector org)
Transforms origin org across warpzone wz.
void WarpZone_TrailParticles(entity own, float eff, vector org, vector end)
#define WarpZone_TraceLine(org, end, nomonsters, forent)
entity WarpZone_trace_transform
Transform accumulator during a trace.
#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)
void WarpZone_crosshair_trace(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)