Thread: [Solved] Native: get_user_rank
View Single Post
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-29-2020 , 15:37   Re: Native: get_user_rank
Reply With Quote #8

Quote:
Originally Posted by HamletEagle View Post
"the old one"
Style 0 is not "old", in fact it is what you should use. Style 1 is deprecated, do not use it.
OP, just switch to style 0 natives, no point in trying to fix code you shouldn't write in the first place.
Then read this: https://forums.alliedmods.net/showthread.php?t=41251

P.S: enable debug already. Don't post error logs with debug disabled, they are useless.
I did it but rank name didn't show



.inc
Quote:
/**
* Returns the client's current rank.
*
* @param id Client index.
* @param buffer Buffer to store the rank name in.
* @param len Maximum buffer length.
* @noreturn
*/

native get_user_rank(id)
PHP Code:

public plugin_natives()
{
    
register_library("levels")
    
register_native("get_user_rank""_get_user_rank"1)
}


public 
_get_user_rank(iPlugin,iParams)
{
    if(
iParams != 1)
        return 
PLUGIN_CONTINUE
        
    
new id get_param(1)
    if(!
id)
        return 
PLUGIN_CONTINUE;
        
    
set_string(idg_mPlayerDatag_iPlayerLevelid ] ][ m_szRankName ], 2)
    
    return 
PLUGIN_CONTINUE



Last edited by Supremache; 06-29-2020 at 15:38.
Supremache is offline