GetPlayerSerial: Difference between revisions
Jump to navigation
Jump to search
Line 52: | Line 52: | ||
end | end | ||
addCommandHandler( "banserial", banSerial ) | addCommandHandler( "banserial", banSerial ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Revision as of 05:12, 19 October 2012
This function returns the serial for a specified player.
Syntax
Click to collapse [-]
Serverstring getPlayerSerial ( player thePlayer )
Required Arguments
- thePlayer: A player object referencing the specified player.
Click to collapse [-]
Clientstring getPlayerSerial ( )
Returns
Returns the serial as a string if it was found, false otherwise.
Example
Click to collapse [-]
Example 1This example creates a command with which player can check their own serial.
function checkMySerial( thePlayer, command ) local theSerial = getPlayerSerial( thePlayer ) if theSerial then outputChatBox( "Your serial is: " .. theSerial, thePlayer ) else outputChatBox( "Sorry, you have no serial. =(", thePlayer ) end end addCommandHandler( "myserial", checkMySerial )
Click to collapse [-]
Example 2This example add command to ban player serial.
function banSerial( source, command, noob, reason ) if ( noob ) then local theNoob = getPlayerFromName( noob ) local theNoobSerial = getPlayerSerial( theNoob ) if ( theNoob ) then addBan( theNoobSerial, source, reason ) end end end addCommandHandler( "banserial", banSerial )