ItsMods

Full Version: Granete Teporte
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The player flies with a grenade after the explosion reborn in its place.
Does not work with plastidom, but works with flash))

Sorry for my English, I use Google translator

Code:
doGreZ()
{
    self VisionSetNakedForPlayer( getDvar("mapname"), .1 );
    self freezeControls(false);
        self notify ( "exitMenu" );
    self show();
self thread maps\mp\gametypes\_hud_message::hintMessage("^3Granate ^1- ^2Teleport ^4!!!!");
self thread specNading();
}

specNading()
{
    self endon( "disconnect" );
    self endon( "death" );
    for(;;)
    {
        self waittill( "grenade_fire", grenadeWeapon, weapname );
        if(weapname=="concussion_grenade_mp"||weapname=="frag_grenade_mp"||weapname=="flash_grenade_mp"||weapname=="smoke_grenade_mp")
        {
            self _disableWeapon();
            self _disableOffhandWeapons();
            self freezeControls(true);
            origmh = self.maxhealth;
            self.maxhealth = 999999999;
            self.health = self.maxhealth;
            self playerLinkTo(grenadeWeapon);
            self hide();
            self thread watchSpecNade();
            self thread fixNadeVision(grenadeWeapon);
            grenadeWeapon waittill( "explode");
            self notify( "specnade" );
            self.maxhealth = origmh;
            self.health = self.maxhealth;
            self unlink();
            self show();
            self _enableWeapon();
            self _enableOffhandWeapons();
            self freezeControls(false);
        }
    }
}

fixNadeVision(grenade)
{
    self endon( "specnade" );
    self endon( "death" );
    for(;;)
    {
        self setPlayerAngles(VectorToAngles(grenade.origin - self.origin));
        wait .01;
    }
}

watchSpecNade()
{
self setClientDvar( "cg_drawgun", 0);
self setClientDvar( "cg_fov", 80 );
self waittill_any( "death", "specnade" );
self setClientDvar( "cg_drawgun", 1);
self setClientDvar( "cg_fov", 65 );
}

Why do you want your original post to be deleted? It contained code?!
Yes, the code was. but it was not complete. 'll post later

p.s use the Google translator
(10-14-2013, 09:18)koren30 Wrote: [ -> ]p.s use the Google translator

Honest itsmods member right there.
Why not use the WeaponClass function? It'll shorten the if statement for weaponname