note Help Needed
This wiki is the result of an ongoing community effort — thank you all for helping!
If you want to provide changes to this page then please click here.
GetPVarFloat
Description
Gets a player variable as a float.
Name | Description |
---|---|
playerid | The ID of the player whose player variable you want to get. |
const pvar[] | The name of the player variable. |
Returns
The float from the specified player variable
Examples
LoadPlayerPos(playerid)
{
new Float:x, Float:y, Float:z;
x = GetPVarFloat(playerid, "Xpos");
y = GetPVarFloat(playerid, "Ypos");
z = GetPVarFloat(playerid, "Zpos");
SetPlayerPos(playerid, x, y, z);
return 1;
}
Notes
tip
Variables aren't reset until after OnPlayerDisconnect is called, so the values are still accessible in OnPlayerDisconnect.
Related Functions
- SetPVarInt: Set an integer for a player variable.
- GetPVarInt: Get the previously set integer from a player variable.
- SetPVarString: Set a string for a player variable.
- GetPVarString: Get the previously set string from a player variable.
- SetPVarFloat: Set a float for a player variable.
- DeletePVar: Delete a player variable.