Just a small idea that shows how to see if a player is falling. The 'speed' isn't actually the real speed because it's not accurate. Because even if the player stopped falling, it still shows the last highest speed until it's reset. A more frequent timer should fix that with the added 'bonus' of more computation required. But the function that the timer calls is very lightweight and I doubt a faster timer would do any harm.
local g_PlayerFallAccum = array(GetMaxPlayers(), 0.0);
function onPlayerFall(player, speed)
{
print(player.Name + " is falling with speed " + speed);
}
function onPlayerMove(player, px, py, pz, cx, cy, cz)
{
// Get the speed to avoid too many table lookups
local speed = g_PlayerFallAccum[player.ID];
// Update the accumulated speed
speed += pz > cz ? pz - cz : 0.0;
// Check the accumulated speed
if (speed > 1.0) onPlayerFall(player, speed);
// Save the accumulated speed
g_PlayerFallAccum[player.ID] = speed;
}
function _PlayerFallResetFunc()
{
g_PlayerFallAccum.apply(@(v) 0.0);
}
local _PlayerFallResetTimer = NewTimer("_PlayerFallResetFunc", 1000, 0);
Have phun ;D
All we need now is a Height meter like in San Andreas.
(and maybe a parachute, using custom vehicle, and the bag, using custom weapon)
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FZ73RwPJ.jpg&hash=c1d5539cc659824875bea256ad6f69cd90fb5082)
Quote from: sseebbyy on Jul 17, 2015, 11:16 AMAll we need now is a Height meter like in San Andreas.
(and maybe a parachute, using custom vehicle, and the bag, using custom weapon)
What about using a custom weapon (hat), using a model of a parachute?
Then all we need is to set player's gravity and we'd have some sort of parachute
Parachute? No problemo
- custom weapon to have parachute above the head,
- altimeter by using sprites,
- controlling the parachute by pressing keys.
No vehicle required.
Back to the topic. This snippet script can be used to detect if player is using some external software like teleporting or speed hacks. Ofc we need to remember that while setting player's position, it's needed to set some value to stop detecking player's speed for a moment.
Quote from: Gudio on Jul 17, 2015, 12:26 PMNo vehicle required.
There is no player.Gravity function in 0.4, so for a more real feeling you will need a vehicle that has weight and handling. ( a car with FlyingMode on )
Also, you can remove the "parachute" when the vehicle is damaged. ( with some sort of colision, it will be damaged even when touching the land )
No keybinds required.
Also, I believe you can use proper animations.
PS: if you are going to create that altimeter, enable it for helicopter/planes too. :)
so Gudio when are u posting that system?? xD
Don't post shit, if u think u r a good scripter, then go script, I dare that u can't even make a countdown cmd
Quote from: [VSS]Shawn on Jul 17, 2015, 01:52 PMso Gudio when are u posting that system?? xD
Stop entering conversations you can't understand you noobs.
Quote from: sseebbyy on Jul 17, 2015, 01:52 PMThere is no player.Gravity function in 0.4
You should post that in the suggestions board, it should've been a compatibility function (as in 0.3) already imo
Insulting replies removed. Keep it nice. Keep it clean.
Quote from: Thijn on Jul 17, 2015, 07:02 PMInsulting replies removed. Keep it nice. Keep it clean.
I just showed a reality, anyway as I said in my previous reply here, This could be useful, I have some ideas that will need the use of this function ;)