Template:Server client function: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Undo revision 78887 by RubyCommunity (talk))
Tags: New redirect Undo
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Example==
#REDIRECT [[Template:Shared function]]
This example get player from account name by command
<syntaxhighlight lang="lua">
addCommandHandler ("getPlayerName",
    function (player,_,name)
        if name then
        local thePlayer = getPlayerFromAccountName (name)
        if thePlayer then
            outputChatBox (getPlayerName (thePlayer),player,255,255,255,true)
        else
            outputChatBox ("player not found !",player,255,0,0)
        end
    else
        outputChatBox ("type account name frist !",player,255,255,0)
    end
end
)
</syntaxhighlight>
 
'''Author: ,#Na[W]aF'1000.'''

Latest revision as of 18:47, 13 March 2024