Raised This Month: $ Target: $400
 0% 

Hudmessage With const


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 06-11-2010 , 12:22   Hudmessage With const
Reply With Quote #1

Hello, I need some help for my new mod 'Western: Wild West'

PHP Code:
// Rangs
new const RANG[][64] = {
    
"Bandit",
    
"Cowgirl",
    
"Cowboy",
    
"Shireff"
};
// Kills needed
new const KILLS[TOTALKILLS] = {
    
1,
    
5,
    
10,
    
15

And I need in a Hudmessage like:

Code:
Rangs
     - Bandit (%s kills)
     - Cowboy (%s kills)
     - ..
How to make that?

PHP Code:
public Rangs(id)
{
    if(
get_pcvar_num(Western_status))
    {
        
set_hudmessage(255000.01, -1.0)
        
show_hudmessage(id"%s^n   Levels:^n      Rang: %s (Kills: %d)^n      Rang: %s (Kills: %d)^n      Rang: %s (Kills: %d)^n      Rang: %s (Kills: %d)^n"RANG[0], KILLS[0], RANG[1], KILLS[1], RANG[2], KILLS[2], RANG[3], KILLS[3])
    }
    return 
PLUGIN_CONTINUE;

But is theire a better & shorter way?
__________________
Retired.

Last edited by Xalus; 06-11-2010 at 12:27.
Xalus is offline
 


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 14:45.


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