Raised This Month: $ Target: $400
 0% 

FirstPlugin [hp]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-18-2009 , 10:50   Re: FirstPlugin [hp]
Reply With Quote #3

Try this.

PHP Code:
#include <amxmodx>
#include <fun>

new gKeysHealthMenu;
new 
gszHealthMenu256 ];

public 
plugin_init( ) {
    
register_clcmd"say /lucky""showHealthMenu" );
    
    
// create menu
    
add(gszHealthMenusizeofgszHealthMenu ), "\yHealth Menu^n^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r1. \wHP 10^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r2. \wHP 20^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r3. \wHP 30^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r4. \wHP 40^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r5. \wHP 50^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r6. \wHP 60^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r7. \wHP 70^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r8. \wHP 80^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r9. \wHP 90^n^n");
    
add(gszHealthMenusizeofgszHealthMenu ), "\r0. \wClose");
    
gKeysHealthMenu MENU_KEY_1 MENU_KEY_2 MENU_KEY_3 MENU_KEY_4 MENU_KEY_5 |
            
MENU_KEY_6 MENU_KEY_7 MENU_KEY_8 MENU_KEY_9 MENU_KEY_0;
    
    
register_menucmdregister_menuid"HealthMenu" ), gKeysHealthMenu"handleHealthMenu" );
}

public 
showHealthMenuid ) {
    if( 
is_user_aliveid ) )
        
show_menuidgKeysHealthMenugszHealthMenu, -1"HealthMenu" );
    
    return 
PLUGIN_HANDLED;
}

public 
handleHealthMenuidiNum ) {
    if( !
is_user_aliveid ) )
        return 
PLUGIN_HANDLED;
    
    if( 
iNum == )
        return 
PLUGIN_HANDLED;
    
    new 
iGiveHp 10 + ( iNum 10 );
    
    
set_user_healthidclampiGiveHp0100 ) );
    
    return 
PLUGIN_HANDLED;

__________________

Last edited by xPaw; 08-18-2009 at 11:01.
xPaw is offline
 



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