| |
| enum token |
| { |
| t_type, |
| Rational: t_value, |
| t_word[20], |
| } |
| |
| |
| new bool:flag = true /* "flag" can only hold "true" or "false" */ |
| const error:success = 0 |
| const error:fatal= 1 |
| const error:nonfatal = 2 |
| error:errno = fatal |
| |
| native printf(const format[], {Float, _}: ...); |
| |
| new Float:chance_to_avoid = (p_resists[id][RESISTIDX_FIRE] >= RESIST_MAX_VALUE) ? |
| 1.00 : (float( p_resists[id][RESISTIDX_FIRE] ) / float( RESIST_MAX_VALUE )) |
| |
| xplevel_lev[j] = XP_PER_LEVEL_BASE_LT + ( (j - 10) * XP_PER_LEVEL_LT) + |
| floatround( float( j / 20 ) * XP_PER_LEVEL_LT ); |
| |
| |
| main() { |
| new Float:xpos |
| new Float:ypos |
| |
| new apple:elstar /* variable "elstar" with tag "apple" */ |
| new orange:valencia /* variable "valencia" with tag "orange" */ |
| new x /* untagged variable "x" */ |
| elstar = valencia /* tag mismatch */ |
| elstar = x /* tag mismatch */ |
| x = valencia /* ok */ |
| |
| new Float:chance_to_avoid = (p_resists[id][RESISTIDX_FIRE] >= RESIST_MAX_VALUE) ? |
| 1.00 : (float( p_resists[id][RESISTIDX_FIRE] ) / float( RESIST_MAX_VALUE )) |
| |
| xplevel_lev[j] = XP_PER_LEVEL_BASE_LT + ( (j - 10) * XP_PER_LEVEL_LT) + |
| floatround( float( j / 20 ) * XP_PER_LEVEL_LT ); |
| |
| if (apple:valencia < elstar) |
| valencia = orange:elstar |
| |
| some_label: // target for a goto |
| #pragma rational Float |
| |
| new Float:limit = -5.0 |
| new Float:value = -1.0 |
| if (value < limit) |
| printf("Value %f below limit %f\n", _:value, _:limit) |
| else |
| printf("Value above limit\n") |
| goto some_label |
| } |
| |
| foo() |
| if (ape) |
| dofunc(1) |
| else if (monkey) |
| dofunc(2) |
| else |
| dofunc(3) |