Difference between revisions of "Category:Utility functions"
From Fortress Forever Wiki
Jump to navigationJump to searchm |
|||
| (7 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
{{Infobox mapping}} | {{Infobox mapping}} | ||
These global functions are useful for getting your scripts working. | These global functions are useful for getting your scripts working. | ||
| − | {| border="1" cellspacing=" | + | {| border="1" cellspacing="2" cellpadding="2" |
! General Technical Functions !! Description | ! General Technical Functions !! Description | ||
| + | |- | ||
| + | | [[Lua:IncludeScript|IncludeScript]](string) || This function loads the contents of another lua file, located in FortresForever\maps\includes. | ||
|- | |- | ||
| [[Lua:ConsoleToAll|ConsoleToAll]]( message ) || sends a message to server console. Inaccurately named--players will not see this. | | [[Lua:ConsoleToAll|ConsoleToAll]]( message ) || sends a message to server console. Inaccurately named--players will not see this. | ||
| Line 18: | Line 20: | ||
|- | |- | ||
| [[Lua:RemoveEntity|RemoveEntity]]( ent_id ) || removes entity. | | [[Lua:RemoveEntity|RemoveEntity]]( ent_id ) || removes entity. | ||
| + | |- | ||
| + | | [[Lua:OutputEvent|OutputEvent]]( entity, input, parameter, delay, x ) || Triggers any named entity in the map using Source's [http://developer.valvesoftware.com/wiki/Inputs_and_Outputs#Inputs I/O system]. | ||
| + | |- | ||
| + | | [[Lua:SetConvar|SetConvar]]( player, var, value ) || sets a player's [http://developer.valvesoftware.com/wiki/Console_Command_List console variable] to a specified value. | ||
|- | |- | ||
! Player information !! | ! Player information !! | ||
| Line 29: | Line 35: | ||
! Server Info !! | ! Server Info !! | ||
|- | |- | ||
| − | | [[Lua:GetServerTime|GetServerTime]]() || | + | | float [[Lua:GetServerTime|GetServerTime]]() || Returns the number of seconds the map has been running. |
|- | |- | ||
| [[Lua:AreTeamsAllied|AreTeamsAllied]]( team1, team2 ) || Returns true if they are. | | [[Lua:AreTeamsAllied|AreTeamsAllied]]( team1, team2 ) || Returns true if they are. | ||
| + | |- | ||
| + | | [[Lua:GetEntitiesByName|GetEntitiesByName]](entname) || returns a Lua table containing the matching entities. | ||
|- | |- | ||
| [[Lua:NumPlayers|NumPlayers]]() || gets the number of players. | | [[Lua:NumPlayers|NumPlayers]]() || gets the number of players. | ||
| + | |- | ||
| + | | [[Lua:GetPlayers|GetPlayers]]() || returns a table (array) of all players on the server. | ||
| + | |- | ||
| + | | [[Lua:GetConvar|GetConvar]]( cvar ) || returns the value of a [http://developer.valvesoftware.com/wiki/Console_Command_List console variable] on the server(cvar). | ||
| + | |- | ||
| + | | string [[Lua:GetGameDescription|GetGameDescription]] | ||
|- | |- | ||
! Server Effects !! | ! Server Effects !! | ||
|- | |- | ||
| [[Lua:SetGameDescription|SetGameDescription]]( name ) || Changes what appears in the game column of the server browser (it is appended to "FF ") | | [[Lua:SetGameDescription|SetGameDescription]]( name ) || Changes what appears in the game column of the server browser (it is appended to "FF ") | ||
| − | For use in [[startup]](). | + | For use in [[Lua:startup]](). |
|- | |- | ||
| [[Lua:RespawnAllPlayers|RespawnAllPlayers]]( ) || Respawns everyone immediately. | | [[Lua:RespawnAllPlayers|RespawnAllPlayers]]( ) || Respawns everyone immediately. | ||
| Line 48: | Line 62: | ||
| [[Lua:ResetMap|ResetMap]]() || resets map. | | [[Lua:ResetMap|ResetMap]]() || resets map. | ||
|- | |- | ||
| − | | [[Lua: | + | | [[Lua:set_cvar|set_cvar]](cvar, value) || Sets a [http://developer.valvesoftware.com/wiki/Console_Command_List console variable] on the server |
|- | |- | ||
| [[Lua:ApplyToAll|ApplyToAll]]( effect ) || pass this a list of [[Lua:Flags#AT | AT flags]] to apply global effects to the server. | | [[Lua:ApplyToAll|ApplyToAll]]( effect ) || pass this a list of [[Lua:Flags#AT | AT flags]] to apply global effects to the server. | ||
| Line 58: | Line 72: | ||
| [[Lua:HasGameStarted|HasGameStarted]]( ) || Returns false if the map is in prematch mode. | | [[Lua:HasGameStarted|HasGameStarted]]( ) || Returns false if the map is in prematch mode. | ||
|- | |- | ||
| − | | [[Lua: | + | | [[Lua:LogLuaEvent|LogLuaEvent]](int, int, string) || Sends a message to the servers logs. |
|- | |- | ||
! Game Rules !! | ! Game Rules !! | ||
| Line 78: | Line 92: | ||
| [[Lua:SetTeamPlayerLimit|SetTeamPlayerLimit]]( team, limit ) || | | [[Lua:SetTeamPlayerLimit|SetTeamPlayerLimit]]( team, limit ) || | ||
|} | |} | ||
| + | [[Category:Lua]] | ||
| + | [[Category:Lua_Commands]] | ||
{{Infobox manual/Footer}} | {{Infobox manual/Footer}} | ||
Latest revision as of 16:42, 30 March 2015
|
These global functions are useful for getting your scripts working.
|
Pages in category "Utility functions"
The following 7 pages are in this category, out of 7 total.