Modme Forums

Help change round

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: xdferpc
how can I make the game detect the change of round and for example change your weapon automatically ?

or something happens like for example to open a door or give you a perk ....


ModmeBot:

Reply By: Harry Bo21

xdferpc
how can I make the game detect the change of round and for example change your weapon automatically ? or something happens like for example to open a door or give you a perk ....


level waittill( "between_round_over" );


player switchToWeapon( weapon );


ModmeBot:

Reply By: xdferpc

Harry Bo21
xdferpc how can I make the game detect the change of round and for example change your weapon automatically ? or something happens like for example to open a door or give you a perk .... level waittill( "between_round_over" ); player switchToWeapon( weapon );

could you help me fix it so that each round changes weapon to all players

and tried to do this


function weaponmulti()
{
level flag::wait_till( "all_players_connected" );
players = getplayers();
weapons = array( "ar_damage", "lmg_cqb", "shotgun_pump", "smg_versatile" );
if level waittill( "between_round_over" )
{
players switchToWeapon( weapons );
}

}


ModmeBot:

Reply By: Harry Bo21

#using scripts\zm\_zm_weapons;

function weaponmulti()
{
	WAIT_SERVER_FRAME; // Need to add a wait or youll get errors in devmode as your checking the flag before it exists
	level flag::wait_till( "all_players_connected" );
	a_weapons = array( "ar_damage", "lmg_cqb", "shotgun_pump", "smg_versatile" );
	
	while ( 1 )
	{
		level waittill( "between_round_over" );
		
		a_players = getPlayers(); // Grab the array of players here incase someone has joined or quit after your call
		for ( i = 0; i < a_players.size; i++ )
		{
			w_weapon = a_weapons[ randomInt( a_weapons.size ) ]; // Grab a random gun
			a_players[ i ] zm_weapons::weapon_give( getWeapon( w_weapon ), undefined, undefined, undefined, 1 ); // Last argument is "should switch to" so dont need to do it manually
		}
	}

}


ModmeBot:

Reply By: xdferpc
thank you very much I owe you the life XD