Difference between revisions of "Get player hp"

From Unofficial QEdit Wiki Guide
Jump to: navigation, search
 
Line 18: Line 18:
  
 
==Use==
 
==Use==
Used to monitor the players maximum hp, current hp, maximum tp, and current tp.
+
Used to monitor the players maximum HP, current HP, maximum TP, and current TP.
  
 
==Example==
 
==Example==
Line 26: Line 26:
 
  <span style='color:green'>        ret </span>
 
  <span style='color:green'>        ret </span>
 
  <span style='color:blue'>101:    </span><span style='color:green'>sync </span> <span style='color:orange'>//Waits 1 frame.</span>
 
  <span style='color:blue'>101:    </span><span style='color:green'>sync </span> <span style='color:orange'>//Waits 1 frame.</span>
  <span style='color:red'>        get_player_hp </span>R250, R1 <span style='color:orange'>//Stores the players maximum hp in register 1, current hp in register 2, maximum tp in register 3, and current tp in register 4.</span>
+
  <span style='color:red'>        get_player_hp </span>R250, R1 <span style='color:orange'>//Stores the players maximum HP in register 1, current HP in register 2, maximum TP in register 3, and current TP in register 4.</span>
 
  <span style='color:green'>        jmp </span>101 <span style='color:orange'>//Jumps to function 101.</span>
 
  <span style='color:green'>        jmp </span>101 <span style='color:orange'>//Jumps to function 101.</span>
 
  </span>
 
  </span>

Revision as of 06:54, 3 May 2013

Syntax

Syntax: get_player_hp register1, register2

  • register1 = Reserved register 250 for player slot number.
  • register2 = Start of continuous registers.

4 registers.

First register = Stores players maximum HP.

Second register = Stores players current HP.

Third register = Stores players maximum TP.

Fourth register = Stores players current TP.


Use

Used to monitor the players maximum HP, current HP, maximum TP, and current TP.

Example


100:     get_slotnumber R250 //Gets the players slot number and stores it in register 250.
         thread 101 //Threads function 101.
         ret 
101:     sync  //Waits 1 frame.
         get_player_hp R250, R1 //Stores the players maximum HP in register 1, current HP in register 2, maximum TP in register 3, and current TP in register 4.
         jmp 101 //Jumps to function 101.

Also see

get_slotnumber, thread, ret,

sync, jmp