Ifx
From EventScripts Community Encyclopedia
|
[edit] OverviewSyntax: Note: Command parameters are described inside the
< and > characters. Optional parameters are contained within [ and ] characters.Variation of this command that doesn't expand variables: ifx [edit] DescriptionWill execute the do { } block depending on the <command>. [edit] Parameters
[edit] ExamplesTrue/False: event player_hurt { es_set attacker_userid event_var(attacker) ifx true(attacker_userid) do { //Do the block if the userid is not 0 = Not hurt by world } else do { //Else do } } ifx true(eventscripts_currentmap) do { // good method to get if a game is running } mathparse: es_set x "12" es_set y "15" ifx parse("x < y") do { // this is faster than the "if" command } es_set x 5 ifx parse("x == 5") do { // this is faster than the "if" command } Using ifx with 'and' and 'or' statements: es_xset a 1 es_xrand b 3 4 es_xset c 0 ifx parse("b == 3") do { es_xset c 1 } ifx parse("a < 2 and b > 3 or c != 0") do { es_msg Look it works! } Will send the message to all players 'Look it works'
[edit] Notes
[edit] See also |
