26.07.2010, 15:37
Sorry if you got me wrong, but here's something else I'd like to point out in that case...
Deleting a per-player variable is not necessary under OnPlayerDisconnect.
And GetPVarType afaik does not return a string like you say. It returns the type, like this
So
would actually return PLAYER_VARTYPE_FLOAT (3)
And your example of "MarriedTo" for string pvars isn't exactly the best, since the best method to assign someone married to another player would be using IDs and hence SetPVarInt and GetPVarInt.
pawn Код:
public OnPlayerDisconnect(playerid)
{
DeletePVar(playerid,"PosX");
return 1;
}
And GetPVarType afaik does not return a string like you say. It returns the type, like this
pawn Код:
// PVar enumeration
#define PLAYER_VARTYPE_NONE 0
#define PLAYER_VARTYPE_INT 1
#define PLAYER_VARTYPE_STRING 2
#define PLAYER_VARTYPE_FLOAT 3
pawn Код:
GetPVarType(playerid, "PosX");
And your example of "MarriedTo" for string pvars isn't exactly the best, since the best method to assign someone married to another player would be using IDs and hence SetPVarInt and GetPVarInt.