Problem
#1

Ok i have a code which someone gave to my friend in a following thread

It works and everything since its being used in stats, as stats usually use numbers like Admin: 4

Im wondering how i can change it to letters such as Admin: Trial Admin or something

Take a look at the code below it works and everything but it doesnt work if i try change it using a command like if id like to change "None" to "Something" and "Something" to "Nothing" /nothing /something etc

Код:
new text1[20];
if(!strlen(PlayerData[playerid][Haircut])) return format(PlayerData[playerid][Haircut], 20, text1);
else format(text1, 20, "None");
Reply
#2

It should work somehow...
Reply
#3

Err... that's a stupid approach.

What you could do is something like this:

pawn Код:
new
    aUserAdminLevels[][16] = {"None", "Rank1", "Rank2", "Rank3", "Rank4"};
What you could do then, is something like this:

pawn Код:
new
    iUserAdminLevel = 2,
    sString[64];

format(sString, sizeof sString, "Administrator level: %s", aUserAdminLevels[iUserAdminLevel]);
Obviously there is a limitation that anyone with a user level greater than 4 will crash the server, so you'll need some error checking.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)