OnPlayerFall

Started by Nihongo^, Jul 23, 2023, 07:40 AM

Previous topic - Next topic

Nihongo^

In 0.3, there's a function named "OnPlayerFall."

when a player fell down ( from the building or someone shot him with Stuby or shotgun etc.)

I just realized that 0.4 no longer supports it; I would like to ask if there is any alternative to this function.

I use it, but nothing seems to appear.


}
function onPlayerFall(player)
{
    MessagePlayer("You fall down");
}

 

Nihongo^


habi

Quote from: vitovc on Jul 23, 2023, 01:33 PMfunction onPlayerActionChange(player, old_action, new_action){
  if(42 == new_action){
    ::MessagePlayer("You fall down", player);
  }
}
Why you used :: ?
I think it is not needed as you are not inside any class.

Nihongo^

#3
Quote from: vitovc on Jul 23, 2023, 01:33 PMnot works as fall from building but works with bike fall or explosion fall
function onPlayerActionChange(player, old_action, new_action){
  if(42 == new_action){
    ::MessagePlayer("You fall down", player);
  }
}
Thanks its work,
There's a lot of action id's
may i know the list?

newAction == 12
newAction == 13
and what to do for falling from buildings?
etc

habi

Quote from: vitovc on Jul 24, 2023, 06:42 AMmaybe but usually I code as objects/tables so I keep using :: for everything from root table, also for global variables in functions/events. I think it should be faster since its not looking for local one before.
oh okay

2b2ttianxiu

maybe i can make a good combat tracker and then detect death evade or death message