Rank help
#9

Put this somewhere in your script:
Код:
GetRankIndex(str[])
{
	static size = sizeof(gRank);
	for(new i; i < size; i++)
	{
		if(!strcmp(str, gRank[i][rankName]))
			return i;
	}
	return 0;
}
And use this to load player's rank:
Код:
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][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.
Код:
Player[playerid][Banned],
gRank[Player[playerid][Rank]][rankName],
Player[playerid][ID]);
Reply


Messages In This Thread
Rank help - by Face9000 - 22.03.2017, 00:58
Re: Rank help - by X337 - 22.03.2017, 01:14
Re: Rank help - by Face9000 - 22.03.2017, 01:24
Re: Rank help - by X337 - 22.03.2017, 01:31
Re: Rank help - by Face9000 - 22.03.2017, 01:42
Re: Rank help - by X337 - 22.03.2017, 01:52
Re: Rank help - by Face9000 - 22.03.2017, 21:00
Re: Rank help - by Flamehaze7 - 23.03.2017, 01:47
Re: Rank help - by X337 - 23.03.2017, 03:07
Re: Rank help - by Face9000 - 23.03.2017, 10:12

Forum Jump:


Users browsing this thread: 5 Guest(s)