GetServerName: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
string getServerName (Bocah Indolife Roleplay )
string getServerName ( )
</syntaxhighlight>
</syntaxhighlight>


Line 14: Line 14:
This example creates a console command that outputs the server's name to the chatbox.
This example creates a console command that outputs the server's name to the chatbox.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function outputServerName (Bocah Indolife Roleplay )
function outputServerName ( )
outputChatBox ( getServerName(Bocah Indolife Roleplay  ) )
outputChatBox ( getServerName( ) )
end
end



Revision as of 14:46, 16 December 2014

This function retrieves the server's name.

Syntax

string getServerName ( )

Returns

A string containing the server's name.

Example

This example creates a console command that outputs the server's name to the chatbox.

function outputServerName ( )
	outputChatBox ( getServerName( ) )
end

-- Add console command 'getServerName'
addCommandHandler ( "getServerName", outputServerName )

See Also