getPlayerSerial | Multi Theft Auto: Wiki Skip to content

getPlayerSerial

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function returns the serial for a specified player.

Note

It's possible for a player to fake the value returned from getPlayerSerial when used on the clientside. For this reason you should only trust the value returned by this function when used serverside.

Important

You should use this function in conjunction with account system (e.g: login & password ) - especially for critical things, because serials could be invalid (as in, non-unique or faked ). See: Script security .

Syntax

getPlayerSerial ( )

Code Examples

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

See Also