Difference between revisions of "Take slot meseta"
From Unofficial QEdit Wiki Guide
(→Syntax) |
(→Use) |
||
Line 15: | Line 15: | ||
NOTE* | NOTE* | ||
This opcode has a hidden register used. | This opcode has a hidden register used. | ||
+ | |||
First register is slot number. | First register is slot number. | ||
+ | |||
Next register in line after first register (say R1 was used, R2 would be next) is the amount of meseta to take. | Next register in line after first register (say R1 was used, R2 would be next) is the amount of meseta to take. | ||
+ | |||
Third Register is if meseta was successfully taken. | Third Register is if meseta was successfully taken. | ||
Latest revision as of 17:11, 4 December 2022
Contents
Syntax
Syntax: take_slot_meseta register1, register2
- register1 = Starts a series of 2 registers, first being slot number, 2nd being meseta to be taken.
- register2 = Register to act as the check if player has already had meseta taken.
00000000 = Meseta not taken.
00000001 = Meseta has been taken.
Use
Used to take meseta from the players inventory. Also sets a register when the meseta has been taken.
NOTE* This opcode has a hidden register used.
First register is slot number.
Next register in line after first register (say R1 was used, R2 would be next) is the amount of meseta to take.
Third Register is if meseta was successfully taken.
Example
100: jmpi_= R4, 00000001, 102 //If register 4 equals 1 jump to function 102.
get_slotnumber R250 //Gets the slot number of the players and stores it in register 250.
message 00000118, Hi I am here to rob you! //Makes character id 280 say a message.
leti R1, 000001F4 //Makes register 1 equal 000001F4. (500 dec.)
let R2, R1 //Makes register 2 equal to register 1.
get_slot_meseta R2 //Stores the amount of meseta in the players inventory in register 2.
jmp_< R2, R1, 101 //If the value of register 2 is less then the value of register 1 jump to function 101.
sync //Waits 1 frame.
let R2, R250 //Makes register 2 equal to the value of register 250.
let R3, R1 //Makes register 3 equal the value of register 1.
clear R4 //Makes register 4 equal 00000000.
take_slot_meseta R2, R4 //Register 2 is player to take meseta from it also compares with register 3 amount of meseta to take. As long as register 2 value when it held meseta is equal to or greater then the value of register 3 the meseta will be taken, and register 4 will equal 00000001.(Register 1 above is the amount of meseta that will be taken 500 dec.)
add_msg You have been robbed!<cr>Thank you. //Makes character id 280 say the next message.
mesend //Closes the message.
ret
101: message 00000118, You don't have enough meseta.<cr>I will just rob<cr>someone else. //Makes character id 280 say a message.
mesend //Closes the message.
ret
102: message 00000118, I already robbed you.<cr>Be on your way. //Makes character id 280 say a message.
mesend //Closes the message.
ret