19.05.2016, 05:28
There is no such thing as "a stock". Their is something called a stock function but what you're looking for is a normal function. A stock function in its most pure sense is a function that can be copied into any script without any alterations. That concludes the speech for misuse of the stock keyword.
Anyway, what I would do is create an array of titles and then simply select the right value by using the rank as the index.
Anyway, what I would do is create an array of titles and then simply select the right value by using the rank as the index.
PHP код:
GetLevelTitle(level)
{
static const gAdminTitles[][] = {
"None", // 0
"Junior Admin", // 1
"Admin", // 2
"Senior Admin" // 3
};
return gAdminTitles[level];
}