Difference between revisions of "010A"
Jump to navigation
Jump to search
m |
(highlight) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | {{Icon| | + | {{OpCode |
− | + | | games = {{Icon|t}} | |
− | + | | command = IS_SCORE_GREATER | |
− | + | | description = Checks if the player has more than enough money | |
− | + | | syntax1 = 010A: player [''player handle''] money > [''int''] | |
− | + | | p1t = [''player handle''] | |
− | + | | p1d = The [[0053|handle of the player]] | |
− | + | | p2t = [''int''] | |
− | + | | p2d = Money | |
− | + | | native = [[IS_SCORE_GREATER]] | |
− | + | }} | |
− | |||
− | |||
This conditional opcode returns true if the player's money is greater than (but not equal to) the value. | This conditional opcode returns true if the player's money is greater than (but not equal to) the value. | ||
== Example == | == Example == | ||
− | The following example, using Sanny Builder, lets you decrease your money by $1000 by pressing | + | The following example, using Sanny Builder, lets you decrease your money by $1000 by pressing [[00E1|button 13]] (CAMERA key), as long as you have more than $999. |
− | < | + | {{Pre|class=sb-code|1= |
− | + | [[0109]]: player <span class="nv">$PLAYER_CHAR</span> money += <span class="m">2500</span> | |
− | while true | + | <span class="k">while</span> <span class="k">true</span> |
− | wait 10 | + | <span class="k">wait</span> <span class="m">10</span> |
− | if | + | <span class="k">if</span> |
− | 00E1: key_pressed 0 13 // camera key | + | [[00E1]]: key_pressed <span class="m">0</span> <span class="m">13</span> <span class="c1">// camera key</span> |
− | then | + | <span class="k">then</span> |
− | if | + | <span class="k">if</span> |
− | 010A: player $PLAYER_CHAR money > 999 | + | 010A: player <span class="nv">$PLAYER_CHAR</span> money > <span class="m">999</span> |
− | then | + | <span class="k">then</span> |
− | 0109: player $PLAYER_CHAR money += -1000 | + | [[0109]]: player <span class="nv">$PLAYER_CHAR</span> money += -<span class="m">1000</span> |
− | end | + | <span class="k">end</span> |
− | end | + | <span class="k">end</span> |
− | end | + | <span class="k">end</span> |
− | </ | + | }} |
== Keywords == | == Keywords == | ||
player, check, money, cash, greater, more, than | player, check, money, cash, greater, more, than | ||
− | [[ | + | == See also == |
+ | * {{Icon|t}} [[0109]], adds the player's money | ||
+ | * {{Icon|t}} [[010B]], stores the player's money |
Latest revision as of 01:19, 4 December 2016
- Description
- Checks if the player has more than enough money
- Syntax
- 010A: player [player handle] money > [int]
- Parameter
- [player handle]
- The handle of the player
- [int]
- Money
- Native analog
- IS_SCORE_GREATER
This conditional opcode returns true if the player's money is greater than (but not equal to) the value.
Example
The following example, using Sanny Builder, lets you decrease your money by $1000 by pressing button 13 (CAMERA key), as long as you have more than $999.
0109: player $PLAYER_CHAR money += 2500 while true wait 10 if 00E1: key_pressed 0 13 // camera key then if 010A: player $PLAYER_CHAR money > 999 then 0109: player $PLAYER_CHAR money += -1000 end end end
Keywords
player, check, money, cash, greater, more, than