3 // can't use the autocvar as it doesn't work in the campaign
4 //AUTOCVAR(g_grappling_hook, bool, false, "let players spawn with the grappling hook which allows them to pull themselves up");
6 REGISTER_MUTATOR(hook, cvar("g_grappling_hook")) {
8 g_grappling_hook = true;
9 WEP_HOOK.ammo_factor = 0;
11 MUTATOR_ONROLLBACK_OR_REMOVE {
12 g_grappling_hook = false;
13 WEP_HOOK.ammo_factor = 1;
19 MUTATOR_HOOKFUNCTION(hook, BuildMutatorsString)
21 M_ARGV(0, string) = strcat(M_ARGV(0, string), ":grappling_hook");
24 MUTATOR_HOOKFUNCTION(hook, BuildMutatorsPrettyString)
26 M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Hook");
29 MUTATOR_HOOKFUNCTION(hook, BuildGameplayTipsString)
31 M_ARGV(0, string) = strcat(M_ARGV(0, string), "\n\n^3grappling hook^8 is enabled, press 'e' to use it\n");
34 MUTATOR_HOOKFUNCTION(hook, PlayerSpawn)
36 entity player = M_ARGV(0, entity);
38 player.offhand = OFFHAND_HOOK;
41 MUTATOR_HOOKFUNCTION(hook, FilterItem)
43 entity item = M_ARGV(0, entity);
45 return item.weapon == WEP_HOOK.m_id;