Detecting opened parachute
#1

To detect an opened parachute i could use GetPlayerWeaponState ? Also which state would that be ? Or Animations ?
Reply
#2

use GetPlayerWeapon and OnPlayerKeyStateChange with KEY_FIRE
Reply
#3

It's not too accurate...
Reply
#4

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  new Float:x,Float:y,Float:z;
  GetPlayerPos(playerid,x,y,z);
  if(newkeys == KEY_FIRE && GetPlayerWeapon(playerid) == WEAPON_PARACHUTE && z > /* (MINIMUM HEIGHT)*/)
  {
     OnPlayerOpenParachute(playerid);
  }
  return 1;
}

public OnPlayerOpenParachute(playerid)
{
  [...]
}
Try this, it should work.

EDIT: Wait, if a player is on a high place, and clicks with that weapons there can be errors....
There is no a solution. For what do you need it?
Reply
#5

I think you can get it pretty accurate with GetPlayerAnimationIndex and/or GetPlayerAnimationName. You'll have to find the right values though, so test it ingame and print the animation number.
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
I think you can get it pretty accurate with GetPlayerAnimationIndex and/or GetPlayerAnimationName. You'll have to find the right values though, so test it ingame and print the animation number.
That's what i did, i actually took the whole PARACHUTE library... XD
Reply
#7

Quote:
Originally Posted by cmg4life
Посмотреть сообщение
It's not too accurate...
Oh im sorry then, i just saw your "High-Roller" status so i thoud you only need the idea
Reply
#8

Quote:
Originally Posted by OldDirtyBastard
Посмотреть сообщение
Oh im sorry then, i just saw your "High-Roller" status so i thoud you only need the idea
Indeed, i just need the idea, but your idea was kinda inaccurate.
Reply
#9

By mauzen:
pawn Код:
stock IsPlayerUsingParachute(playerid)
{
    new index = GetPlayerAnimationIndex(playerid)
    return (index >= 963 && index <= 979);
}
I just remembered this topic when I looked @ this:
https://sampforum.blast.hk/showthread.php?tid=222585
Reply
#10

What mean said, Detect the Animation, it would be the most accurate.

#Off Topic: CMG i love your work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)