Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem (
/showthread.php?tid=160667)
Problem -
[LSB]TheGame - 17.07.2010
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");
Re: Problem -
Erkan - 17.07.2010
It should work somehow...
Re: Problem -
Westie - 17.07.2010
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.