GetPVarString
From SA-MP Wiki
Revision as of 12:02, 25 September 2010; view current revision
←Older revision | Newer revision→
←Older revision | Newer revision→
Gets a player variable as a string.
(playerid, varname[], string_return[], len)
| playerid | The ID of the player whose player variable you're getting. |
| varname | The name of the player variable. |
| &string_return | The string to store the PVarString in, passed by reference. |
| len | Number of cells the string has been assigned. |
| Returns | This function returns the length of player's PVarString. |
public OnPlayerConnect(playerid,reason) { new pmsg[128]; GetPVarString(playerid, "msg", pmsg, 128);// Get the msg string from the PVar printf("Player Message: %s", pmsg);// will print 'Player Message: *message*' return 1; }
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 a player variable as an integer.
- SetPVarString: Set a string for a player variable.
- SetPVarFloat: Set a float for a player variable.
- GetPVarFloat: Get the previously set float from a player variable.
- DeletePVar: Delete the player variable.
