DeletePVar

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 03:29, 31 January 2014
Smithy (Talk | contribs)

← Previous diff
Revision as of 19:42, 4 February 2014
Connor Mead (Talk | contribs)

Next diff →
Line 28: Line 28:
[[Category:Scripting Functions]] [[Category:Scripting Functions]]
 +
 +[[fr:DeletePVar]]

Revision as of 19:42, 4 February 2014



Description:

Deletes a previously set player variable.


Parameters:
(playerid, varname[])
playeridThe ID of the player whose player variable to delete.
varnameThe name of the player variable to delete.


Return Values:

true (1) on success, false (0) on failure (pVar not set or player not connected).


SetPVarInt(playerid, "SomeVarName", 69);
 
// Later on, when the variable is no longer needed...
 
DeletePVar(playerid, "SomeVarName");
Image:32px-Ambox_warning_orange.png

Note

Once a variable is deleted, attempts to retrieve the value will return 0 (for integers and floats and NULL for strings.


Related Functions

The following functions may be useful, as they are related to this function in one way or another.

  • SetPVarInt: Set an integer for a player variable.
  • GetPVarInt: Get the previously set integer from a player variable.
  • GetPVarString: Get the previously set string from a player variable.
  • GetPVarFloat: Get the previously set float from a player variable.
In other languages