Raised This Month: $ Target: $400
 0% 

Need Code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 10-02-2011 , 17:43   Need Code
Reply With Quote #1

How bpammo buying from the menu?

PHP Code:
public xxxx(id)
{
    if(
get_user_team(id))
    {
        new 
menu menu_create("\r#\w#\r#\w#\r#\w#\r#\w#\r= [CTMENU] \w=\r#\w#\r#\w#\r#\w#\r#\w#","yyy");
        
menu_additem(menu"\w90 Bpammo - 3750 $""1"0);
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL)
        
        
menu_display(idmenu0)
    }


Last edited by Choose_Your_Destiny; 10-02-2011 at 17:46.
Choose_Your_Destiny is offline
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 10-02-2011 , 18:50   Re: Need Code
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=46364
__________________
Zombie Mod + gameMe stats :
plowed is offline
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 10-02-2011 , 19:05   Re: Need Code
Reply With Quote #3

I couldn't find
Choose_Your_Destiny is offline
enjoi.
Veteran Member
Join Date: Mar 2011
Old 10-02-2011 , 19:26   Re: Need Code
Reply With Quote #4

you blinD?
__________________
Block Maker v6.0 []
Point Slay v3.0 []
Contact [ PM ]

Last edited by xPaw; 10-05-2011 at 08:42. Reason: No need to quote whole post from different thread.
enjoi. is offline
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 10-02-2011 , 19:32   Re: Need Code
Reply With Quote #5

Hey man!!

I don't this ask.I want to say ; from menu get bpammo(for any weapon)
Choose_Your_Destiny is offline
plowed
Senior Member
Join Date: Oct 2010
Location: germany
Old 10-02-2011 , 19:33   Re: Need Code
Reply With Quote #6

Your menu is not even complete. Change the ammo with cs_set_user_bpammo and include <cstrike>

PHP Code:

#include <amxmodx>

public plugin_init() {
        
}

public 
xxxx(id)
{
    if(
get_user_team(id))
    {
        new 
menu menu_create("\r#\w#\r#\w#\r#\w#\r#\w#\r= [CTMENU] \w=\r#\w#\r#\w#\r#\w#\r#\w#","handler");
        
menu_additem(menu"\w90 Bpammo - 3750 $""1"0);
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL)
        
        
menu_display(idmenu0)
    }
}  

 public 
handler(idmenuitem)
 {
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }

    
    new 
data[6], szName[64];
    new 
accesscallback;
 
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);

    new 
key str_to_num(data);

    switch(
key)
    {
        case 
1:
        {
            
//User selected the first item in the menu, 
        
}
    case 
2:
        {
            
//User selected the second item in the menu
        
}
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 
__________________
Zombie Mod + gameMe stats :
plowed is offline
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 10-02-2011 , 19:45   Re: Need Code
Reply With Quote #7

Ok. I know
Choose_Your_Destiny is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 10-02-2011 , 20:04   Re: Need Code
Reply With Quote #8

Enjoi. Just link the topic next time lol.
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 10-03-2011 , 04:22   Re: Need Code
Reply With Quote #9

Ok. But, I don't know weapons in the hands of the players?

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

#define PLUGIN    "CT Menu"
#define VERSION    "1.0"
#define AUTHOR    "Choose"
#define LOADING    "^n^t%s v%s, Copyright (C) 2011 by %s^n"

new cost
new tag[]="^4[CTMENU]^1"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
server_print(LOADINGPLUGINVERSIONAUTHOR);
    
    
RegisterHam(Ham_Spawn"player""CTMenu"1);
    
    
cost    register_cvar("100 HP" "3750")
    
cost    register_cvar("250 HP" "7500")
    
cost    register_cvar("100 Armor" "11500")
    
cost    register_cvar("30 Bpammo" "15000")
}

public 
CTMenu(id)
{
    if(
get_user_team(id) == CS_TEAM_CT)
    {
        new 
menu menu_create("\r#\w#\r#\w#\r#\w#\r#\w#\r= [CTMENU] - What would buy?: \w=\r#\w#\r#\w#\r#\w#\r#\w#","CTMenuHandler");
        
menu_additem(menu"\w100 HP - 3750 CT Cost""1"0);
        
menu_additem(menu"\w250 HP - 7500 CT Cost""2"0);
        
menu_additem(menu,  "\w100 Armor - CT Cost""3"0);
        
menu_additem(menu"\w90 Bpammo - CT Cost""4"0);
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL)
        
        
menu_display(idmenu0)
    }
}

