08.08.2011, 10:54
i suggest you to create an array for ranks like
and then use the arrayed rank names.
why i suggest this? imagine you want to promote/demote someone, then you would need to check for each single rank string, copmpare it, then set it to another one. by using a simple number as rank, you can easily change the numerical value, and later, when needed, print the array.
so its a simple pointer to the rank array. no need to waste large strings on saving, and you can change the rank names aswell
Код:
new Rank[][16]={"r0:Newbie","r1:Crewman","r2","r3","r4 Captain"};
why i suggest this? imagine you want to promote/demote someone, then you would need to check for each single rank string, copmpare it, then set it to another one. by using a simple number as rank, you can easily change the numerical value, and later, when needed, print the array.
Код:
format(string,sizeof(string),"%s",Rank[PlayerInfo[playerid][pRank]]);
Код:
PlayerInfo[playerid][pRank]=0;//prints "Newbie" PlayerInfo[playerid][pRank]=1;//prints "Crewman"