View Full Version : Entering more than one rank

06/10/2012, 12:11 AM
I have an enum and I have under it 'p_iRanks' but I don't want to create loads like p_iRanks1 and p_iRanks2 etc, so how can I do it so I can create several ranks without having to do 1, 2, 3 etc

and if possible, do it in mysql and y_ini

can pay too!

Forever Alone
06/10/2012, 12:15 AM
Ehm? Set value to 1, 2 or 3? Question is quite missleading

06/10/2012, 12:20 AM
I mean like setting a rank with a name not numbers but able to set various name ranks without p_iRanks1 and p_iRanks2, etc

06/10/2012, 12:24 AM
You need to create a new enum for this as far as I'm aware because you can't have two [size][size] for enum variables.

enum e_Ranks

new playerRanks[MAX_PLAYERS][/* maximum amount of ranks */][e_Ranks];

06/10/2012, 01:40 AM
Yeah, thanks for that^ rep'd

How can I know edit ranks and update them in my .ini file?

and a command to test them like /radio and then the rank you are and the name of the rank will put the rank name if that makes sense

06/10/2012, 05:12 AM
For the radio command, your format would look something like

format(radioMessage, sizeof(radioMessage), "%s %s: %s", playerRanks[playerid][/* insert rank variable here */][pRank], playersName, params);

06/10/2012, 12:13 PM
I tried that just one error

And it is:
error 032: array index out of bounds (variable "FactionRanks")

and thats on the line you posted

06/10/2012, 02:46 PM
Use the rank variable and subtract 1 from it.

06/10/2012, 05:26 PM
urm what?