Difference between revisions of "010A"
Jump to navigation
Jump to search
(New page: {{OpCode | ini = 010A=2, %1d% %2d% | description = Checks if the player has more than enough money | p1 = Player handle | p2 = Integer (money) | game = [[...) |
(highlight) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{OpCode | {{OpCode | ||
− | | | + | | games = {{Icon|t}} |
+ | | command = IS_SCORE_GREATER | ||
| description = Checks if the player has more than enough money | | 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]] | | native = [[IS_SCORE_GREATER]] | ||
}} | }} | ||
− | |||
− | ==Keywords== | + | This conditional opcode returns true if the player's money is greater than (but not equal to) the value. |
− | player, check, money, greater, more, than | + | |
+ | == Example == | ||
+ | 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> | ||
+ | |||
+ | <span class="k">while</span> <span class="k">true</span> | ||
+ | <span class="k">wait</span> <span class="m">10</span> | ||
+ | <span class="k">if</span> | ||
+ | [[00E1]]: key_pressed <span class="m">0</span> <span class="m">13</span> <span class="c1">// camera key</span> | ||
+ | <span class="k">then</span> | ||
+ | <span class="k">if</span> | ||
+ | 010A: player <span class="nv">$PLAYER_CHAR</span> money > <span class="m">999</span> | ||
+ | <span class="k">then</span> | ||
+ | [[0109]]: player <span class="nv">$PLAYER_CHAR</span> money += -<span class="m">1000</span> | ||
+ | <span class="k">end</span> | ||
+ | <span class="k">end</span> | ||
+ | <span class="k">end</span> | ||
+ | }} | ||
+ | |||
+ | == Keywords == | ||
+ | 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