API:IsScenarioF2PServer
From RoR Wiki
UI Lua API · Scenario functions
Version: WAR 1.4.8
Returns whether the client has the "scenario free-to-play server" flag set.
isF2P = IsScenarioF2PServer()
Arguments
None.
Returns
- isF2P
boolean–trueif the client's flag has the value 1.
Details
- The function only reads a value stored by the client. It sends nothing to the server.
- The only stock caller is the character creation screen (
interfacecore/source/characterselectwindow.lua): when the result isfalse(or the build is internal), it adds a "no template" entry to the character template list. Its comment calls such servers "template-enforced".
Errors
None.
Example
From interfacecore/source/characterselectwindow.lua:
if(IsScenarioF2PServer() == false or IsInternalBuild())
then
-- Not a template-enforced server, so display the no-template option
CharacterSelectWindow.numTemplates = 1
CharacterSelectWindow.bNoTemplateOptionDisplayed = true
ComboBoxAddMenuItem("CharacterSelectTemplateOptionsComboBox", GetPregameString( StringTables.Pregame.LABEL_NO_TEMPLATE ))
end
