Better Vehicle Explosions

Started by KadirYigit, Jul 18, 2020, 02:13 AM

Previous topic - Next topic

KadirYigit

I tried make a script that improves explosions of cars. Im a new scripter so this can be improved by community.

Video: https://youtu.be/P_Kw0lhgcw0


Scripts:

[spoiler]

--This script uses classes.--

 class PlayerStats
  {
  patlama = false;
  }


 function onVehicleExplode( vehicle )
  {
   CreateExplosion( vehicle.World, 1, vehicle.Pos, -1, true )
   local i =0;
   local nearplr;
   local distance;
   for( i=0;i<100;i++)
       {
          nearplr=FindPlayer(i);
          distance = DistanceFromPoint( nearplr.Pos.x, nearplr.Pos.y, vehicle.Pos.x, vehicle.Pos.y );
          if( distance < 16 )
          {
            if(nearplr)
            {
               Player.CanAttack = false;
               stats[nearplr.ID].patlama = true;
               NewTimer("kamerapatlama", 1300, 1, nearplr.ID);
               nearplr.SetAnim(0,126);
               nearplr.SetDrunkLevel( 100, 100 );
            }
            if (!distance)
            {
          return false;
          }
      }
   }
  }


  function kamerapatlama( player )
  {
   player = FindPlayer( player );
  if ( player )
  {
  stats[ player.ID ].patlama = false;
  Player.CanAttack = true;
  player.SetDrunkLevel( 0, 0 );
  }
  }

[/spoiler]
KadirYigit#6161

Sebastian

Improving the explosion?  The idea itself is great

KrOoB_


Sonmez

if (!perfect) createAgain();

KadirYigit

KadirYigit#6161