player.SetPData
From GMod Wiki
| Function | |
| Syntax |
player.SetPData( |
| Description: | |
| Sets the player's data. | |
| Returns: |
|
| In Object: |
|
| Available On: |
|
| BBCode Link: | [b][url=wiki.garrysmod.com/?title=Player.SetPData]Player.SetPData [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Gives the player 10 dollars. |
|---|---|
| Used on | |
| Code | function GiveMoney(ply) ply:SetPData("money", ply:GetPData("money") + 10 ) end |
| Output | None. |
Additional Notes
- If it is used on the client, it will always error.
- This is saved to the server SQLite database (sv.db in garrysmod folder), so if you need to permanently store something for a player (e.g. play time on the server), use this function.
