• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help fx
#1
Hey guys i have a question.Big Grin
Can i spawn fx on shot?
for example with desert eagle i shot an explosion or a green flare?Huh
  Reply
#2
Yes, it's possible.
Use SpawnFX/TriggerFX to set coordinates, or just playfx.
C++/Obj-C developer. Neko engine wip
Steam: Click
  Reply
#3
can you explain for me i am stupid for fx things?Big Grin
  Reply
#4
Code:
init()
{
    level.gDeagleFX["impact"] = loadfx ("explosions/helicopter_explosion_secondary_small");
    level.goldDeagleWeapon = "deserteaglegold_mp";
    level thread onPlayerConnected();
}

onPlayerConnected()
{
    for( ;; )
    {
        level waittill( "connected", player );
        player thread explode();
    }
}

//Deagle "Boom" effect
explode()
{
    for(;;)
    {
        self waittill( "weapon_fired", weaponName );
        if( self getCurrentWeapon() != level.goldDeagleWeapon )
            continue;
            
        forward = self getTagOrigin("j_head");
        end = self getTagOrigin( "tag_eye" ) + vecscale( anglestoforward( self getPlayerAngles() ), 100000 );
        SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
        playfx(level.gDeagleFX["impact"], SPLOSIONlocation);
        RadiusDamage( SPLOSIONlocation, 100, 500, 100, self );
    }
}

vecscale( vec, scalar )
{
    return ( vec[0] * scalar, vec[1] * scalar, vec[2] * scalar );
}
Don't remember who made this...
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
[-] The following 1 user says Thank You to DidUknowiPwn for this post:
  • 26hz
  Reply
#5
(12-17-2013, 18:49)DidUknowiPwn Wrote:
Code:
init()
{
    level.gDeagleFX["impact"] = loadfx ("explosions/helicopter_explosion_secondary_small");
    level.goldDeagleWeapon = "deserteaglegold_mp";
    level thread onPlayerConnected();
}

onPlayerConnected()
{
    for( ;; )
    {
        level waittill( "connected", player );
        player thread explode();
    }
}

//Deagle "Boom" effect
explode()
{
    for(;;)
    {
        self waittill( "weapon_fired", weaponName );
        if( self getCurrentWeapon() != level.goldDeagleWeapon )
            continue;
            
        forward = self getTagOrigin("j_head");
        end = self getTagOrigin( "tag_eye" ) + vecscale( anglestoforward( self getPlayerAngles() ), 100000 );
        SPLOSIONlocation = BulletTrace( forward, end, 0, self )[ "position" ];
        playfx(level.gDeagleFX["impact"], SPLOSIONlocation);
        RadiusDamage( SPLOSIONlocation, 100, 500, 100, self );
    }
}

vecscale( vec, scalar )
{
    return ( vec[0] * scalar, vec[1] * scalar, vec[2] * scalar );
}
Don't remember who made this...

it didn't work so i modified it a bit and work now... thank you Big Grin
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)