A small question for a whole topic(how to check if a player is using an certain anim?) - 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: A small question for a whole topic(how to check if a player is using an certain anim?) (
/showthread.php?tid=261216)
A small question for a whole topic(how to check if a player is using an certain anim?) -
justsomeguy - 12.06.2011
Hey i was wondering if it is possible to check if someone is using a certain anim.
Also i would like to know wich anim is the one from freefalling?(like falling from a building)
Anyway, why would i need that well i am trying to make a function called IsPlayerFalling, but for that i need to check the anim for the freefall, if anyone can help that would be realy apreciated!
EDIT:
Oke what could be wrong with this?(besides everything lol:
pawn Код:
stock IsPlayerFreeFalling(playerid)
{
if(GetPlayerAnimationIndex(playerid))
{
new animlib[1130];
new animname[1130];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,1130,animname,1130);
GivePlayerWeapon(playerid, 46, 1);
}
return 1;
}
Because it gives this error:
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\pawno\include\PFN.inc(73) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Re: A small question for a whole topic(how to check if a player is using an certain anim?) -
Stigg - 12.06.2011
pawn Код:
GetPlayerAnimationIndex(playerid);
https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex
Example of usage:
pawn Код:
public IsPlayerUsingParachute(playerid)
{
new index = GetPlayerAnimationIndex(playerid);
return (index >= 963 && index <= 979);//true if player is falling with an opened parachute
}
pawn Код:
public IsPlayerSkydiving(playerid)
{
new index = GetPlayerAnimationIndex(playerid);
return (index >= 958 && index <= 962);//true if player is falling with a closed parachute
}
Adjust to suit your needs.
Re: A small question for a whole topic(how to check if a player is using an certain anim?) -
justsomeguy - 12.06.2011
Oke sow but now i see those numbers how to use these? Wich number is for the falling?(i mean this: animlib: PED Anim: FALL_fall).
Re: A small question for a whole topic(how to check if a player is using an certain anim?) -
alpha500delta - 12.06.2011
Quote:
Originally Posted by justsomeguy
Oke sow but now i see those numbers how to use these? Wich number is for the falling?(i mean this: animlib: PED Anim: FALL_fall).
|
You can use the code in the wiki, it will give you the name+the number.
Re: A small question for a whole topic(how to check if a player is using an certain anim?) -
justsomeguy - 12.06.2011
Yes but how do i find the numbers that are needed for the anim?
Re: A small question for a whole topic(how to check if a player is using an certain anim?) -
Donya - 12.06.2011
Tada!
Re: A small question for a whole topic(how to check if a player is using an certain anim?) -
justsomeguy - 12.06.2011
Thanks!! That helped me out so bad!