OnClientConsole: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Incomplete Event]]
{{Client event}}
 
__NOTOC__  
__NOTOC__  
This event is blahblah and is used for blahblah.
This event is triggered when the local player enters text in the console. Note that, if you want to add custom console commands, it is easier to use the [[addCommandHandler]] function.


==Syntax==  
==Parameters==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
void onClientConsole ( text )
string text
</syntaxhighlight>  
</syntaxhighlight>
*'''text:''' the text line that was entered.


==Example==  
==Source==
This example does...
The source of this event is the localPlayer player element.
 
 
==Example==
This example outputs any text you input into the console.  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
function consoleCheck(text)
blabhalbalhb --abababa
outputChatBox("You entered into the console: "..text, 255, 255, 0)
--This line does this...
end
mooo
addEventHandler("onClientConsole", localPlayer, consoleCheck)
</syntaxhighlight>
</syntaxhighlight>
==See Also==
===Other client events===
{{Client_other_events}}
===Client event functions===
{{Client_event_functions}}

Latest revision as of 16:13, 29 May 2025

This event is triggered when the local player enters text in the console. Note that, if you want to add custom console commands, it is easier to use the addCommandHandler function.

Parameters

string text
  • text: the text line that was entered.

Source

The source of this event is the localPlayer player element.


Example

This example outputs any text you input into the console.

function consoleCheck(text)
	outputChatBox("You entered into the console: "..text, 255, 255, 0)
end
addEventHandler("onClientConsole", localPlayer, consoleCheck)

See Also

Other client events


Client event functions