![]() |
|
[Release] teleport function - Printable Version +- ItsMods (https://www.itsmods.com) +-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html) +--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html) +--- Thread: [Release] teleport function (/Thread-Release-teleport-function.html) Pages:
1
2
|
teleport function - d0h! - 11-29-2010 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";
precacheModel( level.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", ::useKillstreakAirstrike, true);
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", airstrikeSelectorSize, true ( level.mapSize / 5.625 ) );
self.selectingLocation = true;
self thread endSelectionThink();
self waittill( "confirm_location", location, yaw );
newLocation = PhysicsTrace( location + ( 0, 0, 10000 ), location - ( 0, 0, 10000 ) );
self SetOrigin( newLocation );
self SetPlayerAngles( yaw );
self endLocationselection();
self.selectingLocation = undefined;
}
}
RE: importing teleport function from mw2 into bo - help - Deathmax - 11-29-2010 Maybe because you forgot the brackets for the if (meleeButtonPressed())? RE: importing teleport function from mw2 into bo - help - d0h! - 11-29-2010 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", airstrikeSelectorSize, true ( level.mapSize / 5.625 ) );
self.selectingLocation = true;
self thread endSelectionThink();
self waittill( "confirm_location", location, yaw );
newLocation = PhysicsTrace( location + ( 0, 0, 10000 ), location - ( 0, 0, 10000 ) );
self SetOrigin( newLocation );
self SetPlayerAngles( yaw );
self endLocationselection();
self.selectingLocation = undefined;
}
wait .1;
}
}
RE: importing teleport function from mw2 into bo - help - Kriege203 - 11-29-2010 (11-29-2010, 10:59)d0h! Wrote: like this? wait what? i dont get it i found a way to teleport you. But if you teleport you, you will die. and you will have no selection mouse. FUU XD RE: importing teleport function from mw2 into bo - help - 4FunPlayin - 11-29-2010 (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 RE: importing teleport function from mw2 into bo - help - Kriege203 - 11-29-2010 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) RE: importing teleport function from mw2 into bo - help - d0h! - 11-29-2010 okay nice i am trying to fix the selector / cursor RE: importing teleport function from mw2 into bo - help - TheSaboteur - 11-29-2010 ohh the old teleport thing... always funny ;pp RE: importing teleport function from mw2 into bo - help - Kriege203 - 11-29-2010 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
RE: importing teleport function from mw2 into bo - help - met94 - 11-30-2010 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;
}
}Cursor fixed. Click usebutton to use. |