GetServerName: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
Line 5: Line 5:


<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
returnType getServerName ( )
string getServerName ( )
</syntaxhighlight>  
</syntaxhighlight>  


Line 18: Line 18:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function outputServerName ( )
function outputServerName ( )
outputChatBox ( getServerName() )
outputChatBox ( getServerName( ) )
end
end



Revision as of 07:00, 4 August 2007

This function returns a string containing the server's name.

Syntax

string getServerName ( )

Required Arguments

  • None

Returns

A string containing the server's name.

Example

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

function outputServerName ( )
	outputChatBox ( getServerName( ) )
end

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

See Also