prevent axis respawn

Post your scripting questions / solutions here

Moderator: Moderators

agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

hehe again a question ;)

I ve tried your script and the game kick me to start menu ."cannot parse script file" thats the error

so i made a small change in with this part of script :

Code: Select all


		thread check_allies_bomb 
		thread check_axis_bomb
		thread prevent_player_spawn

check_allies_bomb: 

while(1) 
{ 
if (local.bomb1.exploded == 1) 
{ 

   while(1) 
   { 
      for(local.i=1;local.i<=$player.size;local.i++) 
      { 

        if ((isAlive $player[local.i]) && $player[local.i].dmteam=="allies") 
      { 

      } 

         if($player[local.i].dead == 0) 
         { 

            $player[local.i].dead = 1 
         } 
       }
       
    }          
                
      waitframe
} 

end 

  

} 


end 



check_axis_bomb: 

while(1) 
{ 
if (local.bomb1.exploded == 1) 
{ 

   while(1) 
   { 
      for(local.i=1;local.i<=$player.size;local.i++) 
      { 

        if ((isAlive $player[local.i]) && $player[local.i].dmteam=="axis") 
      { 

      } 

         if($player[local.i].dead == 0) 
         { 

            $player[local.i].dead = 1 
         } 
       }
       
    }          
                
      waitframe
} 

end 

  

} 


end 

  
prevent_player_spawn: 

while(1) 
{ 

   if($player[local.i].dead == 1) 
   { 
      $player[local.i] takeall 
      $player[local.i] hide 
      $player[local.i] notsolid 
      $player[local.i] noclip 
   } 
wait .1 
} 

end 

This script allow me to load my map , i have skiped the counters for a moment cause it cause me to be kick

However with the script above something is wrong and console say this error in LOOP each 1 ms:

Code: Select all


