Entering more than one rank
#1

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!
Reply
#2

Ehm? Set value to 1, 2 or 3? Question is quite missleading
Reply
#3

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
Reply
#4

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.

pawn Код:
enum e_Ranks
{
    pRank[32]
}

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

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
Reply
#6

For the radio command, your format would look something like

pawn Код:
format(radioMessage, sizeof(radioMessage), "%s %s: %s", playerRanks[playerid][/* insert rank variable here */][pRank], playersName, params);
Reply
#7

I tried that just one error

And it is:
Quote:

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

and thats on the line you posted
Reply
#8

Use the rank variable and subtract 1 from it.
Reply
#9

urm what?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)