GetPlayerSerial

From Multi Theft Auto: Wiki
Revision as of 12:59, 11 April 2009 by Winky (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function returns the serial for a specified player.

Syntax

string getPlayerSerial ( player thePlayer )

Required Arguments

  • thePlayer: A player object referencing the specified player.

Returns

Returns the serial as a string if it was found, false otherwise.

The format of the serial has been changed.

Example

Click to collapse [-]
Server

This 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( "serial", checkMySerial )

See Also