Page 1 of 1

Adding nuke to cod1?

Posted: May 26th, 2010, 6:57 pm
by BatterY
shortly: a bonus you get when you have enough score and it kills all except you
*and round ends(adding later)*

Script i've gathered around forums

main()
{
thread getNuke();
thread confirmNuke();
}

getNuke()
{
if(user.score(?) > 50)
{
user.nuke = 1;
user iprintlnbold("You Have The Nuke!");
user iprintlnbold("Double Tap [F] To Use It");
}
}

confirmNuke()
{
if(user.nuke == 1 && [Double tapped F])
{
iprintlnbold(user.name + "^7Used Nuke!!");
thread useNuke();
}
}

useNuke()
{
for(i = 0;i < level.players.size;i++)
{
if(level.players != self)
level.players thread maps\mp\gametypes\_globallogic::callback_playerDamage(level.players, self, 100, 0, "MOD_RIFLE_BULLET", "default", (0, 0, 0), (0, 0, 0), "default", 0);
playsound("NUKE");
user.nuke = 0;
}
}


Re: Adding nuke to cod1?

Posted: May 26th, 2010, 7:15 pm
by Moustache
Does cod1 also works with .efx files and with these commands:
PlayFX
LoadFX

Then it is possible to play an nuke effect.

Re: Adding nuke to cod1?

Posted: May 27th, 2010, 2:09 pm
by BatterY
im asking people to correct my code.. this isnt a tutorial

Re: Adding nuke to cod1?

Posted: May 27th, 2010, 3:07 pm
by Moustache
BatterY wrote:im asking people to correct my code.. this isnt a tutorial
lol...
I just want to help you. That is why I asked that.
Then you can play a nuke effect when someone triggers a nuke.


Where do you ask people to fix your code :?:


But what goed wrong?
Any errors?

And you can place a few

Code: Select all

IPrintLnBold("Check 1");
in your script to see where the script fails.

Re: Adding nuke to cod1?

Posted: May 27th, 2010, 3:12 pm
by waywaaaard
Your code won't work

here are some ideas

Code: Select all

main()
{
	thread getNuke();// you would have to run this thread on each player
	
}

getNuke()
{
	self endon("disconnect");	
	
	for(;;){	
		if(user.score(?) > 50)
		{
			user.nuke = 1;
			thread self confirmNuke(); 
			user iprintlnbold("You Have The Nuke!");
			user iprintlnbold("Double Tap [F] To Use It");
		}
		wait 10; // wait for better performance
	}
}

confirmNuke()
{
	self endon("disconnect");		
	
	for(;;){
		if(user.nuke == 1 && [Double tapped F])
		{
			iprintlnbold(user.name + "^7Used Nuke!!");
			thread useNuke();
		}
		user.nuke = 0;
	}
}

useNuke()
{
	for(i = 0;i < level.players.size;i++)
	{
		if(level.players[i] != self)
		level.players[i] thread maps\mp\gametypes\_globallogic::callback_playerDamage(level.players[i], 		self, 100, 0, "MOD_RIFLE_BULLET", "default", (0, 0, 0), (0, 0, 0), "default", 0);
		// playsound("NUKE"); 
		// dunno if that works on cod4 on which entity to do you want to play the sound?
		// 
		
	}
}