User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
scripting:ccm [2011-03-14 13:43]
Carsten Deleted page, contents has been migrated to http://api.cafu.de/scripting/classci.html
— (current)
Line 1: Line 1:
-====== The ccm Library ====== 
- 
-The functions of the ''​ccm''​ (Console Command Manager) library allow you to run console functions and to set and get the values of console variables as if they had been typed into the Cafu in-game console by the user. 
- 
- 
-===== ExecuteCommand(command) ===== 
- 
-Executes the console command ''​command''​ as if the user had typed it to the Cafu in-game console directly. 
-Use this to run console functions and to set the values of console variables. 
- 
-=== Parameters: === 
-^ Name ^ Type ^ Description ^ 
-| command | string | The string with the command and its parameters to be executed on the in-game console. | 
- 
-=== Returns: === 
-Nothing (nil). 
- 
-=== Example: === 
-<code lua> 
-    -- Run the confunc "​list"​ with the parameter "​he"​. 
-    ccm.ExecuteCommand("​list he"); 
- 
-    -- Set the value of the convar "​quit"​ to true. 
-    ccm.ExecuteCommand("​quit 1"); 
-</​code>​ 
- 
- 
-===== GetValue(name) ===== 
- 
-Retrieves the value of the specified console variable. 
- 
-=== Parameters: === 
-^ Name ^ Type ^ Description ^ 
-| name | string | The name of the convar whose value is to be retrieved. | 
- 
-=== Returns: === 
-The value of the convar with name ''​name''​. The returned value can be of type ''​string'',​ ''​integer'',​ ''​boolean''​ or ''​number'',​ depending on the type of the convar, or ''​nil''​ if a convar with that name does not exist. 
- 
-=== Example: === 
-<code lua> 
-    showFrames=ccm.GetValue("​showFPS"​);​ 
-</​code>​ 
  
scripting/ccm.1300106605.txt.gz ยท Last modified: 2013-01-07 12:07 (external edit)