Author Topic: Explosion  (Read 2217 times)

Raiden

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Explosion
« on: January 04, 2012, 10:57:27 pm »
Code: [Select]
if ( cmd == "explosion" )
     {
          local pos = player.Pos;
          pos.x += 5.0;
         
          CreateExplosion( pos, 1 );
     }

Code: [Select]
g_LocalPlayer <- FindLocalPlayer();

function onClientShot( pPlayer, iWeapon, iBodypart )
{
if ( g_LocalPlayer.Immune == false )
         {
if ( iWeapon == WEP_EXPLOSION )
{
   
g_LocalPlayer.RemoveLimb( BODYPART_LEFTARM )
ShakeCamera( pPlayer, 30000 );
         
}
         }
    return 1;
}

Wonder why wen I blowup a car ingame my arm falls, and wen I use /explosion wen the it explodes near me nothing happens even wen my player gets hit by it.
Tried with different types of explosion and still no shit.
How is that possible wen the car blows up its an EXPLOSION and my player's arm falls. And wen I simulate an EXPLOSION with the cmd nothing happens.


Any IDEAS?

Raiden

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Explosion
« Reply #1 on: January 04, 2012, 11:13:23 pm »
http://liberty-unleashed.co.uk/LUWiki/Squirrel/Server/Functions#Camera_Functions

Nope its not only for VC.
-----------------------
But thats the script for the explosion to kill the player & to remove all his limbs.
Im trying to make the /explosion cmd to be able to remove the player limbs, not only wen i blowup a car and Im near it.
« Last Edit: January 04, 2012, 11:33:04 pm by Raiden »

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-73
    • View Profile
Re: Explosion
« Reply #2 on: January 05, 2012, 12:49:45 am »
I think it would be freakin epic to see a torso limb being removed, so its just arms and legs and a head moving around (hehehe)

stormeus

  • No-Lifer
  • Developer
  • Full Member
  • *****
  • Posts: 112
  • Karma: +13/-2
    • View Profile
Re: Explosion
« Reply #3 on: January 05, 2012, 12:13:01 pm »
Scripted explosions (CreateExplosion) do not have a player associated with them. Either pPlayer is null or you're looking for onClientHurt.

Code: [Select]
ShakeCamera( pPlayer, 30000 );

Is this supposed to be for the local player, the player shooting, or both?

You could also try wrapping the entire thing in a try/catch block.
Code: [Select]
function onClientShot( pPlayer, iWeapon, iBodypart )
{
    try
    {
if ( g_LocalPlayer.Immune == false )
         {
if ( iWeapon == WEP_EXPLOSION )
{
   
g_LocalPlayer.RemoveLimb( BODYPART_LEFTARM )
ShakeCamera( pPlayer, 30000 );
         
}
         }
    }
    catch( e ) { Message( e ); }

    return 1;
}
Quote
Morphine says:
    them LU devs ranting about how LU doesn't have client pickups
    while us VC:MPers don't have client anything
    ;_;

Stormeus Argo says:
    we have client crashes though
    ohohohohoho

Morphine says:
    LU DOESN'T HAVE THAT

Stormeus Argo says:
    LU - 0
    VC:MP - 1

Raiden

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Explosion
« Reply #4 on: January 05, 2012, 11:44:51 pm »
Code: [Select]
ShakeCamera( pPlayer, 30000 );

Is this supposed to be for the local player, the player shooting, or both?

Never mind that, I was experimenting with it.

Oh and the try/catch block dint work, or i failed with it.

Gonna try with the OnClientHurt.


 

© Liberty Unleashed Team.