Raised This Month: $ Target: $400
 0% 

Add HUD that shows the level...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-11-2009 , 13:38   Add HUD that shows the level...
Reply With Quote #1

Does anyone could add a HUD where shows the level only when the player this live?
PHP Code:
#include <amxmodx>
#include <hamsandwich>

enum Level
{
    
Level0,
    
Level1,
    
Level2,
    
Level3
}

new 
g_enabledmoneyLevel:PlayerLevels[33]
new 
Float:LevelDamageMultiplier[Level] = {_:1.0,_:1.5,_:2.0,_:2.5}

public 
plugin_init()
{
    
register_plugin("Damage by the amount of money""1.3""alan_el_more")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
register_event("Money""Event_Money""b")
    
g_enabled register_cvar("amx_dmg_money""1"FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
}


public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    
SetHamParamFloat(4damage LevelDamageMultiplier[PlayerLevels[attacker]])
}

public 
Event_Money(id)
{
    if(
get_pcvar_num(g_enabled))
    {
        new 
money read_data(1);
        if(
money 5000)
        {
            
PlayerLevels[id] = Level0;
        }
        else if(
money <= 10000)
        {
            
PlayerLevels[id] = Level1;
        }
        else if(
money <= 14000)
        {
            
PlayerLevels[id] = Level2;
        }
        else
        {
            
PlayerLevels[id] = Level3;
        }
    }
    else
    {
        
PlayerLevels[id] = Level0;
    }

__________________
alan_el_more 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 02:26.


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