Quote:
Originally Posted by HamletEagle
"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(id, g_mPlayerData[ g_iPlayerLevel[ id ] ][ m_szRankName ], 2)
return PLUGIN_CONTINUE
}