case 33:
if(self.deadflag == DEAD_NO && teamplay)
{
- wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0');
- if(!wp)
- WaypointSprite_HelpMePing(self.waypointsprite_attachedforcarrier);
- else
- WaypointSprite_Ping(wp);
+ if not(MUTATOR_CALLHOOK(HelpMePing))
+ {
+ wp = WaypointSprite_Attach("helpme", TRUE, RADARICON_HELPME, '1 0.5 0');
+ if(!wp)
+ WaypointSprite_HelpMePing(self.waypointsprite_attachedforcarrier);
+ else
+ WaypointSprite_Ping(wp);
+ }
sprint(self, "HELP ME attached\n");
}
break;
MUTATOR_HOOKABLE(PortalTeleport);
// called whenever a player goes through a portal gun teleport
// allows you to strip a player of an item if they go through the teleporter to help prevent cheating
- entity self;
\ No newline at end of file
+ // INPUT
+ entity self;
+
+MUTATOR_HOOKABLE(HelpMePing);
+ // called whenever a player uses impulse 33 (help me) in cl_impulse.qc
+ // normally help me ping uses self.waypointsprite_attachedforcarrier,
+ // but if your mutator uses something different then you can handle it
+ // in a special manner using this hook
+ // INPUT
+ entity self; // the player who pressed impulse 33
\ No newline at end of file
return 0;
}
+MUTATOR_HOOKFUNCTION(ctf_HelpMePing)
+{
+ if(self.wps_flagcarrier)
+ {
+ WaypointSprite_HelpMePing(self.wps_flagcarrier);
+ }
+ else
+ {
+ WaypointSprite_Spawn("helpme", waypointsprite_deployed_lifetime, waypointsprite_limitedrange, self, FLAG_WAYPOINT_OFFSET, world, self.team, self, wps_helpme, FALSE, RADARICON_HELPME, '1 0.5 0');
+ WaypointSprite_Ping(self.wps_helpme);
+ }
+
+ return 1;
+}
+
+
// ==========
// Spawnfuncs
// ==========
MUTATOR_HOOK(PlayerPreThink, ctf_PlayerPreThink, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerDamage_Calculate, ctf_PlayerDamage, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerUseKey, ctf_PlayerUseKey, CBC_ORDER_ANY);
+ MUTATOR_HOOK(HelpMePing, ctf_HelpMePing, CBC_ORDER_ANY);
MUTATOR_ONADD
{
// waypoint sprites
.entity bot_basewaypoint; // flag waypointsprite
+.entity wps_helpme;
.entity wps_flagbase;
.entity wps_flagcarrier;
.entity wps_flagdropped;