Difference between revisions of "Pl chk item2"
From Unofficial QEdit Wiki Guide
(Created page with "==Syntax== ''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:green'>pl_chk_item2</span> register output</span> * register = Starting register in...") |
(→Example) |
||
Line 14: | Line 14: | ||
<span style='color:blue'> </span><span style='color:green'>leti </span>R42 00000004 | <span style='color:blue'> </span><span style='color:green'>leti </span>R42 00000004 | ||
<span style='color:blue'> </span><span style='color:green'>leti </span>R43 0000000C | <span style='color:blue'> </span><span style='color:green'>leti </span>R43 0000000C | ||
− | <span style='color:blue'> </span><span style='color:green'> | + | <span style='color:blue'> </span><span style='color:green'>pl_chk_item2 </span>R40 R200 <span style='color:orange'>//Check for the Charge Vulcan as denoted by register R40 (through 43) and store the result in R200</span> |
<span style='color:blue'> </span><span style='color:green'>jmpi_!= </span>R200, FFFFFFFF, 101 <span style='color:orange'>//If R200 is NOT equal to -1 go to function 101 | <span style='color:blue'> </span><span style='color:green'>jmpi_!= </span>R200, FFFFFFFF, 101 <span style='color:orange'>//If R200 is NOT equal to -1 go to function 101 | ||
<span style='color:green'> ret </span> | <span style='color:green'> ret </span> |
Revision as of 23:54, 21 June 2022
Contents
Syntax
Syntax: pl_chk_item2 register output
- register = Starting register in a set of 4, this denotes the weapon you are checking for.
- output = The register the output of the check is stored in. Returns FFFFFFFF if no item was found, otherwise returns the slot number.
Use
Use to check for an item in inventory. This checks the inventory of the player who triggers/encounters this script. IE: If player 1 presses a button that fires the function, it checks their inventory.
Example
100: leti R40 00000000 options //Sets these registers to 3 bytes of 00 45 01 this denotes the Snow Queen
leti R41 00000008
leti R42 00000004
leti R43 0000000C
pl_chk_item2 R40 R200 //Check for the Charge Vulcan as denoted by register R40 (through 43) and store the result in R200
jmpi_!= R200, FFFFFFFF, 101 //If R200 is NOT equal to -1 go to function 101
ret