#include maps\mp\gametypes\_hud_util; // Script to enable C4/Claymore pickup // |FwG|Woody init() { level thread handleConnect(); precacheShader("hud_icon_claymore"); precacheShader("hud_icon_c4"); } createHudElements() { self.c4claymoreText = createFontString( "default", 1.2 ); // Press [{Button}] to pickup... self.c4claymoreText setPoint( "CENTER", undefined, 0, 125 ); self.weapIcons = []; self.weapIcons["c4"] = createIcon( "hud_icon_c4", 20, 20 ); // show the specific icon self.weapIcons["c4"] setPoint( "CENTER", undefined, 0, 19 ); self.weapIcons["c4"] setparent( self.c4claymoreText ); self.weapIcons["c4"].alpha = 0; self.weapIcons["claymore"] = createIcon( "hud_icon_claymore", 20, 20 ); // show the specific icon self.weapIcons["claymore"] setPoint( "CENTER", undefined, 0, 19 ); self.weapIcons["claymore"] setparent( self.c4claymoreText ); self.weapIcons["claymore"].alpha = 0; self waittill( "death" ); self.c4claymoreText destroy(); self.weapIcons["c4"] destroy(); self.weapIcons["claymore"] destroy(); } handleConnect() // Setting new handler for incoming players { for(;;) { level waittill( "connected", player ); player thread handleSpawn(); } } handleSpawn() { self endon("disconnect"); for(;;) { self waittill("spawned_player"); self thread createHudElements(); self thread watchEquipmentPickup(); } } watchEquipmentPickup() { self endon("death"); for(;;) { self waittill("grenade_fire", grenade, weaponName); if(weaponName == "c4_mp" || weaponName == "claymore_mp") grenade thread monitorPickup( self, weaponName); } } monitorPickup( owner, weaponName) { self endon("death"); weaponBase = strtok(weaponName, "_"); self thread monitorEquipmentDeath( owner ); if (weaponBase[0] == "c4") { weaponRealName = "C4"; wait .2; // so you can not instantly pick it up after throwing it } else weaponRealName = "Claymore"; for(;;) { if ( Distance(self.origin, owner getTagOrigin("j_head")) <= 70 ) { owner.c4claymoreText setText( "Press ^3[{+activate}]^7 to pick up ^3" + weaponRealName ); owner.c4claymoreText.alpha = 1; owner.weapIcons[weaponBase[0]].alpha = 1; if (owner usebuttonpressed()) { owner giveMaxAmmo( weaponBase[0] + "_mp" ); owner playLocalSound( "scavenger_pack_pickup" ); owner.c4claymoreText.alpha = 0; owner.weapIcons["c4"].alpha = 0; owner.weapIcons["claymore"].alpha = 0; self delete(); } } else { owner.c4claymoreText.alpha = 0; owner.weapIcons["c4"].alpha = 0; owner.weapIcons["claymore"].alpha = 0; } wait .1; } } monitorEquipmentDeath( owner ) { self waittill("death"); owner.c4claymoreText.alpha = 0; owner.weapIcons["c4"].alpha = 0; owner.weapIcons["claymore"].alpha = 0; }