Player/SetPData
From Garry's Mod
Contents |
Description
Writes a Player Data key-value pair to 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 value
Value to write to the key (must be an SQL valid data type, such as a string or integer)
Returns
Whether the operation was successful or not
Examples
Example
Sets the key "money" from player 1's PData to 100
player.GetByID( 1 ):SetPData( "money", 100 )