Difference between revisions of "0490"

From GTAMods Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
{{Icon|VC}} '''HAS_PLAYER_GOT_WEAPON'''
+
{{OpCode
<hr />
+
| games      = {{Icon|VC}}
'''Description'''
+
| command    = HAS_PLAYER_GOT_WEAPON
: Checks if the player has the specified weapon
+
| description = Checks if the player has the specified weapon
'''Syntax'''
+
| syntax1    = 0490: &nbsp; player [''player handle''] has_weapon [''int'']
: 0490: &nbsp; player [''player handle''] has_weapon [''int'']
+
| p1t        = [''player handle'']
'''Parameter'''
+
| p1d        = The [[0053|handle of the player]]
: [''player handle'']
+
| p2t        = [''int'']
:: The [[0053|handle of the player]]
+
| p2d        = [[Weapon#Vice City|Weapon number]]
: [''int'']
+
}}
:: [[Weapon#Vice City|Weapon number]]
 
  
This conditional opcode returns true if you have the specified weapon. It will remain true if you run out of ammo for that weapon and have not replaced it with another weapon of the same group unless you are wasted or busted. Do not use weapon number ''0'' because it does not actually check if you have a fist so it produces a meaningless result. This opcode is [[List of unsupported opcodes|unsupported]] in [[San Andreas]] and is superseded by opcode [[0491]].
+
This conditional opcode returns true if you have the specified weapon. It will remain true if you run out of ammo for that weapon and have not replaced it with another weapon of the same group unless you are wasted or busted. Do not use weapon number ''0'' because it does not actually check if you have a fist so it produces a meaningless result.
  
 
== Keywords ==
 
== Keywords ==
 
has, player, got, weapon
 
has, player, got, weapon
  
[[Category:OpCodes]]
+
== See also ==
 +
* {{Icon|SA}} [[0491]], checks if the character has the specified weapon

Revision as of 13:38, 21 December 2016

Vice City HAS_PLAYER_GOT_WEAPON


Description
Checks if the player has the specified weapon
Syntax
0490:   player [player handle] has_weapon [int]
Parameter
[player handle]
The handle of the player
[int]
Weapon number

This conditional opcode returns true if you have the specified weapon. It will remain true if you run out of ammo for that weapon and have not replaced it with another weapon of the same group unless you are wasted or busted. Do not use weapon number 0 because it does not actually check if you have a fist so it produces a meaningless result.

Keywords

has, player, got, weapon

See also

  • San Andreas 0491, checks if the character has the specified weapon