Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Portal Gun

  1. #1
    Banned
    Join Date
    May 2011
    Location
    ');DROP TABLE 'users';--
    Posts
    737
    Points
    1,710
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    ');DROP TABLE 'users';--
    Posts
    737
    Points
    1,710

    Default Portal Gun

    I remember there being this mod in mw2 back in the modded lobbies so I made one for black ops. Its a Portal Gun, where you press "+" to set one portal and "-" to set the other. Each portal is marked by a corresponding flag. If one were to enter the "portal" they would be teleported to the other.

    Code:
    /*
    Put in "onPlayerConnect":
    precacheModel( "mp_flag_allies_1" );
    precacheModel( "mp_flag_axis_1" );
    player thread tele_wand();
    */
    
    
    
    
    tele_wand()
    {
        self endon( "disconnect" );
        self GiveWeapon( "defaultweapon_mp" );
        self SwitchToWeapon( "defaultweapon_mp" );
        self thread teleCool();
        while ( 1 )
        {
            if( self FragButtonPressed() && self getCurrentWeapon() == "defaultweapon_mp" )
            {
                self notify( "destroy_p1" );
                self thread portal_1f( aim() );
            
            }
            else if( self SecondaryOffHandButtonPressed() && self getCurrentWeapon() == "defaultweapon_mp" )
            {
                self notify( "destroy_p2" );
                self thread portal_2f( aim() );
            }
            wait( 0.01  );
        }
    }
    
    
    portal_1f( where )
    {
        self endon( "destroy_p1" );
        self.Portal_1 = spawn( "script_model", where );
        self.Portal_1 setModel( "mp_flag_allies_1" );
        self thread delete_object( self.Portal_1, "destroy_p1" );
        for( i = 0; i < level.players.size; i++ )
        {
            player = level.players[i];
            if( distance( player.origin, self.Portal_1.origin ) < 50 && isDefined( self.Portal_2 ) && player.TeleportCooling == 0 )
            {
                player SetOrigin( self.Portal_2.origin );
                player.TeleportCooling = 20;
            }
            wait( 0.05 );
        }
    }
    
    
    
    
    portal_2f( where )
    {
        self endon( "destroy_p2" );
        self.Portal_2 = spawn( "script_model", where );
        self.Portal_2 setModel( "mp_flag_axis_1" );
        self thread delete_object( self.Portal_2, "destroy_p2" );    
        for( i = 0; i < level.players.size; i++ )
        {
            player = level.players[i];
            if( distance( player.origin, self.Portal_2.origin ) < 50 && isDefined( self.Portal_1 ) && player.TeleportCooling == 0 )
            {
                player SetOrigin( self.Portal_1.origin );
                player.TeleportCooling = 20;
            }
            wait( 0.05 );
        }
    }
    
    
    
    
    delete_object( what, when )
    {
        self waittill ( when );
        what destroy();
    }
    
    
    aim()
    {
        location = bullettrace( self gettagorigin( "j_head" ), self gettagorigin( "j_head" ) + anglestoforward( self getplayerangles() ) * 100000, 1, self)["position"];
        return location;
    }
    
    
    
    
    teleCool()
    {
        self endon("disconnect");
        while( 1 )
        {
            for( i = 0; i < level.players.size; i++ )
            {
                player = level.players[i];
                if( player.TeleportCooling > 0 )
                    player.TeleportCooling--;
            }
            wait( 0.05 );
        }
    }

    0 Not allowed! Not allowed!
    Last edited by Nity; 11-04-2011 at 10:34 AM.

  2. #2
    Member
    Join Date
    Sep 2011
    Location
    In Your Hoe
    Posts
    53
    Points
    143
         User Info     Contact     Gamer ID
    Join Date
    Sep 2011
    Location
    In Your Hoe
    Posts
    53
    Points
    143

    Default

    nice nity im going to test it !!

    0 Not allowed! Not allowed!

  3. #3
    Wii Modder
    I AM BEAST
    JellyInjector's Avatar
    Join Date
    Apr 2011
    Posts
    598
    Points
    1,088
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Posts
    598
    Points
    1,088

    Default

    nice job man... its so simple to do something like this, but you thought of doing it and, unlike me most of the time, you took the time to do it instead of being lazy, so for that i say nice job man...

    also, you could shorten the coding by making the two portals call on 1 function... something like...
    portal( portalNumber, where )
    and then instead of self.portal1 and self.portal2 do self.portal[portalNumber]...
    sorry, im always looking to shorten coding...

    0 Not allowed! Not allowed!
    Last edited by JellyInjector; 11-02-2011 at 07:51 PM.

  4. #4
    Tig O Bitties
    Grey's Avatar
    Join Date
    May 2011
    Location
    Candy Mountain
    Posts
    2,935
    Points
    2,964
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Candy Mountain
    Posts
    2,935
    Points
    2,964

    Contact info:

    Youtube Channel: http://www.youtube.com/l3g3darymods

    Default

    nice nity...pretty awesome script

    0 Not allowed! Not allowed!

  5. #5
    Evolved Modder
    Living Liek Larry
    tony's Avatar
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
    Gamer IDs

    PSN ID: L33T_T0ny Steam ID: ToNy Wii Code: L33T_T0ny

    Default

    i made something like this a while back but it worked moree like the gun

    u got a strella and it shot out the bullet from napalm_blob_lb_mp whitch was red and it set the flag points and if where near them u teleported to the other one


    the only prob was u can only use it once and i didnt know how to get rid of entitys then

    0 Not allowed! Not allowed!

  6. #6
    Nooblet
    Join Date
    Oct 2011
    Posts
    4
    Points
    6
         User Info     Contact     Gamer ID
    Join Date
    Oct 2011
    Posts
    4
    Points
    6

    Default

    hey can u help me get a mod menu im a noob at this so i dont even have the iso but i have the usb if u have skype add zebrasexy123

    0 Not allowed! Not allowed!

  7. #7
    Nooblet
    Join Date
    Oct 2011
    Posts
    4
    Points
    6
         User Info     Contact     Gamer ID
    Join Date
    Oct 2011
    Posts
    4
    Points
    6

    Default

    can u help me get the iso and mod menu plz is u have skype add zebrasexy123

    0 Not allowed! Not allowed!

  8. #8
    Banned
    Join Date
    May 2011
    Posts
    61
    Points
    154
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    61
    Points
    154

    Default

    Im getting continuos syntax errors i fix what it says and i get a different one. Its rejecting my mod menu

    0 Not allowed! Not allowed!

  9. #9
    Evolved Modder
    Living Liek Larry
    tony's Avatar
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Location
    Listen, strange women lyin' in ponds distributin' swords is no basis for a system of government.
    Posts
    6,302
    Points
    10,689
    Gamer IDs

    PSN ID: L33T_T0ny Steam ID: ToNy Wii Code: L33T_T0ny

    Default

    u prob made a mistake (or nity did, which isnt impossible)

    0 Not allowed! Not allowed!

  10. #10
    Banned
    Join Date
    May 2011
    Posts
    61
    Points
    154
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    61
    Points
    154

    Default

    delete_object( what, when )
    }
    The first syntax is missing semi colin on this: > self waittill ( when )
    what destroy();
    }

    Then when i add the semi colin it says un-kown function Portal_1 and i really dont know what to do there. What the hell am i doing wrong?????

    0 Not allowed! Not allowed!

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 01:55 AM.
Powered by vBulletin®
Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.