Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Nihongo^ on Jul 23, 2023, 07:40 AM

Title: OnPlayerFall
Post by: Nihongo^ on Jul 23, 2023, 07:40 AM
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");
}

 
Title: Re: OnPlayerFall
Post by: Nihongo^ on Jul 23, 2023, 12:32 PM
any one can help ?
Title: Re: OnPlayerFall
Post by: habi on Jul 23, 2023, 02:03 PM
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.
Title: Re: OnPlayerFall
Post by: Nihongo^ on Jul 23, 2023, 02:44 PM
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
Title: Re: OnPlayerFall
Post by: habi on Jul 24, 2023, 07:31 AM
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
Title: Re: OnPlayerFall
Post by: 2b2ttianxiu on Aug 11, 2023, 01:10 AM
maybe i can make a good combat tracker and then detect death evade or death message