Amelyiknek a legnagyobb az ID-je, azt értem alatta.
Például ha te létrehozol 150 objectot, akkor a 150 lesz a legmagasabb ID.
De ha törlöd a 20-tól 30-ig, még akkor is azlesz.
Ittvan rá egy példa parancs, ami kilistázza neked az összes létezõ PVar-t.
Ebben van használva mind a három speciális funkció.
CMD:pvar(playerid, params[])
{
if(isnull(params)) player1 = playerid;
else if(sscanf(params, \"u\", player1)) return SendClientMessage(playerid, COLOR_RED, \"HASZNÁLAT: /pvar {\" #XCOLOR_YELLOW \"}<Játékos ID/Név>\");
if(player1 == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, MSG_NOT_CONNECTED);
new
MaxID = GetPVarsUpperIndex(player1);
dline[0] = EOS;
for(new i; i < MaxID; i++)
{
if(!GetPVarNameAtIndex(player1, i, country, sizeof(country))) continue;
// print(country);
if(!i)
{
switch(GetPVarType(player1, country))
{
case PLAYER_VARTYPE_STRING:
{
GetPVarString(player1, country, i_str, sizeof(i_str));
format(dline, sizeof(dline), \"%s = %s\", country, i_str);
}
case PLAYER_VARTYPE_INT:
{
format(dline, sizeof(dline), \"%s = %d\", country, GetPVarInt(player1, country));
}
case PLAYER_VARTYPE_FLOAT:
{
format(dline, sizeof(dline), \"%s = %f\", country, GetPVarFloat(player1, country));
}
}
}
else
{
switch(GetPVarType(player1, country))
{
case PLAYER_VARTYPE_STRING:
{
GetPVarString(player1, country, i_str, sizeof(i_str));
format(dline, sizeof(dline), \"%s\\n%s = %s\", dline, country, i_str);
}
case PLAYER_VARTYPE_INT:
{
format(dline, sizeof(dline), \"%s\\n%s = %d\", dline, country, GetPVarInt(player1, country));
}
case PLAYER_VARTYPE_FLOAT:
{
format(dline, sizeof(dline), \"%s\\n%s = %f\", dline, country, GetPVarFloat(player1, country));
}
}
}
}
format(i_str, sizeof(i_str), \"PVarLista {%06x}%s(%d) {\" #XCOLOR_WHITE \"}<%d>\", GetPlayerColor(player1) >>> 8, pName(player1), player1, MaxID);
ShowPlayerDialog(playerid, 5000, DIALOG_STYLE_LIST, i_str, dline, !\"Oké\");
return 1;
}