Adding nuke to cod1?

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

Post Reply
BatterY
CJ Worshipper
CJ Worshipper
Posts: 238
Joined: January 29th, 2010, 10:27 pm

Adding nuke to cod1?

Post by BatterY » May 26th, 2010, 6:57 pm

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;
}
}


Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Adding nuke to cod1?

Post by Moustache » May 26th, 2010, 7:15 pm

Does cod1 also works with .efx files and with these commands:
PlayFX
LoadFX

Then it is possible to play an nuke effect.

BatterY
CJ Worshipper
CJ Worshipper
Posts: 238
Joined: January 29th, 2010, 10:27 pm

Re: Adding nuke to cod1?

Post by BatterY » May 27th, 2010, 2:09 pm

im asking people to correct my code.. this isnt a tutorial

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: Adding nuke to cod1?

Post by Moustache » May 27th, 2010, 3:07 pm

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.

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: Adding nuke to cod1?

Post by waywaaaard » May 27th, 2010, 3:12 pm

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?
		// 
		
	}
}
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests