Page 1 of 1

minigames / teambattle

Posted: August 7th, 2011, 11:42 am
by acedlol
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

Re: minigames / teambattle

Posted: August 7th, 2011, 4:59 pm
by Drofder2004
place a trigger under the spawn and when triggered removed guns.

Re: minigames / teambattle

Posted: August 8th, 2011, 11:49 am
by acedlol

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")
?

Re: minigames / teambattle

Posted: August 8th, 2011, 2:34 pm
by Drofder2004
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

Re: minigames / teambattle

Posted: August 8th, 2011, 2:46 pm
by acedlol

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?

Re: minigames / teambattle

Posted: August 8th, 2011, 4:12 pm
by Drofder2004
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 );
   }