SA-MP Forums Archive
WEAPONSTATE_NO_BULLETS not work - 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: WEAPONSTATE_NO_BULLETS not work (/showthread.php?tid=252016)



WEAPONSTATE_NO_BULLETS not work - whitedragon - 29.04.2011

so i make if bullets goes empty the variable changes but it take my weapon when i get into my hands any clue whats wrong?
http://pastebin.com/tH4xaZXJ


Re: WEAPONSTATE_NO_BULLETS not work - alpha500delta - 29.04.2011

Ehm, weapons dissapear automaticly when they are empty (except when in vehicle)


Re: WEAPONSTATE_NO_BULLETS not work - Finn - 29.04.2011

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
Ehm, weapons dissapear automaticly when they are empty (except when in vehicle)
Wrong.


AW: WEAPONSTATE_NO_BULLETS not work - Nero_3D - 30.04.2011

Yeah they not dissapear, you just cant use them anymore
I dont know much about the function GetPlayerWeaponState but it looks like that it gets the state of your weapon holding and if you shot your last bullet you auto switch to another weapon and so you cant rly obtain this state

But actually why do you need that ?
Just update the ammo if they switch weapon which happens if you reach 0 ammo


Re: WEAPONSTATE_NO_BULLETS not work - GaGlets(R) - 30.04.2011

Код:
1 - WEAPONSTATE_LAST_BULLET
facepalm.


AW: Re: WEAPONSTATE_NO_BULLETS not work - Nero_3D - 30.04.2011

Quote:
Originally Posted by GaGlets®
Посмотреть сообщение
Код:
1 - WEAPONSTATE_LAST_BULLET
facepalm.
Its more or less the same, how often does your weapon has the LAST bullet ?

And how long if you use it ? Maybe a 1/4 sec :/

You will only get the sate if you are lucky and stop shooting with that last bullet
Or you call it permanently in OnPlayerUpdate


Re: WEAPONSTATE_NO_BULLETS not work - GaGlets(R) - 30.04.2011

script will check it anyway, test it with `print` At onplayerupdate, onplayerkeystatechange etc. Of course it may not check for it if you use quite slow timer.


AW: WEAPONSTATE_NO_BULLETS not work - Nero_3D - 30.04.2011

Yeah I know that it will but you need to get it with the function

And OnPlayerKeyStateChange only gets called if you change the key and that doesnt happen if you press the keys permanent (if you shoot)

And I try to avoid using OnPlayerUpdate for anything what isnt necessary


Re: WEAPONSTATE_NO_BULLETS not work - whitedragon - 30.04.2011

any idea how it make works correctly