Stock/Callback how do i make this possible?
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
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.
PHP код:
GetLevelTitle(level)
{
    static const 
gAdminTitles[][] = {
        
"None"// 0
        
"Junior Admin"// 1
        
"Admin"// 2
        
"Senior Admin" // 3
    
};
    return 
gAdminTitles[level];

Thanks bro, But i got this error
Код:
C:\Users\user\Desktop\lewl\gamemodes\lewl.pwn(2345) : error 010: invalid function or declaration
C:\Users\user\Desktop\lewl\gamemodes\lewl.pwn(2345 -- 2356) : error 010: invalid function or declaration
PHP код:
GetLevelTitle(level)
{
    static const 
gAdminTitles[][] = {
        
"None"// 0
        
"Black-Listed"// 1
        
"Junior Admin"// 2
        
"General Admin" // 3
        
"Senior Admin"
        "Head Admin"
        "Server Manager"
    
};
    return 
gAdminTitles[level];

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)