Thread: [Solved] Add XP/skill to players name
View Single Post
shauli
Member
Join Date: Jun 2018
Old 01-18-2019 , 12:20   Re: Can't figure this out :)
Reply With Quote #16

Quote:
Originally Posted by deprale View Post
Nope, my name gets printed like this:
My_name [123812731231] (random numbers).
pokezao is right, it's probably a Float value. I wasn't sure because you used integer and Bugsy used Float. Anyway, try this:
PHP Code:
formatNameidstring[ ], len 

    new 
pos get_user_nameidstringlen ), temp posFloat:skill
    
get_user_skillidskill ); 

    if( 
stringpos ] == ']' 
        while( 
pos && string[ --pos ] != '[' ) { } 
     
    if( 
pos != && pos != temp 
        return 
formatexstringpos ], len pos"[%.2f]"skill ); 
    else 
        return 
formatexstringlen"%.22s [%.2f]"stringskill ); 


public 
FwdPlayerSpawnPostid 

    new 
szName32 ]; 
    
formatNameidszNamecharsmaxszName ) ); 

    
set_user_infoid "name"szName ); 

shauli is offline