Player/GetPData

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

Contents

Description

Returns a Player Data key-value pair from the SQL database. (sv.db when called on server, cl.db when called on client)

Internally uses the sql library.

NOTE PData is not networked from servers to clients!

Arguments

string key

Name of the PData key

Arguments

any default=nil

Default value if PData key doesn't exist.

Returns

string

The data in the SQL database or the default value given.

Examples

Example

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

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


Personal tools
Navigation