64 if(i == CHIMPULSE_CLONE_MOVING.impulse || i == CHIMPULSE_CLONE_STANDING.impulse)
77 bprintf(
"Player %s^7 tried to use cheat 'impulse %d'\n", playername(this.
netname, this.
team,
false), i);
81 bprintf(
"Player %s^7 tried to use cheat frame %d\n", playername(this.
netname, this.
team,
false), fr);
83 bprintf(
"Player %s^7 tried to use an unknown cheat\n", playername(this.
netname, this.
team,
false));
88 #define BEGIN_CHEAT_FUNCTION() \ 89 float cheating = 0, attempting = 0 92 #define ADD_CHEATS(e,n) \ 93 cheatcount_total += n; \ 95 #define END_CHEAT_FUNCTION() \ 96 ADD_CHEATS(this, cheating); \ 98 #define IS_CHEAT(ent,i,argc,fr) \ 99 if((++attempting, !CheatsAllowed(ent,i,argc,fr))) \ 109 objerror(
this,
"Missing target. FAIL!");
123 objerror(
this,
"Too many info_autoscreenshot entitites. FAIL!");
137 case CHIMPULSE_SPEEDRUN_INIT.impulse:
154 STAT(WEAPONS, this.
personal) = STAT(WEAPONS,
this);
155 StatusEffects_copy(this.statuseffects, this.
personal, 0);
163 case CHIMPULSE_CLONE_MOVING.impulse:
172 case CHIMPULSE_CLONE_STANDING.impulse:
178 case CHIMPULSE_GIVE_ALL.impulse:
182 case CHIMPULSE_SPEEDRUN.impulse:
191 sprint(
this,
"Cannot move there, cheater - only waypoints set using g_waypointsprite_personal work\n");
212 STAT(WEAPONS,
this) = STAT(WEAPONS, this.
personal);
218 StatusEffects_copy(this.
personal, this.statuseffects, this.
personal.teleport_time);
219 StatusEffects_update(
this);
226 sprint(
this,
"UR DEAD AHAHAH))\n");
228 sprint(
this,
"No waypoint set, cheater (use g_waypointsprite_personal to set one)\n");
230 case CHIMPULSE_TELEPORT.impulse:
237 sprint(
this,
"Emergency teleport used info_autoscreenshot location\n");
250 sprint(
this,
"Emergency teleport used random location\n");
251 this.angles_x = -this.
angles.x;
257 sprint(
this,
"Emergency teleport could not find a good location, forget it!\n");
259 case CHIMPULSE_R00T.impulse:
268 Send_Effect(EFFECT_ROCKET_EXPLODE, e.origin,
'0 0 0', 1);
273 RadiusDamage(e2,
this, 1000, 0, 128,
NULL,
NULL, 500, DEATH_CHEAT.m_id,
DMG_NOWEP, e);
276 LOG_INFO(
"404 Sportsmanship not found.");
295 case "pointparticles":
304 Send_Effect_(
argv(1), start, end, f);
308 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd pointparticles <effectname> <position> <velocity> <countmultiplier>\n");
309 sprint(
this,
" Where <position> is a number from 0 to 1 representing distance on the crosshair line,\n");
310 sprint(
this,
" and <velocity> is a vector \"x y z\"\n");
312 case "trailparticles":
318 effectnum = _particleeffectnum(
argv(1));
325 sprint(
this,
"Usage: sv_cheats 1; restart; cmd trailparticles <effectname>\n");
336 sprint(
this,
"cannot make stuff there (bad surface)\n");
340 entity e =
new(func_breakable);
342 e.mdl =
"rocket_explode";
351 func_breakable_setup(e);
355 tracebox(e.origin, e.mins, e.maxs, e.origin,
MOVE_NORMAL, e);
359 sprint(
this,
"cannot make stuff there (no space)\n");
370 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd make <modelname> <mode>\n");
371 sprint(
this,
" where <mode> can be 0, 1 or 2\n");
382 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd penalty <duration> <reason>))\n");
384 case "dragbox_spawn": {
386 entity e =
new(dragbox_box);
396 e.aiment =
new(dragbox_corner_1);
400 setsize(e.aiment,
'0 0 0',
'0 0 0');
409 e.enemy =
new(dragbox_corner_2);
413 setsize(e.enemy,
'0 0 0',
'0 0 0');
415 end.x = (end.x > 0) * 2 - 1;
416 end.y = (end.y > 0) * 2 - 1;
417 end.z = (end.z > 0) * 2 - 1;
421 setorigin(e.enemy, e.aiment.origin + 32 * end);
423 e.killindicator =
new(drag_digit);
424 e.killindicator.owner = e;
425 setattachment(e.killindicator, e,
"");
427 e.killindicator.killindicator =
new(drag_digit);
428 e.killindicator.killindicator.owner = e;
429 setattachment(e.killindicator.killindicator, e,
"");
430 setorigin(e.killindicator.killindicator,
'0 0 8');
434 case "dragpoint_spawn": {
436 entity e =
new(dragpoint);
441 setsize(e, STAT(PL_MIN,
this), STAT(PL_MAX,
this));
456 e.killindicator =
new(drag_digit);
457 e.killindicator.owner = e;
458 setattachment(e.killindicator, e,
"");
460 e.killindicator.killindicator =
new(drag_digit);
461 e.killindicator.killindicator.owner = e;
462 setattachment(e.killindicator.killindicator, e,
"");
463 setorigin(e.killindicator.killindicator,
'0 0 56');
507 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd dragbox_setcnt <cnt>\n");
514 fputs(f,
"cmd drag_clear\n");
517 fputs(f,
strcat(
"cmd dragbox_spawn ",
ftos(e.cnt),
" \"",
vtos(e.aiment.origin),
"\" \"",
vtos(e.enemy.origin),
"\"\n"));
527 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd dragbox_save <filename>\n");
529 case "drag_saveraceent":
537 fputs(f,
"\"classname\" \"trigger_race_checkpoint\"\n");
539 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"));
550 if((e.cnt <= 0 && ent.cnt == 0) || e.cnt == ent.cnt)
552 start = start + ent.origin;
556 start *= 1 / effectnum;
558 fputs(f,
"\"classname\" \"info_player_race\"\n");
563 fputs(f,
"\"target\" \"checkpoint0\"\n");
564 fputs(f,
"\"race_place\" \"0\"\n");
568 fputs(f,
"\"target\" \"checkpoint0\"\n");
569 fputs(f,
"\"race_place\" \"-1\"\n");
582 if(
vlen2(ent.origin - start) <
vlen2(e.origin - start))
596 sprint(
this,
"Usage:^3 sv_cheats 1; restart; cmd dragbox_save <filename>\n");
617 sprint(
this,
"godmode ON\n");
621 sprint(
this,
"godmode OFF\n");
628 sprint(
this,
"notarget ON\n");
632 sprint(
this,
"notarget OFF\n");
639 sprint(
this,
"noclip ON\n");
645 sprint(
this,
"noclip OFF\n");
653 sprint(
this,
"flymode ON\n");
659 sprint(
this,
"flymode OFF\n");
678 e2.killtarget =
argv(1);
683 case "teleporttotarget":
685 entity ent =
new(cheattriggerteleport);
687 ent.target =
argv(1);
720 Drag(
this,
true,
true);
724 Drag(
this,
false,
false);
748 float Drag(
entity this,
float force_allow_pick,
float ischeat)
766 CS(
this).impulse = 0;
771 CS(
this).impulse = 0;
794 float pick = force_allow_pick;
807 if(e.owner ==
this || e.realowner ==
this)
829 detach_sameorigin(e);
845 draggee.dragmovetype = draggee.move_movetype;
846 draggee.draggravity = draggee.gravity;
848 draggee.gravity = 0.00001;
850 draggee.draggedby = dragger;
852 dragger.dragentity = draggee;
854 dragger.dragdistance =
vlen(touchpoint - dragger.origin - dragger.view_ofs);
855 dragger.draglocalangle = draggee.angles.y - dragger.v_angle.y;
856 touchpoint = touchpoint -
gettaginfo(draggee, 0);
858 dragger.draglocalvector_x = touchpoint *
v_forward * tagscale;
859 dragger.draglocalvector_y = touchpoint *
v_right * tagscale;
860 dragger.draglocalvector_z = touchpoint *
v_up * tagscale;
862 dragger.dragspeed = 64;
868 draggee = dragger.dragentity;
870 dragger.dragentity =
NULL;
871 draggee.draggedby =
NULL;
873 draggee.gravity = draggee.draggravity;
875 switch(draggee.move_movetype)
886 draggee.velocity =
'0 0 0';
890 if((draggee.flags &
FL_ITEM) && (
vdist(draggee.velocity, <, 32)))
892 draggee.velocity =
'0 0 0';
909 if(draggee.classname ==
"door")
914 return ((draggee.draggable) ? draggee.draggable(draggee, dragger) :
true);
920 if(
substring(draggee.model, 0, 1) ==
"*")
927 dragger.dragdistance += dragger.dragspeed;
932 dragger.dragspeed = (2 ** s);
937 dragger.dragdistance =
max(0, dragger.dragdistance - dragger.dragspeed);
942 vector curorigin, neworigin, goodvelocity;
946 draggee = dragger.dragentity;
950 curorigin = curorigin +
v_forward * dragger.draglocalvector.x +
v_right * dragger.draglocalvector.y +
v_up * dragger.draglocalvector.z;
952 neworigin = dragger.origin + dragger.view_ofs +
v_forward * dragger.dragdistance;
953 goodvelocity = (neworigin - curorigin) * (1 /
frametime);
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;
1022 setsize(
this, this.
mins, this.
maxs);
1031 else if(this.
cnt == -2)
void Drag_Finish(entity dragger)
#define PHYS_INPUT_BUTTON_DRAG(s)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
void teleport_findtarget(entity this)
float trace_dphitq3surfaceflags
const float MOVETYPE_PHYSICS
Header file that describes the resource system.
ERASEABLE void RandomSelection_Init()
float CheatImpulse(entity this, int imp)
int autocvar_g_max_info_autoscreenshot
ClientState CS(Client this)
#define FOREACH_CLIENT(cond, body)
float MOVETYPE_BOUNCEMISSILE
void SUB_UseTargets(entity this, entity actor, entity trigger)
float CheatsAllowed(entity this, float i, int argc, float fr)
spawnfunc(info_autoscreenshot)
void Drag_MoveForward(entity dragger)
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
float DPCONTENTS_PLAYERCLIP
#define UNSET_ONGROUND(s)
#define move_out_of_solid(e)
float Drag_MayChangeAngles(entity draggee)
#define BEGIN_CHEAT_FUNCTION()
void Drag_MoveBackward(entity dragger)
void race_ImposePenaltyTime(entity pl, float penalty, string reason)
void crosshair_trace(entity pl)
#define setmodel(this, m)
float Drag_IsDraggable(entity draggee, entity dragger)
#define RandomSelection_AddEnt(e, weight, priority)
#define END_CHEAT_FUNCTION()
void Drag_SetSpeed(entity dragger, float s)
void DragBox_Think(entity this)
entity Simple_TeleportPlayer(entity teleporter, entity player)
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
bool autocvar_g_allow_checkpoints
float gamestart_sv_cheats
float pauserothealth_finished
entity RandomSelection_chosen_ent
float CheatFrame(entity this)
float pauserotfuel_finished
float pauserotarmor_finished
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
float Q3SURFACEFLAG_NOIMPACT
void Drag_Update(entity dragger)
float Drag_CanDrag(entity dragger)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float MOVETYPE_FLYMISSILE
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
void InitializeEntity(entity e, void(entity this) func, int order)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
float autocvar_g_grab_range
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
#define MUTATOR_CALLHOOK(id,...)
bool drag_undraggable(entity draggee, entity dragger)
entity weaponentities[MAX_WEAPONSLOTS]
float pauseregen_finished
vector trace_plane_normal
float GiveItems(entity e, float beginarg, float endarg)
#define IS_CHEAT(ent, i, argc, fr)
void crosshair_trace_plusvisibletriggers(entity pl)
void Drag_MoveDrag(entity from, entity to)
#define sound(e, c, s, v, a)
#define BITXOR_ASSIGN(a, b)
float CheatCommand(entity this, int argc)
void CopyBody(entity this, float keepvelocity)
float DPCONTENTS_DONOTENTER
float Drag_IsDragging(entity dragger)
void set_movetype(entity this, int mt)
void info_autoscreenshot_findtarget(entity this)
void Drag_Begin(entity dragger, entity draggee, vector touchpoint)
float Drag(entity this, float force_allow_pick, float ischeat)