public 
CTMenuHandler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64]
    new 
accescallback
    menu_item_getinfo
(menuitemaccesdata5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
key)
    {
        case 
1:
        {
            new 
player_cost cs_get_user_money(id)
            new 
menu_cost get_pcvar_num(cost)
            if (
player_cost menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 100 HP purchased.!",tag)
                
cs_set_user_health(id100)
                
cs_set_user_money(idplayer_cost menu_cost)
            }
        }
        
        case 
2:
        {
            new 
player_cost cs_get_user_money(id)
            new 
menu_cost get_pcvar_num(cost)
            if (
player_cost menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 250 HP purchased.!",tag)
                
cs_set_user_health(id250)
                
cs_set_user_money(idplayer_cost menu_cost)
            }
        }
        
        case 
3:
        {
            new 
player_cost cs_get_user_money(id)
            new 
menu_cost get_pcvar_num(cost)
            if (
player_cost menu_cost )
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 100 Armor purchased.!",tag)
                
cs_set_user_armor(id100)
                
cs_set_user_money(idplayer_cost menu_cost)
            }
        }
        
        case 
4:
        {
            new 
player_cost cs_get_user_money(id)
            new 
menu_cost get_pcvar_num(cost)
            if (
player_cost menu_cost )
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 90 bpammo purchased.!",tag)
                
cs_set_user_bpammo(idCSW_xxxxx90)
                
cs_set_user_money(idplayer_csot menu_cost)
            }
        }
    }


PHP Code:
CSW_xxxxx 

Last edited by Choose_Your_Destiny; 10-03-2011 at 04:44.
Choose_Your_Destiny is offline
BrundiX
Junior Member
Join Date: Dec 2010
Old 10-05-2011 , 03:18   Re: Need Code
Reply With Quote #10

Quote:
Originally Posted by Choose_Your_Destiny View Post
Ok. But, I don't know weapons in the hands of the players?

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

#define PLUGIN    "CT Menu"
#define VERSION    "1.0"
#define AUTHOR    "Choose"
#define LOADING    "^n^t%s v%s, Copyright (C) 2011 by %s^n"

new cost
new tag[]="^4[CTMENU]^1"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
server_print(LOADINGPLUGINVERSIONAUTHOR);
    
    
RegisterHam(Ham_Spawn"player""CTMenu"1);
    
    
cost    register_cvar("100 HP" "3750")
    
cost    register_cvar("250 HP" "7500")
    
cost    register_cvar("100 Armor" "11500")
    
cost    register_cvar("30 Bpammo" "15000")
}

public 
CTMenu(id)
{
    if(
get_user_team(id) == CS_TEAM_CT)
    {
        new 
menu menu_create("\r#\w#\r#\w#\r#\w#\r#\w#\r= [CTMENU] - What would buy?: \w=\r#\w#\r#\w#\r#\w#\r#\w#","CTMenuHandler");
        
menu_additem(menu"\w100 HP - 3750 CT Cost""1"0);
        
menu_additem(menu"\w250 HP - 7500 CT Cost""2"0);
        
menu_additem(menu,  "\w100 Armor - CT Cost""3"0);
        
menu_additem(menu"\w90 Bpammo - CT Cost""4"0);
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL)
        
        
menu_display(idmenu0)
    }
}

public 
CTMenuHandler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64]
    new 
accescallback
    menu_item_getinfo
