Sign in to follow this  
Followers 0
BosnianArmy

End rooms scripts

9 posts in this topic

Hey,

 

I just noticed there are no end rooms scripts on this topic section, I want to post it for the guys who are/will be new into the mapping.

 

WARNING: THESE SCRIPTS CAN LEAD TO A SCRIPT ERROR THAT CAN CAUSE A SERVER TO CRASH FIX FOR IT IS HERE - http://raid-gaming.net/forums/topic/707-end-rooms-scripts/?p=11123

 

 

Knife

knife()
{
    level.knife_trig = getEnt( "knife", "targetname");
    jump = getEnt( "enter_knife", "targetname" );
    acti = getEnt( "activator_enter_knife", "targetname" );
    
    while(1)
    {
        level.knife_trig waittill( "trigger", player );
        if( !isDefined( level.knife_trig ) )
            return;
        
        level.sniper_trig delete();
		level.old_trig delete();
		level.weapon_trig delete();
		level.rpg_trig delete();
		
        player SetPlayerAngles( jump.angles );
        player setOrigin( jump.origin );
        player TakeAllWeapons();
        player GiveWeapon( "tomahawk_mp" ); //jumper weapon        
        level.activ setPlayerangles( acti.angles );
        level.activ setOrigin( acti.origin );
        level.activ TakeAllWeapons();
        level.activ GiveWeapon( "tomahawk_mp" );        
        wait 0.05;
		player.maxhealth = 100;
		level.activ.maxhealth = 100;
        player switchToWeapon( "tomahawk_mp" ); //activator weapon
        level.activ SwitchToWeapon( "tomahawk_mp" );
        iPrintlnBold( " ^6" + player.name + " ^5Entered Knife." );     //change to what you want it to be
        while( isAlive( player ) && isDefined( player ) )
            wait 1;
    }
}

Sniper

sniper()
{
    level.sniper_trig = getEnt( "sniper", "targetname");
    jump = getEnt( "enter_sniper_room", "targetname" );
    acti = getEnt( "activator_enter_sniper", "targetname" );
    
    while(1)
    {
        level.sniper_trig waittill( "trigger", player );
        if( !isDefined( level.sniper_trig ) )
            return;
        
        level.knife_trig delete();
		level.old_trig delete();
		level.weapon_trig delete();
		level.rpg_trig delete();
		
        player SetPlayerAngles( jump.angles );
        player setOrigin( jump.origin );
        player TakeAllWeapons();
        player GiveWeapon( "m40a3_mp" ); //jumper weapon        
        level.activ setPlayerangles( acti.angles );
        level.activ setOrigin( acti.origin );
        level.activ TakeAllWeapons();
        level.activ GiveWeapon( "m40a3_mp" );        
        wait 0.05;
        player switchToWeapon( "m40a3_mp" ); //activator weapon
		player.maxhealth = 100;
		level.activ.maxhealth = 100;
        level.activ SwitchToWeapon( "m40a3_mp" );
        iPrintlnBold( " ^6" + player.name + " ^5Entered Sniper." );     //change to what you want it to be
        while( isAlive( player ) && isDefined( player ) )
            wait 1;
    }
}

Old

old()
{
    level.old_trig = getEnt( "old", "targetname");
    jump = getEnt( "enterold", "targetname" );
    acti = getEnt( "activatorold", "targetname" );
    
    while(1)
    {
        level.old_trig waittill( "trigger", player );
        if( !isDefined( level.old_trig ) )
            return;
        
        level.knife_trig delete();
		level.sniper_trig delete();
		level.weapon_trig delete();
		level.rpg_trig delete();
		
        player SetPlayerAngles( jump.angles );
        player setOrigin( jump.origin );
        player TakeAllWeapons();
        player GiveWeapon( "tomahawk_mp" ); //jumper weapon        
        level.activ setPlayerangles( acti.angles );
        level.activ setOrigin( acti.origin );
        level.activ TakeAllWeapons();
        level.activ GiveWeapon( "tomahawk_mp" );        
        wait 0.05;
        player switchToWeapon( "tomahawk_mp" ); //activator weapon
		player.maxhealth = 100;
		level.activ.maxhealth = 100;
        level.activ SwitchToWeapon( "tomahawk_mp" );
        iPrintlnBold( " ^6" + player.name + " ^5Entered Old! Get the activator!" );     //change to what you want it to be
        while( isAlive( player ) && isDefined( player ) )
            wait 1;
    }
}

Weapon

weapon()
{
    level.weapon_trig = getEnt( "weapon", "targetname");
    jump = getEnt( "a", "targetname" );
    acti = getEnt( "b", "targetname" );
    
    while(1)
    {
        level.weapon_trig waittill( "trigger", player );
        if( !isDefined( level.weapon_trig ) )
            return;
        
        level.knife_trig delete();
		level.sniper_trig delete();
		level.old_trig delete();
		level.rpg_trig delete();
		
        player SetPlayerAngles( jump.angles );
        player setOrigin( jump.origin );
        player TakeAllWeapons();
        player GiveWeapon( "deserteagle_mp" ); //jumper weapon        
        level.activ setPlayerangles( acti.angles );
        level.activ setOrigin( acti.origin );
        level.activ TakeAllWeapons();
        level.activ GiveWeapon( "deserteagle_mp" );        
        wait 0.05;
        player switchToWeapon( "deserteagle_mp" ); //activator weapon
		player.maxhealth = 100;
		level.activ.maxhealth = 100;
        level.activ SwitchToWeapon( "deserteagle_mp" );
        iPrintlnBold( " ^6" + player.name + " ^5Entered Weapon!" );     //change to what you want it to be
        while( isAlive( player ) && isDefined( player ) )
            wait 1;
    }
}

RPG

