Raised This Month: $32 Target: $400
 8% 

Solved Add a name


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Theodore Bagwell
Member
Join Date: Jan 2021
Location: USA
Old 01-30-2021 , 04:31   Add a name
Reply With Quote #1

Hi. I have this code.
PHP Code:
    new players[32], pnumtempid;
    
    new 
szName[32], szUserId[32], Desc64 ];
    
    
get_playersplayerspnum ); 
    
    for ( new 
ii<pnumi++ )
    {
        
tempid players[i];
        
        
get_user_nametempidszNamecharsmaxszName ) );
        
formatexDesccharsmaxDesc ), "%s [ %i \w]"szNameget_user_health(tempid));
        
formatexszUserIdcharsmaxszUserId ), "%d"get_user_useridtempid ) );
        
menu_additemmenuDescszUserId);
    }    
    
    
menu_displayidmenu);
    return 
PLUGIN_HANDLED
For example, if the player has 50 health, I want "halflife" to be written in front of his name in the menu, or if he has 30 health, "weak" should be written in front of his name. And for other numbers other names.
Thanks

Last edited by Theodore Bagwell; 01-30-2021 at 09:05.
Theodore Bagwell is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-30-2021 , 07:21   Re: Add a name
Reply With Quote #2

Well, did you try doing it? I assume you know basic maths and comparison symbols.

if(health <= 30) do X
else if (health <= 50) do Y
else do Z
__________________

Last edited by OciXCrom; 01-30-2021 at 07:22.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Theodore Bagwell
Member
Join Date: Jan 2021
Location: USA
Old 01-30-2021 , 09:05   Re: Add a name
Reply With Quote #3

Thanks.
Theodore Bagwell is offline
Reply



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 04:10.


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