SA-MP Forums Archive
Question about weapon - 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)
+--- Thread: Question about weapon (/showthread.php?tid=568110)



Question about weapon - HeLLeR - 19.03.2015

Hello, I've got a question that I need a precise answer at. If a player has a weapon and he shot all the bullets so that the weapon disappears from his hand, will the function...
pawn Код:
GetPlayerWeapon(playerid);
... get his weapon? I must mention that the player only has a single weapon, with 0 ammo


AW: Question about weapon - Kaliber - 19.03.2015

This function only get the weapon, if the player has the weapon in his hand...


Re: Question about weapon - DeitY - 19.03.2015

No it won't.


Re: Question about weapon - fuckingcruse - 19.03.2015

It will get the only the weapon not the ammo


Re: Question about weapon - davve95 - 19.03.2015

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
It will get the only the weapon not the ammo
Have you checked the Wiki?
https://sampwiki.blast.hk/wiki/GetPlayerWeapon


Re: Question about weapon - HeLLeR - 20.03.2015

I was confused because of another scripting feature, which is the weapon state ( weapon state 0 meant the weapon has no bullets, and if it has no bullets it should disappear.Yet, if you don't have the weapon in your hand, how can it get its state? ) Anyway, thank you for your answers.


Re: Question about weapon - Vince - 20.03.2015

Quote:
Originally Posted by HeLLeR
Посмотреть сообщение
weapon state 0 meant the weapon has no bullets, and if it has no bullets it should disappear.Yet, if you don't have the weapon in your hand, how can it get its state?
This is for weapons that use first person view such as the sniper and the rocket launcher. If you shoot all ammo while remaining in aiming mode, you will hear a click if you try to shoot, indicating you're out of ammo. As soon as you release RMB (and leave first person mode) the weapon will then disappear.