Question about weapon
#1

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
Reply
#2

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

No it won't.
Reply
#4

It will get the only the weapon not the ammo
Reply
#5

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
Reply
#6

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.
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)