Raised This Month: $ Target: $400
 0% 

Help for this menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Choose_Your_Destiny
Senior Member
Join Date: May 2011
Old 10-02-2011 , 10:58   Help for this menu
Reply With Quote #1

Hi guys.

Can you help me for this menu?

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

#define PLUGIN    "JB: One Projectile Weapons"
#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[OPW]^1"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
server_print(LOADINGPLUGINVERSIONAUTHOR);
    
    
RegisterHam(Ham_Spawn"player""OneProjectileWeapons"1);
    
    
cost    register_cvar("v_deagle" "3750")
    
cost    register_cvar("v_galil" "7500")
    
cost    register_cvar("v_famas" "11500")
    
cost    register_cvar("v_m4a1" "13000")
    
cost    register_cvar("v_awp" "16000")
}

public 
OneProjectileWeapons(id)
{
    if(
get_user_team(id) == CS_TEAM_T)
    {
        new 
OPW_menu menu_create("\r#\w#\r#\w#\r#\w#\r#\w#\r= [OPW] - Choose Weapon: \w=\r#\w#\r#\w#\r#\w#\r#\w#","MenuHandler");
        
menu_additem(OPW_menu"\wOne Projectile Deagle - 3750 $""1"0);
        
menu_additem(OPW_menu"\wOne Projectile Galil - 7500 $""2"0);
        
menu_additem(OPW_menu"\wOne Projectile Famas - 11500 $""3"0);
        
menu_additem(OPW_menu"\wOne Projectile M4a1 - 13000 $""4"0);
        
menu_additem(OPW_menu"\wOne Projectile Awp - 16000 $""5"0);
        
        
menu_setprop(OPW_menuMPROP_EXITMEXIT_ALL)
        
        
menu_display(idTMS_menu0)
    }
}

public 
MenuHandler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iIsim[64]
    new 
accescallback
    menu_item_getinfo
(menuitemaccesdata5iIsim63callback)
    
    new 
key str_to_num(data)
    
    switch(
key)
    {
        case 
1:
        {
            new 
player_cash cs_get_user_money(id)
            new 
weapon_cash get_pcvar_num(cost)
            if (
player_cash weapon_cash)
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cash >= weapon_cash)
            {
                
ColorChat(0NORMAL"^4%s^1: You have purchased one projectile deagle.!",tag)
                
cs_set_weapon_ammo(give_item(id"weapon_deagle"), 1)
                
cs_set_user_bpammo(idCSW_DEAGLE0)
                
cs_set_user_money(idplayer_cash weapon_cash)
            }
        }
        
        case 
2:
        {
            new 
player_cash cs_get_user_money(id)
            new 
weapon_cash get_pcvar_num(cost)
            if (
player_cash weapon_cash)
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cash >= weapon_cash)
            {
                
ColorChat(0NORMAL"^4%s^1: You have purchased one projectile galil.!",tag)
                
cs_set_weapon_ammo(give_item(id"weapon_galil"), 1)
                
cs_set_user_bpammo(idCSW_GALIL0)
                
cs_set_user_money(idplayer_cash weapon_cash)
            }
        }
        
        case 
3:
        {
            new 
player_cash cs_get_user_money(id)
            new 
weapon_cash get_pcvar_num(cost)
            if (
player_cash weapon_cash )
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cash >= weapon_cash)
            {
                
ColorChat(0NORMAL"^4%s^1: You have purchased one projectile famas.!",tag)
                
cs_set_weapon_ammo(give_item(id"weapon_famas"), 1)
                
cs_set_user_bpammo(idCSW_FAMAS0)
                
cs_set_user_money(idplayer_cash weapon_cash)
            }
        }
        
        case 
4:
        {
            new 
player_cash cs_get_user_money(id)
            new 
weapon_cash get_pcvar_num(cost)
            if (
player_cash weapon_cash )
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cash >= weapon_cash)
            {
                
ColorChat(0NORMAL"^4%s^1: You have purchased one projectile m4a1.!",tag)
                
cs_set_weapon_ammo(give_item(id"weapon_m4a1"), 1)
                
cs_set_user_bpammo(idCSW_M4A10)
                
cs_set_user_money(idplayer_cash weapon_cash)
            }
        }
        
        case 
5:
        {
            new 
player_cash cs_get_user_money(id)
            new 
weapon_cash get_pcvar_num(cost)
            if (
player_cash weapon_cash )
            {
                
ColorChat(0NORMAL"^4%s^1: Don't have enough money.!",tag)
                return 
PLUGIN_HANDLED
            
}
            else if (
player_cash >= weapon_cash)
            {
                
ColorChat(0NORMAL"^4%s^1: You have purchased one projectile awp.!",tag)
                
cs_set_weapon_ammo(give_item(id"weapon_awp"), 1)
                
cs_set_user_bpammo(idCSW_AWP0)
                
cs_set_user_money(idplayer_cash weapon_cash)
            }
        }
    }

Kill the enemy wins 1 bpammo.

EX:

Buys weapon -> 1/0

Kill the enemy -> 0/1
Choose_Your_Destiny 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:44.


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