23.03.2017, 03:07
Put this somewhere in your script:
And use this to load player's rank:
Player[playerid][Rank] is now index of gRank, so if you want to increase player's rank you can simply increase its value. And you can use this variable as an array index of gRank in mysql_format inside UpdatePlayerData function.
Код:
GetRankIndex(str[]) { static size = sizeof(gRank); for(new i; i < size; i++) { if(!strcmp(str, gRank[i][rankName])) return i; } return 0; }
Код:
new str[56]; cache_get_value(0, "Rank", str, 56); // Rank column is varchar, so load them as string Player[playerid][Rank] = GetRankIndex(str); // Player[playerid][Rank] = index of gRank array.
Код:
Player[playerid][Banned], gRank[Player[playerid][Rank]][rankName], Player[playerid][ID]);