Day of Defeat Plugins Community
This site is an archive — everything is readable and downloadable, nothing can be posted. Admin
Archive › Old Forum Threads › Help › Scripting Help › removing/change weapon-entity from map
5 posts, 2 people · 822 views Thread Rating: ★★★★★
closedremoving/change weapon-entity from map
Started by ghzero on 02-25-2009, 08:34 PM
ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
02-25-2009, 08:34 PM #1

hello,rnhow to remove an entity that gives an weapon to the map, so anybody player can get that. I'd like to remove the entities that give an MG42 to player from the the map. maybe it's posible to change to given weapon by the entity to another weapon instead of removing the entity??

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
02-25-2009, 08:40 PM #2

how about...... mp_limitaxismg42 0 ?? :D

ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
02-26-2009, 06:12 AM #3

that dont help against players that found an MG42 on a map that is placed in map by the mapper.rnI'd like to remove that weapon-give-entities from map automatic by amxmodx-plugin so that only the choosen class can give you an MG42.

Dr.G
posted here
Posts: 776
Threads: 75
Joined: Nov 2007
02-26-2009, 01:02 PM #4

Something like this UNTESTED tho:rnrn

/* Plugin generated by AMXX-Studio */rn////////////////////////////////////////////////////////////////////////////////////////////////////rn#include <amxmodx>rn#include <amxmisc>rn#include <dodx>rn#include <fakemeta_util>rn#include <hamsandwich>rn////////////////////////////////////////////////////////////////////////////////////////////////////rn#define PLUGIN "DoD Strip Heavy Weapons"rn#define VERSION "v1.0 by Dr.G"rn#define AUTHOR "Dr.G"rn////////////////////////////////////////////////////////////////////////////////////////////////////rnnew p_onrn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic plugin_init() rn{rn	register_plugin(PLUGIN, VERSION, AUTHOR)rn	register_cvar("dod_strip_heavy_wpns",VERSION,FCVAR_SERVER|FCVAR_SPONLY)rn	rn	/* on / off */rn	p_on = register_cvar("dod_strip_heavy","1")rn	rn	/* current wpn */rn	register_event("CurWeapon", "current_wpn", "be", "1=1")rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic current_wpn(id) rn{ rn	if(get_pcvar_num(p_on) && is_wpn_heavy(id))rn	{rn		ham_strip_weapon(id, get_pdata_cbase(id, 273))rn		set_task(1.0,"give_wpn",id)rn	}rn	return HAM_SUPERCEDErn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnpublic give_wpn(id)rn{rn	switch(random_num(1,5))rn	{rn		case 1: rn		{rn			fm_give_item(id,"weapon_mp40")rn			return FMRES_SUPERCEDErn		}rn		case 2:rn		{rn			fm_give_item(id,"weapon_enfield")rn			return FMRES_SUPERCEDE	rn		}rn		case 3:rn		{rn			fm_give_item(id,"weapon_sten")rn			return FMRES_SUPERCEDE	rn		}rn		case 4:rn		{rn			fm_give_item(id,"weapon_thompson")rn			return FMRES_SUPERCEDE	rn		}rn		case 5:rn		{rn			fm_give_item(id,"weapon_bar")rn			return FMRES_SUPERCEDE	rn		}rn	}rn	return FMRES_SUPERCEDErn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rn// by arkshinernstock ham_strip_weapon( const id, const WeapIndex)rn{rn	ExecuteHamB( Ham_Weapon_RetireWeapon, WeapIndex)rn	ExecuteHamB( Ham_RemovePlayerItem, id, WeapIndex)rn	ExecuteHamB( Ham_Item_Kill, WeapIndex)rn	rn	set_pev( id, pev_weapons, pev( id, pev_weapons) & ~( 1 << WeapIndex ))rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////rnstock is_wpn_heavy(id)  rn{     rn	new clip, ammo, rn	wpn = get_user_weapon(id, clip, ammo)     rn	if(wpn == DODW_30_CALrn	|| wpn == DODW_MG34rn	|| wpn == DODW_MG42)         rn	return 1   rn	return 0rn}rn////////////////////////////////////////////////////////////////////////////////////////////////////
ghzero
started this thread
Posts: 160
Threads: 42
Joined: Sep 2007
02-26-2009, 02:00 PM #5

wow - thank you VERY much!!

Archive › Old Forum Threads › Help › Scripting Help › removing/change weapon-entity from map
DoD Plugins Archive · Repository · Old Forum Threads · Maps · Admin · built 14 Sep 2026 00:34 UTC