Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 51 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Bomb which Explodes on being shot
csocsi96
General Member
Since: Aug 9, 2010
Posts: 75
Last: Aug 24, 2014
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Nov. 4, 2012 01:34 pm
Hi,

I have been working on a Bomb which someone shoots that will explode and damage nearby enemies. In my map i have a model (xmodel/mp_tntbomb) with the targetname: malom_bomba

and a trigger_multiple around this bomb with the targetname: malom_bomba_trigger

in the script i have:

Code:

main()
{
	thread bomba();
}


bomba()
{

	bombtrig = getentarray("malom_bomba_trigger", "targetname");
	bomb = getentarray("malom_bomba", "targetname");

	bombtrig waittill ("damage");

	playfx(level._effect["bombexplosion"], bomb.origin);
	players = getentarray("player", "classname");
	for(i=0; i<players.size; i++){
		if(isdefined(players[i]) && (distance(players[i].origin, bomb.origin)<300)){
			radiusDamage(players[i].origin, 32, 1000, 1000);
			//players[i] iprintlnbold("haha!\n");
		}
	}
	bomb playSound("building_explosion1");
	
	earthquake(0.6, 1.5, bomb.origin, 500); 

	origin = bomb.origin;
	bomb delete(); //delete bomb model from map

	maps\mp\_fx::loopfx("thin_light_smoke_M", (origin-(0,0,100)), 1, (origin));
}



and when i shoot the bomb (the trigger) nothing happens.
any idea?
Share |
Ni3ls
General Member
Since: Nov 7, 2008
Posts: 256
Last: Sep 9, 2017
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Sunday, Nov. 4, 2012 02:35 pm
It must be a trigger_damage that only reacts on bullets
Share |
csocsi96
General Member
Since: Aug 9, 2010
Posts: 75
Last: Aug 24, 2014
[view latest posts]
Level 3
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Sunday, Nov. 4, 2012 02:38 pm
Thank you for the asnwer. I am going to try this.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»