Jump to content

misco

Members
  • Posts

    5
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by misco

  1. Sup,

    i would consider rage mp's PlayerDamage event more like some kind of 'PlayerHealthChange' event. It is emitted when players health decreases. There is an idea to be tested(i am not sure if available functions work) once PlayerDamage triggered

    • entity.hasBeenDamagedBy(entity2, p2);  - cycle through all players/vehicle entities used by players eventually and try to find entity that damaged the player for who is PlayerDamage event triggered
    • player.getLastDamageBone(outBone); - optionally get last damaged bone

    and work with obtained data, then always clear damage data with these:

    • player.clearLastDamageBone();
    • entity.clearLastDamage();

     

    This is just an idea how you could achieve this, i do not have time to test it in game currently. Good luck

     

  2. No,

    did some quick test getClosestVehicle returned for me typeof(thenearestVehicle) is number and JSON.stringify(thenearestVehicle) is 7682 which i consider to be handle id. When you add some more test code from wiki for example

    testob.setTyreBurst(0, false, 1000);
    testob.setTyreBurst(1, false, 1000);
    testob.setTyreBurst(4, false, 1000);
    testob.setTyreBurst(5, false, 1000);

    you will see that the closest vehicle has all tires popped but did not explode, because .explode() method does not seem to be working even trying example from wiki

    if( commandName === "exptest")
    {
      var vehicle = mp.vehicles.new(989294410, localPlayer.position); //Spawns Voltic2 at 'player' position
      vehicle.explode();
    }

    car was spawned without explosion in current 0.3.5 release. So stuff with atHandle mentioned earlier is the right way to do this

     

    edit: btw i made it explode using

    testob.explodeInCutscene(true);

     

    • Like 1
  3. Might be worth trying to use

    let vehicleAct = mp.vehicles.atHandle(closestVehicle);

    These native functions return object handle id more likely than id in pool, also ive noticed that handle id changes when entity streams out and in.

    • Like 2
×
×
  • Create New...