rpg()
{
    level.rpg_trig = getEnt( "rpg", "targetname");
    jump = getEnt( "c", "targetname" );
    acti = getEnt( "d", "targetname" );
    
    while(1)
    {
        level.rpg_trig waittill( "trigger", player );
        if( !isDefined( level.rpg_trig ) )
            return;
        
        level.knife_trig delete();
		level.sniper_trig delete();
		level.old_trig delete();
		level.weapon_trig delete();
		
        player SetPlayerAngles( jump.angles );
        player setOrigin( jump.origin );
        player TakeAllWeapons();
        player GiveWeapon( "rpg_mp" ); //jumper weapon        
        level.activ setPlayerangles( acti.angles );
        level.activ setOrigin( acti.origin );
        level.activ TakeAllWeapons();
        level.activ GiveWeapon( "rpg_mp" );        
        wait 0.05;
        player switchToWeapon( "rpg_mp" ); //activator weapon
		player.maxhealth = 100;
		level.activ.maxhealth = 100;
        level.activ SwitchToWeapon( "rpg_mp" );
        iPrintlnBold( " ^6" + player.name + " ^5Entered (The secret!) RPG room!" );     //change to what you want it to be
        while( isAlive( player ) && isDefined( player ) )
            wait 1;
    }
}
0

Share this post


Link to post
Share on other sites

Would be nice if you explained what they did so people can learn from it.

0

Share this post


Link to post
Share on other sites

Would be nice if you explained what they did so people can learn from it.

 

Not in the mood how to explain that :dave:

0

Share this post


Link to post
Share on other sites

...goddamnit bosnian

 

What? If I am not in the mood rightnow how to explain with the origin part then I can't do it? I can always do a bit later. Better a bit later then never. :dave:

0

Share this post


Link to post
Share on other sites
knife()
{
level.knife_trig = getEnt( "knife", "targetname"); //The trigger
jump = getEnt( "enter_knife", "targetname" ); //the origin the jumper will teleport
acti = getEnt( "activator_enter_knife", "targetname" ); //the origin the acti will teleport

while(1) //loop
{
level.knife_trig waittill( "trigger", player ); //waits until the jumper activates the room
if( !isDefined( level.knife_trig ) ) //defines that it is the knife trigger
return;

level.sniper_trig delete();
        level.old_trig delete();
        level.weapon_trig delete();
        level.rpg_trig delete(); //deletes all of the other room triggers so that they cant be entered
        
player SetPlayerAngles( jump.angles );
player setOrigin( jump.origin ); //teleports the jumper
player TakeAllWeapons(); //takes all weapons from jumper
player GiveWeapon( "tomahawk_mp" ); //jumper weapon 
level.activ setPlayerangles( acti.angles );
level.activ setOrigin( acti.origin ); //teleports acti
level.activ TakeAllWeapons(); //takes all weapons from acti
level.activ GiveWeapon( "tomahawk_mp" ); //gives acti tomahawk
wait 0.05;
        player.maxhealth = 100;
        level.activ.maxhealth = 100; //gives players normal health if damaged
player switchToWeapon( "tomahawk_mp" ); 
level.activ SwitchToWeapon( "tomahawk_mp" ); //this line means they switch to the weapon
iPrintlnBold( " ^6" + player.name + " ^5Entered Knife." ); // announces on screen the player name and the knife room
while( isAlive( player ) && isDefined( player ) ) //if the player is alive the room will stay closed so no one can enter.
wait 1;
}
}

Well I tried to define most of the lines in the scripts for you.

0

Share this post


Link to post
Share on other sites

Well I tried to define most of the lines in the scripts for you

 

 

 

 

Thank you!!

0

Share this post


Link to post
Share on other sites

Not in the mood how to explain that :dave:

Then don't post a tutorial... A tutorial is meant to teach people how to do a certain thing, not how to copy and paste.

0

Share this post


Link to post
Share on other sites
knife()
{
level.knife_trig = getEnt( "knife", "targetname"); //The trigger
jump = getEnt( "enter_knife", "targetname" ); //the origin the jumper will teleport
acti = getEnt( "activator_enter_knife", "targetname" ); //the origin the acti will teleport

while(1) //loop
{
level.knife_trig waittill( "trigger", player ); //waits until the jumper activates the room
if( !isDefined( level.knife_trig ) ) //defines that it is the knife trigger
return;

level.sniper_trig delete();
        level.old_trig delete();
        level.weapon_trig delete();
        level.rpg_trig delete(); //deletes all of the other room triggers so that they cant be entered
        
player SetPlayerAngles( jump.angles );
player setOrigin( jump.origin ); //teleports the jumper
player TakeAllWeapons(); //takes all weapons from jumper
player GiveWeapon( "tomahawk_mp" ); //jumper weapon 
if( isDefined( level.activ ) && isAlive( level.activ ) //makes sure the activator exists and is alive, otherwise it'll try to do things to a non-existant acti (._. )
{
level.activ setPlayerangles( acti.angles );
level.activ setOrigin( acti.origin ); //teleports acti
level.activ TakeAllWeapons(); //takes all weapons from acti
level.activ GiveWeapon( "tomahawk_mp" ); //gives acti tomahawk
wait 0.05;
        player.maxhealth = 100;
        level.activ.maxhealth = 100; //gives players normal health if damaged
player switchToWeapon( "tomahawk_mp" );
level.activ SwitchToWeapon( "tomahawk_mp" ); //this line means they switch to the weapon
iPrintlnBold( " ^6" + player.name + " ^5Entered Knife." ); // announces on screen the player name and the knife room
while( isAlive( player ) && isDefined( player ) ) //if the player is alive the room will stay closed so no one can enter.
wait 1;
}
}
}

 

That would pull up an error with log files, fixed for you.

0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0