// other aliases
alias +hook +button6
alias -hook -button6
+alias use "impulse 21"
alias ready "cmd ready"
alias lockteams "sv_cmd lockteams"
alias unlockteams "sv_cmd unlockteams"
bind r reload
bind BACKSPACE dropweapon
bind g dropweapon
-bind f +use
+bind f use
// misc
bind e +hook
seta "userbind12_press" "say_team killed flagcarrier (l:%y^7); g_waypointsprite_team_p"; seta "userbind12_release" ""; seta "userbind12_description" "team: killed flag, icon"
seta "userbind13_press" "say_team dropped flag (l:%d^7); g_waypointsprite_team_here_d"; seta "userbind13_release" ""; seta "userbind13_description" "team: dropped flag, icon"
seta "userbind14_press" "say_team dropped gun %w^7 (l:%l^7); g_waypointsprite_team_here; wait; dropweapon"; seta "userbind14_release" ""; seta "userbind14_description" "team: drop gun, icon"
-seta "userbind15_press" "say_team dropped flag/key %w^7 (l:%l^7); g_waypointsprite_team_here; wait; +use"; seta "userbind15_release" "-use"; seta "userbind15_description" "team: drop flag/key, icon"
+seta "userbind15_press" "say_team dropped flag/key %w^7 (l:%l^7); g_waypointsprite_team_here; wait; use"; seta "userbind15_release" ""; seta "userbind15_description" "team: drop flag/key, icon"
seta "userbind16_press" "say :-) / nice one"; seta "userbind16_release" ""; seta "userbind16_description" "chat: nice one"
seta "userbind17_press" "say good game"; seta "userbind17_release" ""; seta "userbind17_description" "chat: good game"
seta "userbind18_press" "say hi / good luck and have fun"; seta "userbind18_release" ""; seta "userbind18_description" "chat: hi / good luck"
self.flags |= FL_CLIENT | FL_NOTARGET;
}
+float ctf_usekey();
+void PlayerUseKey()
+{
+ if(self.classname != "player")
+ return;
+
+ // a use key was pressed; call handlers
+ if(ctf_usekey())
+ return;
+}
+
.float touchexplode_time;
/*
Called every frame for each client before the physics are run
=============
*/
+.float usekeypressed;
void() ctf_setstatus;
void() nexball_setstatus;
.float items_added;
MUTATOR_CALLHOOK(PlayerPreThink);
+ if(self.BUTTON_USE && !self.usekeypressed)
+ PlayerUseKey();
+ self.usekeypressed = self.BUTTON_USE;
+
if(self.classname == "player") {
// if(self.netname == "Wazat")
// bprint(self.classname, "\n");
else
self.impulse = imp; // retry in next frame
}
+ else if(imp == 21)
+ {
+ PlayerUseKey ();
+ }
else if(imp >= 200 && imp <= 229)
{
if(self.deadflag == DEAD_NO)
DropFlag(self, world, world);
return;
}
-
- if(autocvar_g_ctf_allow_drop)
- if(e.BUTTON_USE)
- DropFlag(self, e, world);
};
+float ctf_usekey()
+{
+ if(self.flagcarried)
+ {
+ DropFlag(self.flagcarried, self, world);
+ return TRUE;
+ }
+ return FALSE;
+}
+
void flag_cap_ring_spawn(vector org)
{
shockwave_spawn("models/ctf/shockwavetransring.md3", org - '0 0 15', -0.8, 0, 1);
.entity muzzle_flash;
.float misc_bulletcounter; // replaces uzi & hlac bullet counter.
+
+void PlayerUseKey();