Raised This Month: $ Target: $400
 0% 

FirstPlugin [hp]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BigMac
Member
Join Date: Jul 2009
Old 08-18-2009 , 10:42   FirstPlugin [hp]
Reply With Quote #1

I can not get the menu to open up there no errors and no log errors can anyone help me so i can see the menu in game Thank you your help!!

PHP Code:
[CODE][HTML]#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <cstrike>
#include <fakemeta>

#define PLUGIN "Health"
#define VERSION "1.0"
#define AUTHOR "Pastout"

new gKeysHealthMenu;
new 
gszHealthMenu[256];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /lucky""show(HealthMenu");
    
createMenus();
    
register_menucmd(register_menuid("HealthMenu"), gKeysHealthMenu"handleHealthMenu");
    
register_cvar("healamount""10.0");
    
register_event("TextMsg""eventRoundRestart""a""2&#Game_C""2&#Game_w");
}

enum
{
    
N1N2N3N4N5N6N7N8N9N0
};

enum
{
    
B1 << N1B2 << N2B3 << N3B4 << N4B5 << N5,
    
B6 << N6B7 << N7B8 << N8B9 << N9B0 << N0,
};

createMenus()
{
    
    
//create main menu
    
new size sizeof(gszHealthMenu);
    
add(gszHealthMenusize"\yHealth Menu^n^n");
    
add(gszHealthMenusize"\r1. \wHP 10^n");
    
add(gszHealthMenusize"\r2. \wHP 20^n");
    
add(gszHealthMenusize"\r3. \wHP 30^n");
    
add(gszHealthMenusize"\r4. \wHP 40^n");
    
add(gszHealthMenusize"\r5. \wHP 50^n");
    
add(gszHealthMenusize"\r6. \wHP 60^n");
    
add(gszHealthMenusize"\r7. \wHP 70^n");
    
add(gszHealthMenusize"\r8. \wHP 80^n");
    
add(gszHealthMenusize"\r9. \wHP 90^n");
    
add(gszHealthMenusize"\r0. \wClose");
    
gKeysHealthMenu B1 B2 B3 B4 B5 B6 B7 B8 B9 B0;
}

public 
showHealthMenu(id)
{
    new 
col[3];
    new 
szMenu[256];
    new 
szHealth[8];
    
    
//format the main menu
    
format(szMenu256gszHealthMenucolszHealthcolszHealthcolszHealthcolszHealthcolszHealth);
    
    
//show the main menu to the player
    
show_menu(idgKeysHealthMenuszMenu, -1"HealthMenu");
    
    return 
PLUGIN_HANDLED;
}

public 
handleHealthMenu(idnum)
{
    switch (
num)
    {
        case 
N1: { Health10(id); }
        case 
N2: { Health20(id); }
        case 
N3: { Health30(id); }
        case 
N4: { Health40(id); }
        case 
N5: { Health50(id); }
        case 
N6: { Health60(id); }
        case 
N7: { Health70(id); }
        case 
N8: { Health80(id); }
        case 
N9: { Health90(id); }
        case 
N0: { return; }
    }
}

Health10(id)
{
    new 
hp get_user_healthid );
    new 
amount floatround(get_cvar_float("healamount"), floatround_floor);
    new 
sum = (hp amount);
    
    if (
sum 100)
    {
        
set_user_health(idsum);
    }
    else
    {
        
set_user_health(id100);
    }
}

Health20(id)
{
    new 
hp get_user_healthid );
    new 
amount floatround(get_cvar_float("healamount"), floatround_floor);
    new 
sum = (hp amount);
        
    if (
sum 100)
    {
        
set_user_health(idsum);
    }
    else
    {
        
set_user_health(id100);
    }
}

Health30(id)
{
    new 
hp get_user_health(id);
    new 
amount floatround(get_cvar_float("healamount"), floatround_floor);
    new 
sum = (hp amount);
        
    if (
sum 100)
    {
        
set_user_health(idsum);
    }
    else
    {
        
set_user_health(id100);
    }
}

Health40(id)
{
    new 
hp get_user_health(id);
    new 
amount floatround(get_cvar_float("healamount"), floatround_floor);
    new 
sum = (hp amount);
        
    if (
sum 100)
    {
        
set_user_health(idsum);
    }
    else
    {
        
set_user_health(id100);
    }
}

Health50(id)
{
    new 
hp get_user_health(id);
    new 
amount floatround(get_cvar_float("healamount"), floatround_floor);
    new 
sum = (hp amount);
        
    if (
sum 100)
    {
        
set_user_health(idsum);
    }
    else
    {
        
set_user_health(id100);
    }
}

Health60(id)
{
    new 
hp get_user_health(id);
    new 
amount floatround(get_cvar_float("healamount"), floatround_floor);
    new 
sum = (hp amount);
        
    if (
sum 100)
    {
        
set_user_health(idsum);
    }
    else
    {
        
set_user_health(id100);
    }
}

Health70(id)
{
    new 
hp get_user_health(id);
    new 
amount floatround(get_cvar_float("healamount"), floatround_floor);
    new 
sum = (hp amount);
        
    if (
sum 100)
    {
        
set_user_health(idsum);
    }
    else
    {
        
set_user_health(id100);
    }
}

Health80(id)
{
    new 
hp get_user_health(id);
    new 
amount floatround(get_cvar_float("healamount"), floatround_floor);
    new 
sum = (hp amount);
        
    if (
sum 100)
    {
        
set_user_health(idsum);
    }
    else
    {
        
set_user_health(id100);
    }
}

Health90(id)
{
    new 
hp get_user_health(id);
    new 
amount floatround(get_cvar_float("healamount"), floatround_floor);
    new 
sum = (hp amount);
        
    if (
sum 100)
    {
        
set_user_health(idsum);
    }
    else
    {
        
set_user_health(id100);
    }
}[/
HTML][/CODE
__________________
BigMac 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 15:09.


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