Player:GetPData

From Garry's Mod
Jump to: navigation, search
 Player:GetPData( )

Contents

Description

Returns a player's PData from the server's or client's SQL database. ( sv.db and cl.db respectively ) It is not networked!

Arguments

any key

Name of the PData key

Arguments

any default

Default value if PData key doesn't exist.

Returns

string

Returned data

Examples

Example

Reads the key "money" from player 1's PData

player.GetByID( 1 ):GetPData( "money", 0 )


Examples

Example

Strange feature: return default if nothing was written using SetPData

player.GetByID(1):SetPData("money",0)
type(player.GetByID(1):GetPData("money",0))
type(player.GetByID(1):GetPData("mon3y",0))

Output:

string number
Personal tools
Navigation