^~^~^ Script Error: Cannot cast 'NIL' to int

   if($player[local.i].dead == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 285)
   if($player^

^~^~^ Script Error: Cannot cast 'NIL' to int

   if($player[local.i].dead == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 285)
   if($player^

^~^~^ Script Error: Cannot cast 'NIL' to int

   if($player[local.i].dead == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 285)
   if($player^

^~^~^ Script Error: Cannot cast 'NIL' to int

   if($player[local.i].dead == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 285)
   if($player^

^~^~^ Script Error: Cannot cast 'NIL' to int

   if($player[local.i].dead == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 285)
   if($player^

^~^~^ Script Error: Cannot cast 'NIL' to int

   if($player[local.i].dead == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 285)
   if($player^

^~^~^ Script Error: Cannot cast 'NIL' to int

   if($player[local.i].dead == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 285)
   if($player^

^~^~^ Script Error: Cannot cast 'NIL' to int

   if($player[local.i].dead == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 285)
   if($player^


where is the error in the script above and below:

Code: Select all

count_players: 

   while(1) 
   { 
      level.allies = 0 
      level.axis = 0 
      for(local.i=1;local.i<=$player.size;local.i++) 
      { 

        if(isAlive $player[local.i]) 
      { 
         if($player[local.i].dmteam=="allies") 
        { 
            level.allies++ 
        } 
         else if($player[local.i].dmteam=="axis") 
        { 
         if($player[local.i].dead != 1) 
         { 
            level.axis++ 
         } 
                  } 
      } 
        } 
if (level.axis == 0) 
{ 
     teamwin allies 
} 


else

if (level.allies == 0) 
{ 
     teamwin axis
}



                         } 
 


end  

trie also the first you gave me .No way

Thx for the help ;)
Deadly and slient.
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Code: Select all

    			  for(local.i=1;local.i<=$player.size;local.i++)
    			  {

       				 if ((isAlive $player[local.i]) && $player[local.i].dmteam=="allies")
      				 {

     				 }

         			 if($player[local.i].dead == 0)
         			 {

            				$player[local.i].dead = 1
         			 }
       			  }
I know it is very hard to indent on this forum with script, but I copied and pasted into notepad to do it. I noticed that if the player is alive and is on the allied side, then nothing happens. It then says if the person is not dead, then he is counted as being dead. What you need is an else statement in there:

Code: Select all

check_allies_bomb:    			
  for(local.i=1;local.i<=$player.size;local.i++)
    			  {

       				 if ((isAlive $player[local.i]) && $player[local.i].dmteam=="allies")
      				 {

     				 }
                                 else
                                 {
         			 if($player[local.i].dead == 0)
         			 {

            				$player[local.i].dead = 1
         			 }
                                }
       			  }

I also noticed it here in another and I fixed that one too:

Code: Select all

check_axis_bomb:

while(1)
{
	if (local.bomb1.exploded == 1)
	{

 		  while(1)
 		  {
  			   for(local.i=1;local.i<=$player.size;local.i++)
  			   {

     				   if ((isAlive $player[local.i]) && $player[local.i].dmteam=="axis")
     				   {
                             
     				   }
       				else
                                   {
                                  if($player[local.i].dead == 0)
        		          {

           				 $player[local.i].dead = 1
         			  }
                                   }
       			   }
       
    		  }         
               
	}


}


end
I'm not sure if this is the exact problem. Test it out and post an update.
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Code: Select all

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/////////////////////////////threads////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

 		$bomb1 thread bomb_thinker
		$stargate_document thread axis_get_document
 		$bomb2 thread bomb_thinker2
		$entite_cache thread allies_get_document
		thread soundtrack
		thread prep_mg
		thread activate_mg
		thread use_code
		thread playerclip_prep 
		thread waterboom 
		thread waterboom2
		thread axis_check_endmatch 
		thread allies_check_endmatch 
		thread check_allies_bomb 
		thread check_axis_bomb
		thread prevent_player_spawn




////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/////////////////////////////check bomb status//////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////



check_allies_bomb: 

while(1) 
{ 
   if (local.bomb1.exploded == 1) 
   { 

         while(1) 
         { 
              for(local.i=1;local.i<=$player.size;local.i++) 
              { 

                    if ((isAlive $player[local.i]) && $player[local.i].dmteam=="allies") 
                    { 
                              
                    } 
                   else 
                                   { 
                                  if($player[local.i].dead == 0) 
                        { 

                        $player[local.i].dead = 1 
                    } 
                                   } 
                   } 
        
            }          
                
   } 


} 


end 



check_axis_bomb: 

while(1) 
{ 
   if (local.bomb2.exploded == 1) 
   { 

         while(1) 
         { 
              for(local.i=1;local.i<=$player.size;local.i++) 
              { 

                    if ((isAlive $player[local.i]) && $player[local.i].dmteam=="axis") 
                    { 
                              
                    } 
                   else 
                                   { 
                                  if($player[local.i].dead == 0) 
                        { 

                        $player[local.i].dead = 1 
                    } 
                                   } 
                   } 
        
            }          
                
   } 


} 


end 

  
prevent_player_spawn: 

while(1) 
{ 

   if($player[local.i].dead == 1) 
   { 
      $player[local.i] takeall 
      $player[local.i] hide 
      $player[local.i] notsolid 
      $player[local.i] noclip 
   } 
wait .1 
} 

end 
mpa could npt be loaded

error:

Code: Select all


^~^~^ Script Error: Cannot cast 'NIL' to listener

   if (local.bomb1.exploded == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 205)
   if (local.bomb1^

^~^~^ Script Error: Cannot cast 'NIL' to listener

   if (local.bomb1.exploded == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 205)
   if (local.bomb1^

^~^~^ Script Error: Cannot cast 'NIL' to listener

   if (local.bomb1.exploded == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 205)
   if (local.bomb1^

^~^~^ Script Error: Cannot cast 'NIL' to listener

   if (local.bomb1.exploded == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 205)
   if (local.bomb1^

^~^~^ Script Error: Cannot cast 'NIL' to listener

   if (local.bomb1.exploded == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 205)
   if (local.bomb1^

^~^~^ Script Error: Cannot cast 'NIL' to listener

   if (local.bomb1.exploded == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 205)
   if (local.bomb1^

^~^~^ Script Error: Cannot cast 'NIL' to listener

   if (local.bomb1.exploded == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 205)
   if (local.bomb1^

^~^~^ Script Error: Cannot cast 'NIL' to listener

   if (local.bomb1.exploded == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 205)
   if (local.bomb1^

^~^~^ Script Error: Cannot cast 'NIL' to listener

   if (local.bomb1.exploded == 1)  (maps/obj/mp_stargate_objective_final_obj.scr, 205)
   if (local.bomb1^
Deadly and slient.
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Is that your entire .scr script? I mean, is that everything that you have in there? If so, then I will tell you what you need to add. :wink:
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

No this is only a short part
Deadly and slient.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

sorry for the spam
Last edited by agentmad007 on Tue Nov 30, 2004 1:06 am, edited 2 times in total.
Deadly and slient.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

.....
Last edited by agentmad007 on Tue Nov 30, 2004 1:07 am, edited 1 time in total.
Deadly and slient.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

sorry for the spam , can a admin erase these post pLZ ... I POSTED a script cuted in 4 without interest
Last edited by agentmad007 on Tue Nov 30, 2004 1:07 am, edited 1 time in total.
Deadly and slient.
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

Error i cant post my script too long!
Deadly and slient.
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Send the .scr file to me and I will look at it.

mlazo10@gmail.com
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

already done since 10 min by pm ;) check the link ...sorry for this post ....and i dont have the ability to erase them :/
Deadly and slient.
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

When I open it with any program that reads .zip files, it gives an error message saying that it is a bad file. Try re-zipping it and send it again.
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

yeah normal .....sorry i forget to say in my pm to change .zip to .txt :p
Deadly and slient.
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Well first of all I noticed this:

Code: Select all

 $bomb1 thread bomb_thinker
 $bomb2 thread bomb_thinker
It should be this:

Code: Select all

$bomb1 thread global/obj_dm.scr::bomb_thinker
$bomb2 thread global/obj_dm.scr::bomb_thinker
You also need an 'end' before the thread check_allies_bomb.

I just glanced at the beginning. If that doesn't do it, then please post again.
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

$bomb1 thread global/obj_dm.scr::bomb_thinker
$bomb2 thread global/obj_dm.scr::bomb_thinker

it work very fine for me that way:

$bomb1 thread bomb_thinker
$bomb2 thread bomb_thinker

i awarely changed the obj_dm.scr and implemented it on my script .
Deadly and slient.
Post Reply