serverCommandAvailable: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (description example) |
mNo edit summary |
||
Line 7: | Line 7: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Returns [[true]] if the [[ | | Returns [[true]] if the [[serverCommand]] can be performed on the machine, [[false]] if not. serverCommand can be executed only from [[User Interface Event Handlers]], so calling this command elsewhere may return true even if serverCommand would have no effect. |= Description | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 20: | Line 18: | ||
|x1 = <code>_can = [[serverCommandAvailable]] "#kick";</code> | |x1 = <code>_can = [[serverCommandAvailable]] "#kick";</code> | ||
|x2 = Add button to the main map to lock server, which could only be activated by admin: | |x2 = Add button to the main map to lock server, which could only be activated by admin: | ||
<code> | <code> | ||
[[if]] ([[serverCommandAvailable]] "#lock") [[then]] { | |||
[[serverCommand]] "#lock"; | |||
} [[else]] { | |||
[[hint]] "You need to be logged in as admin to do this"; | |||
};</code> | };</code> | ||
| [[serverCommand]] |= See also | | [[serverCommand]], [[serverCommandExecutable]], [[Multiplayer Server Commands]] |= See also | ||
}} | }} |
Revision as of 09:10, 16 October 2014
Description
- Description:
- Returns true if the serverCommand can be performed on the machine, false if not. serverCommand can be executed only from User Interface Event Handlers, so calling this command elsewhere may return true even if serverCommand would have no effect.
- Groups:
- Uncategorised
Syntax
Examples
- Example 1:
_can = serverCommandAvailable "#kick";
- Example 2:
- Add button to the main map to lock server, which could only be activated by admin:
if (serverCommandAvailable "#lock") then { serverCommand "#lock"; } else { hint "You need to be logged in as admin to do this"; };
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note