Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release teleport function
#1
ok i started trying to import the old teleport function into black ops and hope i posted all needed code to understand the problem, i precached the location selector in init etc...but when i try to call my teleport via the melee button nothing happens ingame. just nothing.

perhaps someone can look into and give me a good advice where the error is

+ i am not sure about the level.mapSize

PHP Code:
init()
{
    
precacheModel"projectile_cbu97_clusterbomb" );
    
precacheItem "airstrike_mp" );
    
level.airstrikeModel "t5_veh_air_b52";
        
    
precacheModellevel.airstrikeModel );
    
    
PrecacheRumble("rolling_thunder_rumble");
    
PrecacheRumble("artillery_rumble");
    
precacheLocationSelector"map_airstrike_selector" );

    
    
// register the radar hardpoint
    
if ( mapsmpgametypes_tweakables::getTweakableValue"killstreak""allowairstrike" ) )
    {
        
mapsmpgametypes_hardpoints::registerKillstreak("airstrike_mp""airstrike_mp""killstreak_airstrike""airstrike_used", ::useKillstreakAirstriketrue);
        
mapsmpgametypes_hardpoints::registerKillstreakStrings("airstrike_mp", &"KILLSTREAK_EARNED_AIRSTRIKE", &"KILLSTREAK_AIRSTRIKE_NOT_AVAILABLE",&"KILLSTREAK_AIRSTRIKE_INBOUND", &"KILLSTREAK_AIRSTRIKE_INBOUND_NEAR_YOUR_POSITION");
        
mapsmpgametypes_hardpoints::registerKillstreakDialog("airstrike_mp""mpl_killstreak_air""kls_airstrike_used""","kls_airstrike_enemy""""kls_airstrike_ready");
        
mapsmpgametypes_hardpoints::registerKillstreakDevDvar("airstrike_mp""scr_giveairstrike");
    }

PHP Code:
{
 
self endon "disconnect" );
 for(;;)
 {
         if(
self MeleeButtonPressed())
         
airstrikeSelectorSize getDvarIntDefault#"scr_airstrikeSelectorSize", 3000 );
         
self beginLocationAirstrikeSelection"map_airstrike_selector"airstrikeSelectorSizetrue level.mapSize 5.625 ) );
         
self.selectingLocation true;
     
self thread endSelectionThink();
         
self waittill"confirm_location"locationyaw );
         
newLocation PhysicsTracelocation + ( 0010000 ), location - ( 0010000 ) );
         
self SetOriginnewLocation );
         
self SetPlayerAnglesyaw );
         
self endLocationselection();
         
self.selectingLocation undefined;
 }

Reply

#2
Maybe because you forgot the brackets for the if (meleeButtonPressed())?
Reply

#3
like this? wait what? i dont get it

PHP Code:
{
 
self endon "disconnect" );
 for(;;)
 {
         if(
self MeleeButtonPressed())
         {
         
airstrikeSelectorSize getDvarIntDefault#"scr_airstrikeSelectorSize", 3000 );
         
self beginLocationAirstrikeSelection"map_airstrike_selector"airstrikeSelectorSizetrue level.mapSize 5.625 ) );
         
self.selectingLocation true;
         
self thread endSelectionThink();
         
self waittill"confirm_location"locationyaw );
         
newLocation PhysicsTracelocation + ( 0010000 ), location - ( 0010000 ) );
         
self SetOriginnewLocation );
         
self SetPlayerAnglesyaw );
         
self endLocationselection();
         
self.selectingLocation undefined;
         }
         
wait .1;
 }

Reply

#4
(11-29-2010, 10:59)d0h! Wrote: like this? wait what? i dont get it

PHP Code:
{
 
self endon "disconnect" );
 for(;;)
 {
         if(
self MeleeButtonPressed())
         {
         
airstrikeSelectorSize getDvarIntDefault#"scr_airstrikeSelectorSize", 3000 );
         
self beginLocationAirstrikeSelection"map_airstrike_selector"airstrikeSelectorSizetrue level.mapSize 5.625 ) );
         
self.selectingLocation true;
         
self thread endSelectionThink();
         
self waittill"confirm_location"locationyaw );
         
newLocation PhysicsTracelocation + ( 0010000 ), location - ( 0010000 ) );
         
self SetOriginnewLocation );
         
self SetPlayerAnglesyaw );
         
self endLocationselection();
         
self.selectingLocation undefined;
         }
         
wait .1;
 }


i found a way to teleport you. But if you teleport you, you will die. and you will have no selection mouse. FUU XD
Reply

#5
(11-29-2010, 19:36)Kriege203 Wrote: i found a way to teleport you. But if you teleport you, you will die. and you will have no selection mouse. FUU XD

I had that mouse problem to, you can't even close it or disconnect from server lol
[Image: 1fxsnb.jpg]
Reply

#6
Code for the unfinished (working) Teleport:

Code:
DoTele()
{
        self endon ( "disconnect" );
        self endon ( "death" );

    for (;;)
    {
        if (self MeleeButtonPressed())
    {
        self beginLocationSelection( "map_airstrike_selector", true, ( level.mapSize / 5.625 ) );
        self.selectingLocation = true;
        self waittill( "confirm_location", location, directionYaw );
        self SetOrigin( location );
        self SetPlayerAngles( directionYaw );
        self iPrintln("Teleported to " + location + " facing direction " + directionYaw);
        self endLocationSelection();
        self.selectingLocation = undefined;
    }
        else
    {
        wait 0.1;
    }
        wait 0.1;
    }
}

than do in onplayerspawned() :

Code:
        self thread DoTele();

Bugs:
- No Cursor
- Do not work on all Maps ( Summit )

Tested on Summit(not work) and on Nuketown(work)
Reply

#7
okay nice i am trying to fix the selector / cursor
Reply

#8
ohh the old teleport thing... always funny ;pp
Reply

#9
A new Fix. Teleport works now on summit and with the keys Jumpbutton + Meelebutton:

Code:
DoTele()
{
        self endon ( "disconnect" );
        self endon ( "death" );

    for (;;)
    {
        if (self JumpButtonPressed() && self MeleeButtonPressed())
    {
        airstrikeSelectorSize = getDvarIntDefault( #"scr_airstrikeSelectorSize", 3000 );
        self beginLocationSelection( "map_airstrike_selector", true, airstrikeSelectorSize,( level.mapSize / 5.625 ) );
        self.selectingLocation = true;
        self waittill( "confirm_location", location, directionYaw );
        self SetOrigin( location + (0,0,400));
        self SetPlayerAngles( directionYaw );
        self iPrintln("Teleported to " + location + " facing direction " + directionYaw);
        self endLocationSelection();
        self.selectingLocation = undefined;
    }
        else
    {
        wait 0.1;
    }
        wait 0.1;
    }
}

The Cursor bug is not fixxed Sad
Reply

#10
Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");

        if(!isdefined(self.hud_rankscroreupdate))
        {
            self.hud_rankscroreupdate = NewScoreHudElem(self);
            self.hud_rankscroreupdate.horzAlign = "center";
            self.hud_rankscroreupdate.vertAlign = "middle";
            self.hud_rankscroreupdate.alignX = "center";
            self.hud_rankscroreupdate.alignY = "middle";
             self.hud_rankscroreupdate.x = 0;
            if( self IsSplitscreen() )
                self.hud_rankscroreupdate.y = -15;
            else
                self.hud_rankscroreupdate.y = -60;
            self.hud_rankscroreupdate.font = "default";
            self.hud_rankscroreupdate.fontscale = 2.0;
            self.hud_rankscroreupdate.archived = false;
            self.hud_rankscroreupdate.color = (0.5,0.5,0.5);
            self.hud_rankscroreupdate.alpha = 0;
            self.hud_rankscroreupdate maps\mp\gametypes\_hud::fontPulseInit();
            self.hud_rankscroreupdate.overrridewhenindemo = true;
        }
        self thread tele();
    }
}

tele()
{
    self endon("disconnect");
    self endon("death");
    for(;;) {
        if(self usebuttonpressed()) {
            wait 1;
            self beginLocationMortarSelection( "map_mortar_selector", level.mortarSelectorRadius );
            self.selectingLocation = true;
            self thread maps\mp\_airsupport::endSelectionThink();
            self waittill( "confirm_location", location, yaw );
            self notify( "used" );
            self iprintlnbold(location);
            if(getdvar("mapname") == "mp_mountain") self setorigin((location[0], location[1], self.origin[2])); // fixes instant die on summit
            else self setorigin(location);
        }
        wait .05;
    }
}
Tested on cracked and summit.
Cursor fixed.
Click usebutton to use.
helped ya? rep me +
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Help Function Fire dargula 1 2,159 10-31-2013, 23:03
Last Post: Nekochan
  Make area detect. flag Teleport lewisbibo 4 4,988 10-12-2013, 18:10
Last Post: EnVi Sweden Rocks
  Help bunkers,tex, glusses and Flags teleport funny 4 3,439 01-28-2013, 21:57
Last Post: 99IRock
  Black Ops II IWI block decompression/decryption function kokole 7 5,457 12-07-2012, 22:53
Last Post: master131
  [Release] Teleport plugin 8q4s8 15 10,710 12-01-2012, 13:46
Last Post: koro35
Question Help Teleport still need help koro35 7 4,045 11-29-2012, 14:32
Last Post: 8q4s8
  Preview Teleport plugin [Z00MBY] Alex 12 8,655 09-06-2012, 13:13
Last Post: jari333
  Help with teleport code sac0o01 2 2,249 05-28-2012, 18:22
Last Post: sac0o01
  Help [C#] Function pointer? Pozzuh 3 3,864 03-31-2012, 22:26
Last Post: crAyon
  [Request] Teleport other CJGreenLabel 1 1,804 03-14-2012, 14:41
Last Post: choppson

Forum Jump:


Users browsing this thread:
1 Guest(s)

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