minigames / teambattle

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
acedlol
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: August 7th, 2011, 10:41 am

minigames / teambattle

Post by acedlol » August 7th, 2011, 11:42 am

Okay, so over the last week I've been making a basic, simple minigame map. Here is a teaser of 3/10 games I have so far.






Run to the thing, only 1 PERSON gets teleported into the selection room. He chooses the games. The seperate teams are taken to their spots in that particular minigame.

Race, first person to the finish gets to kill the entire team, who are transported to the "chicken box" as I like to call it. :mrgreen:

Basically, the map is pretty much finished game wise, I've still got one more game to do to make it 10 minigames. This is aimed at the promod community, as its a teambattle really, not minigames, but minigames just catches your attention.

I do need help though, theres still a vital part of the scripting which needs to be done.

WEAPONS

This is what I need.

I want to see if its possible to run it entirely on promod, but with no mod changes (although I doubt this)

So is it possible to take away all players weapons when they spawn?

Then, when they teleport to the minigame, I need to assign them weapons. Not teamweapons, just overall. I need to get a array of all players, then assign them weapons and ammo, but I'm unsure of how to script this. To all you CJ gods out there, this one is for you.

Also, a interesting thing would be if you could disable knife as well, so the players could be in the same room, but couldn't do anything to each other, this would help future maps from being less complicated, and better made.

Contact me at xf=uaced

Or here :D

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: minigames / teambattle

Post by Drofder2004 » August 7th, 2011, 4:59 pm

place a trigger under the spawn and when triggered removed guns.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

acedlol
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: August 7th, 2011, 10:41 am

Re: minigames / teambattle

Post by acedlol » August 8th, 2011, 11:49 am

Code: Select all

main()
{
	disableweap = getentarray( "removeweapons", "targetname" );
 
	if(isdefined(disableweap))
	{
		for( i = 0; i < disableweap.size; i++ )
			disableweap[i] thread disable();
	}
}
 
disable()
{
	while(true)
	{
		self waittill( "trigger", player );
		players = getEntArray("player", "classname");
		for(i=0;i<players.size;i++)
		players[i] takeallweapons();
	}
}



This leaves me unable to knife, same situation with disableweapons()

I tried using allowmelee( "true"), I get a error.

Perhaps if I give myself hands like on the codjumper mod, I'll be able to knife?

Code: Select all

<player> getviewmodel() //(edit: viewmodel_hands_new)
However I can't get this working either.

Code: Select all

players[i] getviewmodel( "viewmodel_hands_new")
?

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: minigames / teambattle

Post by Drofder2004 » August 8th, 2011, 2:34 pm

The hands in CoD 4 are not hands, it is a weapon (C4).

The player probably needs a weapon in his hands before melee works.
TakeAllWeapons
GiveWeapon
SetWeaponAmmoClip
SetWeaponAmmoStock
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

acedlol
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: August 7th, 2011, 10:41 am

Re: minigames / teambattle

Post by acedlol » August 8th, 2011, 2:46 pm

Code: Select all

main()
{
	disableweap = getentarray( "removeweapons", "targetname" );
 
	if(isdefined(disableweap))
	{
		for( i = 0; i < disableweap.size; i++ )
			disableweap[i] thread disable();
	}
}
 
disable()
{
	while(true)
	{
		self waittill( "trigger", player );
		players = getEntArray("player", "classname");
		for(i=0;i<players.size;i++)
		players[i] takeallweapons();
		players[i] GiveWeapon ( "deserteagle_mp" );
		players[i] setweaponammoclip ( "deserteagle_mp", 0 );
		players[i] setweaponammostock ( "deserteagle_mp", 0 );
	}
}

Tried that, it disabled weapons, but doesn't give me the deagle. Perhaps the takeallweapons(); continues to be active while the player is in the trigger (it covers all of spawn)? So I should make another trigger, but this time giving the weapons etc?

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: minigames / teambattle

Post by Drofder2004 » August 8th, 2011, 4:12 pm

players = getEntArray("player", "classname");
for(i=0;i<players.size;i++)

Remove that. You do not need a player array, the players are detected by the trigger.

Code: Select all

   while(true)
   {
      self waittill( "trigger", player );
      player takeallweapons();
      player GiveWeapon ( "deserteagle_mp" );
      player SwitchToWeapon ( "deserteagle_mp" ); 
      player setweaponammoclip ( "deserteagle_mp", 0 );
      player setweaponammostock ( "deserteagle_mp", 0 );
   }
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests