Raised This Month: $2 Target: $400
 0% 

Solved Native: get_user_rank


Post New Thread Reply   
 
Thread Tools Display Modes
Supremache
Senior Member
Join Date: Sep 2019
Old 06-29-2020 , 17:34   Re: Native: get_user_rank
Reply With Quote #11

Quote:
Originally Posted by Bugsy View Post
You're still using style 1

register_native("get_user_rank", "_get_user_rank", 1)

And maxlen is set to 2, use charsmax( g_mPlayerData[][ m_szRankName ] )

set_string( id, g_mPlayerData[ g_iPlayerLevel[ id ] ][ m_szRankName ], 2)
I did it as you said but i still have same thing, rank names didn't show

What i did:

PHP Code:
public plugin_natives()
{
    
register_native("get_user_rank""_get_user_rank")
}

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


Supremache is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Location: Muslim and proud!
Old 06-29-2020 , 17:55   Re: Native: get_user_rank
Reply With Quote #12

iParams != 3
__________________
@Jailbreak MOD [Alot of features + API] 100% done !
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-29-2020 , 17:58   Re: Native: get_user_rank
Reply With Quote #13

Quote:
Originally Posted by Natsheh View Post
iParams != 3
This is why I asked how he is using it, hopefully it's :

get_rank( id , var[] , maxchars )

But may be

get_rank( id )

Which could explain him getting only 1 char.
__________________
Bugsy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-29-2020 , 17:58   Re: Native: get_user_rank
Reply With Quote #14

Again, Supremache, GIVE MORE CODE
__________________
Bugsy is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 06-29-2020 , 18:49   Re: Native: get_user_rank
Reply With Quote #15

@ Natsheh - It's worded

@Bugsy

.INC
Code:
native get_user_rank(id, buffer[], len)
PHP Code:

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

If i used the same thing for set_blablabla will do the same ??
Is this correct ??
PHP Code:
// Native: set_user_xp
public _set_user_xp(iPlugin,iParams)
{
    
g_iPlayerXPget_param(1) ] = clamp(get_param(2), 0)


Last edited by Supremache; 06-29-2020 at 18:54.
Supremache is offline
thEsp
Veteran Member
Join Date: Aug 2017
Location: Land of Eagles
Old 06-29-2020 , 18:53   Re: Native: get_user_rank
Reply With Quote #16

How exactly does it make sense when len isn't even used?
thEsp is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 06-29-2020 , 18:57   Re: Native: get_user_rank
Reply With Quote #17

Quote:
Originally Posted by thEsp View Post
How exactly does it make sense when len isn't even used?
It must be
HTML Code:
get_user_rank(id, var[] , maxchars)
buffer = var ???
Supremache is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-29-2020 , 19:36   Re: Native: get_user_rank
Reply With Quote #18

How are you using it in your plugin
__________________
Bugsy is offline
Supremache
Senior Member
Join Date: Sep 2019
Old 06-29-2020 , 20:18   Re: Native: get_user_rank
Reply With Quote #19

Quote:
Originally Posted by Bugsy View Post
How are you using it in your plugin
U mean this ? g_iPlayerXP[ id ]
Supremache is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-29-2020 , 20:36   Re: Native: get_user_rank
Reply With Quote #20

No, the code you used to create the HUD in your first post that isn't working correctly. This isn't that confusing, show all code that is causing you an issue if you want the problem resolved.
__________________
Bugsy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:47.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode