Raised This Month: $12 Target: $400
 3% 

[REQ] Plugin edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
erader
Senior Member
Join Date: Dec 2010
Old 08-26-2011 , 06:50   [REQ] Plugin edit
Reply With Quote #1

Hi, I have this deathrun menu for terrorist:

Code:
#include <amxmodx> 
#include <amxmisc> 
#include <hamsandwich> 
#include <fun> 
#include <cstrike> 

#define PLUGIN "deathrun menu" 
#define VERSION "1.0" 
#define AUTHOR "r0ck" 

public plugin_init()  
{ 
    register_plugin(PLUGIN, VERSION, AUTHOR) 
     
    RegisterHam(Ham_Spawn, "player", "player_spawn", 1) 
} 

public player_spawn(id) 
{ 
    if( is_user_alive( id ) && cs_get_user_team( id ) == CS_TEAM_T ) 
        deathrun_menu( id ) 
         
    return PLUGIN_CONTINUE 
} 
public deathrun_menu(id) 
{ 
    new menu = menu_create("\yDeathrun menu:", "sub_menu") 

    menu_additem(menu, "500 Health", "1", 0); 
    menu_additem(menu, "Invisibility", "2", 0); 
    menu_additem(menu, "Glock", "3", 0); 
         
    menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); 
    menu_display(id, menu, 0); 
}     

public sub_menu(id, menu, item) 
{ 
     
    if (item == MENU_EXIT) 
    { 
        menu_destroy(menu); 
        return PLUGIN_HANDLED; 
    } 
     
    new data[6], szName[64]; 
    new access, callback; 
     
    menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback); 
     
    new Key = str_to_num(data); 
     
    switch (Key) 
    { 
        case 1: 
        { 
            set_user_health( id, 500 ) 
        } 
        case 2:  
        { 
            set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 15); 
        } 
        case 3: 
        { 
            give_item(id, "weapon_glock") 
            cs_set_user_bpammo(id, CSW_GLOCK18, 60) 
        } 
    } 
     
    menu_destroy(menu); 
    return PLUGIN_HANDLED; 
}
If you can, add a new item to it: to give 30 flashbang's.
__________________
If you live for something, you're not alone my friend...

Last edited by erader; 08-26-2011 at 07:01.
erader is offline
Stressful
Senior Member
Join Date: Feb 2011
Old 08-26-2011 , 07:10   Re: [REQ] Plugin edit
Reply With Quote #2

30 Flashbang?! Each player can only have 2 flashbang each.
__________________
Stressful is offline
erader
Senior Member
Join Date: Dec 2010
Old 08-26-2011 , 07:20   Re: [REQ] Plugin edit
Reply With Quote #3

Quote:
Originally Posted by Stressful View Post
30 Flashbang?! Each player can only have 2 flashbang each.
But there are plugins like: http://forums.alliedmods.net/showthread.php?p=610340
that can increase the number of them.

I don't use it becouse I want this item in that menu.
__________________
If you live for something, you're not alone my friend...
erader is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-26-2011 , 08:37   Re: [REQ] Plugin edit
Reply With Quote #4

PHP Code:
#include <amxmodx> 
#include <amxmisc> 
#include <hamsandwich> 
#include <fun> 
#include <cstrike> 

#define PLUGIN "deathrun menu" 
#define VERSION "1.0" 
#define AUTHOR "r0ck" 

new menu;

public 
plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR
     
    
RegisterHam(Ham_Spawn"player""player_spawn"1
    
    
    
menu menu_create("\yDeathrun menu:""sub_menu"
    
menu_additem(menu"500 Health""1"0); 
    
menu_additem(menu"Invisibility""2"0); 
    
menu_additem(menu"Glock""3"0); 
    
menu_additem(menu"30 Flashbangs""4");


public 
player_spawn(id

    if( 
is_user_aliveid ) && cs_get_user_teamid ) == CS_TEAM_T 
        
menu_display(idmenu);



public 
sub_menu(idmenuitem

    switch(
item)
    {
        case 
0:
        { 
            
set_user_healthid500 
        } 
        
        case 
1:  
        { 
            
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha15); 
        } 
        
        case 
2
        { 
            
give_item(id"weapon_glock18"
            
cs_set_user_bpammo(idCSW_GLOCK1860
        } 
        
        case 
3:
        {
            
give_item(id"weapon_flashbang");
            
cs_set_user_bpammo(idCSW_FLASHBANG30);
        }
    } 
     
    return 
PLUGIN_HANDLED

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Reply


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 11:05.


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