script?


(papaDOC) #1

How I can add to my script script :slight_smile:
If Axis destroy “A” axis win or if Axis destroy “B” axis win… How I can do this?
I need script… Only one from two objectives must be destoyred…
papaDOC :moo:

thx for the help im noob :stuck_out_tongue:


//Start
game_manager
{
	spawn {
		wm_number_of_objectives 1
		wm_axis_respawntime 20
		wm_allied_respawntime 20
		wm_set_round_timelimit	30


//Chemical A
A
{
 spawn // this is called when the game starts and the entity is spawned
{
wait 200

constructible_class 3 // this indicated that the oasis_wall entity is a dynamitable-only 

entity... 
}

death // this is called when the entity is destroyed... 
{

wm_announce "Allies have destroyed Chemical Weapon Crates A!" // ... when the entity is 

destroyed, you annouce the message to all players in game with this


}
}

//Chemical B
B
{
 spawn // this is called when the game starts and the entity is spawned
{
wait 200

constructible_class 3 // this indicated that the oasis_wall entity is a dynamitable-only 

entity... 
}

death // this is called when the entity is destroyed... 
{

wm_announce "Allies have destroyed Chemical Weapon Crates B!" // ... when the entity is 

destroyed, you annouce the message to all players in game with this


}
}

(Moonkey) #2

simplest way is to add


	// Set the round winner:  0 == AXIS, 1 == ALLIED
	wm_setwinner 1

	// End the round
	wm_endround

to the end of the death block of each.


(papaDOC) #3

//Start 
game_manager 
{ 
   spawn { 
      wm_number_of_objectives 1 
      wm_axis_respawntime 20 
      wm_allied_respawntime 20 
      wm_set_round_timelimit   30 


//Chemical A 
A 
{ 
spawn // this is called when the game starts and the entity is spawned 
{ 
wait 200 

constructible_class 3 // this indicated that the oasis_wall entity is a dynamitable-only 

entity... 
} 

death // this is called when the entity is destroyed... 
{ 

wm_announce "Allies have destroyed Chemical Weapon Crates A!" // ... when the entity is 

destroyed, you annouce the message to all players in game with this 


} 
} 
   // Set the round winner:  0 == AXIS, 1 == ALLIED 
   wm_setwinner 1 

   // End the round 
   wm_endround 
//Chemical B 
B 
{ 
spawn // this is called when the game starts and the entity is spawned 
{ 
wait 200 

constructible_class 3 // this indicated that the oasis_wall entity is a dynamitable-only 

entity... 
} 

death // this is called when the entity is destroyed... 
{ 

wm_announce "Allies have destroyed Chemical Weapon Crates B!" // ... when the entity is 

destroyed, you annouce the message to all players in game with this 


} 
}
   // Set the round winner:  0 == AXIS, 1 == ALLIED 
   wm_setwinner 1 

   // End the round 
   wm_endround 

its ok? :expressionless:
if i run game i see error in line 41


(Mean Mr. Mustard) #4

You need to set winner and end round in the ‘death’ block of entity A and B. Like below. This way, when the entity is destroyed, it announces a message, sets the winner and ends the round


//Start 
game_manager 
{ 
   spawn { 
      wm_number_of_objectives 1 
      wm_axis_respawntime 20 
      wm_allied_respawntime 20 
      wm_set_round_timelimit   30 


//Chemical A 
A 
{ 
   spawn // this is called when the game starts and the entity is spawned 
   {   
       wait 200 

       constructible_class 3 // this indicated that the oasis_wall entity is a     dynamitable-only 

entity... 
   } 

    death // this is called when the entity is destroyed... 
   { 

      wm_announce "Allies have destroyed Chemical Weapon Crates A!" // ... when the entity is 

destroyed, you annouce the message to all players in game with this 
      // Set the round winner:  0 == AXIS, 1 == ALLIED 
      wm_setwinner 1 

       // End the round 
      wm_endround 

   } 
} 
   
//Chemical B 
B 
{ 
   spawn // this is called when the game starts and the entity is spawned 
   { 
      wait 200 

      constructible_class 3 // this indicated that the oasis_wall entity is a dynamitable-only 

entity... 
   } 

   death // this is called when the entity is destroyed... 
   { 

      wm_announce "Allies have destroyed Chemical Weapon Crates B!" // ... when the entity is 

destroyed, you annouce the message to all players in game with this 
    // Set the round winner:  0 == AXIS, 1 == ALLIED 
    wm_setwinner 1 

    // End the round 
    wm_endround

   } 
} 
   

(papaDOC) #5

now error on line 61 :confused: but thx…
Can u put .script file on http server?


(Mean Mr. Mustard) #6

oops! Missing two end brackets (}) in game manager - sorry about that! If you fix that, I think it’s good to go…

//Start 
game_manager 
{ 
   spawn { 
      wm_number_of_objectives 1 
      wm_axis_respawntime 20 
      wm_allied_respawntime 20 
      wm_set_round_timelimit   30 
   }
}

//Chemical A 
....


(papaDOC) #7

no problem :slight_smile: you master :slight_smile: this work thx u!! :banana: :banana: