Looping through an enum
#1

Good evening!

I have a faction system in which I can set different names to different ranks.

When I rename a rank, I do this:
Код:
for(new i = 1; i <= MAX_FACTION_RANK; i++)
{
	if(i == rank)
	{
		format(factionRank[cInfo[playerid][char_faction]][_e_faction_rank:i], MAX_FACTION_RANK_NAME, new_rankname);
				
		mysql_tquery_format(zeus, "UPDATE faction_rank SET faction_rank_%d = '%s' WHERE faction_id = '%d'", i, factionRank[cInfo[playerid][char_faction]][_e_faction_rank:i], cInfo[playerid][char_faction]);
		break;
	}
}
But when I want to show all of the rank names, it shows very strange names:
Код:
[19:51:46] testrank

[19:51:46] estrank

[19:51:46] strank

[19:51:46] trank

[19:51:46] rank

[19:51:46] ank

[19:51:46] nk

[19:51:46] k

[19:51:46] 

[19:51:46]
The code what I am using:
Код:
for(new i = 1; i <= MAX_FACTION_RANK; i++)
	SendClientMessageEx(playerid, -1, "%s", factionRank[1][_e_faction_rank:i]);
So, my question is: what am I doing wrong?

Thanks in advance.
Reply


Messages In This Thread
Looping through an enum - by zsoolt997 - 15.01.2018, 17:57
Re: Looping through an enum - by chneubeul - 15.01.2018, 18:06
Re: Looping through an enum - by Misiur - 15.01.2018, 18:10
Re: Looping through an enum - by zsoolt997 - 16.01.2018, 06:34
Re: Looping through an enum - by MP2 - 17.01.2018, 07:42

Forum Jump:


Users browsing this thread: 1 Guest(s)