(menuitemaccesdata5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
key)
    {
        case 
1:
        {
            new 
player_cost cs_get_user_money(id)
            new 
menu_cost get_pcvar_num(cost)
            if (
player_cost menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 100 HP purchased.!",tag)
                
cs_set_user_health(id100)
                
cs_set_user_money(idplayer_cost menu_cost)
            }
        }
        
        case 
2:
        {
            new 
player_cost cs_get_user_money(id)
            new 
menu_cost get_pcvar_num(cost)
            if (
player_cost menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 250 HP purchased.!",tag)
                
cs_set_user_health(id250)
                
cs_set_user_money(idplayer_cost menu_cost)
            }
        }
        
        case 
3:
        {
            new 
player_cost cs_get_user_money(id)
            new 
menu_cost get_pcvar_num(cost)
            if (
player_cost menu_cost )
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 100 Armor purchased.!",tag)
                
cs_set_user_armor(id100)
                
cs_set_user_money(idplayer_cost menu_cost)
            }
        }
        
        case 
4:
        {
            new 
player_cost cs_get_user_money(id)
            new 
menu_cost get_pcvar_num(cost)
            if (
player_cost menu_cost )
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 90 bpammo purchased.!",tag)
                
cs_set_user_bpammo(idCSW_xxxxx90)
                
cs_set_user_money(idplayer_csot menu_cost)
            }
        }
    }


PHP Code:
CSW_xxxxx 

something like this?
PHP Code:
#include <amxmodx>
#include <fun>
#include <cstrike>
#include <colorchat>

#define PLUGIN    "CT Menu"
#define VERSION    "1.0"
#define AUTHOR    "Choose"
#define LOADING    "^n^t%s v%s, Copyright (C) 2011 by %s^n"

new costcost2cost3cost4;
new 
tag[]="^4[CTMENU]^1";

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
server_print(LOADINGPLUGINVERSIONAUTHOR);
    
    
cost    register_cvar("100 HP" "3750");
    
cost2    register_cvar("250 HP" "7500");
    
cost3    register_cvar("100 Armor" "11500");
    
cost4    register_cvar("30 Bpammo" "15000");
}

public 
CTMenu(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id))
    {
        
MakeMenu(id);
    }
}
        
MakeMenu(id)
{
    new 
menu menu_create("\r#\w#\r#\w#\r#\w#\r#\w#\r= [CTMENU] - What would buy?: \w=\r#\w#\r#\w#\r#\w#\r#\w#","CTMenuHandler");
    
menu_additem(menu"\w100 HP - 3750 CT Cost""1"0);
    
menu_additem(menu"\w250 HP - 7500 CT Cost""2"0);
    
menu_additem(menu,  "\w100 Armor - CT Cost""3"0);
    
menu_additem(menu"\w90 Bpammo - CT Cost""4"0);
        
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
    
menu_display(idmenu0);
}

public 
CTMenuHandler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accescallback;
    
menu_item_getinfo(menuitemaccesdata5iName63callback);
    
    new 
key str_to_num(data);
    
    new 
player_cost cs_get_user_money(id);
    
    switch(
key)
    {
        case 
1:
        {
            new 
menu_cost get_pcvar_num(cost);
            if (
player_cost menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag);
                return 
PLUGIN_HANDLED;
            }
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 100 HP purchased.!",tag);
                
set_user_health(id100);
                
cs_set_user_money(idplayer_cost menu_cost);
            }
        }
        
        case 
2:
        {
            new 
menu_cost get_pcvar_num(cost2);
            if (
player_cost menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag);
                return 
PLUGIN_HANDLED;
            }
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 250 HP purchased.!",tag);
                
set_user_health(id250);
                
cs_set_user_money(idplayer_cost menu_cost);
            }
        }
        
        case 
3:
        {
            new 
menu_cost get_pcvar_num(cost3);
            if (
player_cost menu_cost )
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag);
                return 
PLUGIN_HANDLED;
            }
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 100 Armor purchased.!",tag);
                
set_user_armor(id100);
                
cs_set_user_money(idplayer_cost menu_cost);
            }
        }
        
        case 
4:
        {
            new 
menu_cost get_pcvar_num(cost4);
            if (
player_cost menu_cost )
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough CT money.!",tag);
                return 
PLUGIN_HANDLED;
            }
            else if (
player_cost >= menu_cost)
            {
                
ColorChat(0NORMAL"^4%s^1: 90 bpammo purchased.!",tag);
                
cs_set_user_bpammo(idget_user_weapon(id), 90);
                
cs_set_user_money(idplayer_cost menu_cost);
            }
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_CONTINUE;

BrundiX is offline
Reply



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 19:31.


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