Garry's Mod Wiki

Revision Difference

Player:RemovePData#561195

<function name="RemovePData" parent="Player" type="classfunc"> <description> Removes a **P**ersistent **Data** key-value pair from the SQL database. (`sv.db` when called on server, `cl.db` when called on client) Internally uses the <page>sql</page> library. See <page>util.RemovePData</page> for cases when the player is not currently on the server. ⤶ <warning>This function internally uses <page>Player:UniqueID</page>, which can cause collisions (two or more players sharing the same PData entry). It's recommended that you don't use it. See the related wiki page for more information.</warning>⤶ ⤶ <note>This function internally uses <page>Player:SteamID64</page>, it previously utilized <page>Player:UniqueID</page> which can cause collisions (two or more players sharing the same PData entry). <page>Player:SetPData</page> now replaces all instances of <page>Player:UniqueID</page> with <page>Player:SteamID64</page> when running <page>Player:SetPData</page></note>⤶ <note>PData is not networked from servers to clients!</note>⤶ </description> <realm>Shared</realm> <file line="148-L164">lua/includes/extensions/player.lua</file> <args> <arg name="key" type="string">Key to remove</arg> </args> <rets> <ret name="" type="boolean">true is succeeded, false otherwise</ret> </rets> </function> <example> <description>Deletes the key "money" from player 1</description> <code>Entity( 1 ):RemovePData( "money" )</code> </example>