Detecting opened parachute - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Detecting opened parachute (
/showthread.php?tid=216946)
Detecting opened parachute -
cmg4life - 26.01.2011
To detect an opened parachute i could use GetPlayerWeaponState ? Also which state would that be ? Or Animations ?
Re: Detecting opened parachute -
OldDirtyBastard - 26.01.2011
use GetPlayerWeapon and OnPlayerKeyStateChange with KEY_FIRE
Re: Detecting opened parachute -
cmg4life - 26.01.2011
It's not too accurate...
Re: Detecting opened parachute -
Sasino97 - 26.01.2011
Код:
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?
Re: Detecting opened parachute -
Vince - 26.01.2011
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.
Re: Detecting opened parachute -
cmg4life - 26.01.2011
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
Re: Detecting opened parachute -
OldDirtyBastard - 26.01.2011
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
Re: Detecting opened parachute -
cmg4life - 26.01.2011
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.
Re: Detecting opened parachute -
Mean - 07.02.2011
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
Re: Detecting opened parachute -
-Rebel Son- - 07.02.2011
What mean said, Detect the Animation, it would be the most accurate.
#Off Topic: CMG i love your work