Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Killtriggers
#1
Hello

Another simple gsc tutorial, this time is a command meant for mapedits, is the killtrigger, what it does is to create a death area, if you touch that area, you die, like in outside maps, Wink . The command is located in _utility.gsc, so is easy to use.

This is it:

Code:
killTrigger( position, radius, height )

An example(using classic mapedits):

Code:
Karachi()
{
              Createwalls(blablabla);
              Createwalls(blablabla);
              [b]thread killTrigger((850,-130,596),80,1);  [/b]
              Createblocks(blablabla);
}

If you are interested in the code it uses:

Code:
killTrigger( pos, radius, height )
{
    trig = spawn( "trigger_radius", pos, 0, radius, height );
    
    /#
    if ( getdvar( "scr_killtriggerdebug" ) == "1" )
        thread killTriggerDebug( pos, radius, height );
    #/
    
    for ( ;; )
    {
        /#
        if ( getdvar( "scr_killtriggerradius" ) != "" )
            radius = int(getdvar( "scr_killtriggerradius" ));
        #/
        
        trig waittill( "trigger", player );
        
        if ( !isPlayer( player ) )
            continue;
        
        player suicide();
    }
}

/#
killTriggerDebug( pos, radius, height )
{
    for ( ;; )
    {
        for ( i = 0; i < 20; i++ )
        {
            angle = i / 20 * 360;
            nextangle = (i+1) / 20 * 360;
            
            linepos = pos + (cos(angle) * radius, sin(angle) * radius, 0);
            nextlinepos = pos + (cos(nextangle) * radius, sin(nextangle) * radius, 0);
            
            line( linepos, nextlinepos );
            line( linepos + (0,0,height), nextlinepos + (0,0,height) );
            line( linepos, linepos + (0,0,height) );
        }
        wait .05;
    }
}
#/

I find this command usefull to delete a glitch, a spot or to delete under map spots.

Nyan Cat
Reply

#2
Was looking for this for some time now gracias.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb [Request] Delete killtriggers? Nekochan 7 4,301 09-02-2012, 13:24
Last Post: Ich1994

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.