SA-MP Forums Archive
IsPlayerReloading? - 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: IsPlayerReloading? (/showthread.php?tid=187248)



IsPlayerReloading? - The_Moddler - 01.11.2010

How can I check if a player is reloading, or at least, to check if he's ammo is 0..

GetPlayerAmmo only works with the entire ammo, I need the current ammo.

Thanks.


Re: IsPlayerReloading? - Angelus~ - 01.11.2010

umm im not exactly sure if this would work, but since the new release of SAMP 0.3B, can't you check the player's current animation?
GetPlayerAnimationIndex(playerid);
This was how people created a "IsPlayerSwimming" function, so im assuming you can do it to for reloading


Re: IsPlayerReloading? - The_Moddler - 01.11.2010

Quote:
Originally Posted by Angelus~
Посмотреть сообщение
umm im not exactly sure if this would work, but since the new release of SAMP 0.3B, can't you check the player's current animation?
GetPlayerAnimationIndex(playerid);
This was how people created a "IsPlayerSwimming" function, so im assuming you can do it to for reloading
I tryed it, shooting or reloading is always the same, I can't remember wich one was, I think it is 1647 or something close.

So if anyone knows a function or an idea, it will be welcomed


Re: IsPlayerReloading? - Jefff - 01.11.2010

pawn Код:
#define WEAPONSTATE_UNKNOWN             -1
#define WEAPONSTATE_NO_BULLETS          0
#define WEAPONSTATE_LAST_BULLET         1
#define WEAPONSTATE_MORE_BULLETS        2
#define WEAPONSTATE_RELOADING           3

GetPlayerWeaponState(playerid);



Re: IsPlayerReloading? - The_Moddler - 02.11.2010

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
#define WEAPONSTATE_UNKNOWN             -1
#define WEAPONSTATE_NO_BULLETS          0
#define WEAPONSTATE_LAST_BULLET         1
#define WEAPONSTATE_MORE_BULLETS        2
#define WEAPONSTATE_RELOADING           3

GetPlayerWeaponState(playerid);
Woop thanks!!