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

[REQ] Already 2 Flashbang


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShLuMieL
Senior Member
Join Date: Jul 2010
Old 12-24-2011 , 20:55   [REQ] Already 2 Flashbang
Reply With Quote #1

hey for all,

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#define PLUGIN "Ammo"    
#define VERSION "1.0"    
#define AUTHOR "Asaf Mazon"  
public plugin_init()
{    
 
register_plugin(PLUGINVERSIONAUTHOR)    
 
 
register_clcmd("say /ammo""ammo"); 
}    
public 
ammo(id)
{
 new 
menu menu_create("Flashbang""ammo3");
 
menu_additem(menu"\wFlashbang""1"0);
 
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
 
menu_display(idmenu0);
 return 
PLUGIN_HANDLED;
}
public 
ammo3(idmenuitem)
{
 if(
item == MENU_EXIT)
 {
  
menu_destroy(menu);
  return 
PLUGIN_HANDLED;
 }
 
 new 
data[6], szName[64];
 new 
accesscallback;
 
menu_item_getinfo(menuitemaccessdata,5szName,63callback);
 
 new 
key str_to_num(data);
 
 switch(
key)
 {
  case 
1:
  {
   if(
user_has_weapon(idCSW_FLASHBANG2))
   {
    
ColorChat(idNORMAL"%s You need to drop your^x04 1^x01 of your^x04 Flashbang's^x01 first."TAG);
    return 
PLUGIN_HANDLED;
   }
   
   
give_item(id"weapon_flashbang")
   
ColorChat(idNORMAL"%s You have bought^x04 Flashbang."TAG);
  }
 }
 
menu_destroy(menu);
 return 
PLUGIN_HANDLED;

hey someone can to fix me that's ?

i want if i have 2 flashbang its write [need drop 1] and if i'll drop 1 and

press on flashbang its will add me 1.

Thank's.
ShLuMieL is offline
Splot
Junior Member
Join Date: Nov 2011
Old 12-24-2011 , 21:27   Re: [REQ] Already 2 Flashbang
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <colorchat>
#include <fun>
 
new const TAG[] = "[YourTag]"

public plugin_init() {    
    
register_plugin("ammo""1.0""Asaf Mazon")    
 
    
register_clcmd("say /ammo""ammo"); 
}  
  
public 
ammo(id) {
    new 
menu menu_create("Flashbang""ammo3");
    
menu_additem(menu"\wFlashbang""1"0);
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
    return 
PLUGIN_HANDLED;
}    

public 
ammo3(idmenuitem
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
 
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5szName,63callback);
 
    new 
key str_to_num(data);
 
    switch(
key)
    {
        case 
1:
        {
            if( 
cs_get_user_bpammo(idCSW_FLASHBANG) == 2) {
                
ColorChat(idNORMAL"%s You need to drop your^x04 1^x01 of your^x04 Flashbang's^x01 first."TAG);
                return 
PLUGIN_HANDLED;
            }
            else {
                
give_itemid"weapon_flashbang" );
                
ColorChat(idNORMAL"%s You have bought^x04 Flashbang."TAG);
            }
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;


Last edited by Splot; 12-24-2011 at 21:37.
Splot is offline
Heartbeat
Member
Join Date: Nov 2011
Location: Denmark
Old 12-25-2011 , 04:16   Re: [REQ] Already 2 Flashbang
Reply With Quote #3

Why make a menu with only 1 option?
Heartbeat is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-25-2011 , 07:18   Re: [REQ] Already 2 Flashbang
Reply With Quote #4

Better to check >=2 or > 1 than ==2, just in case.

@Heartbeat
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
ShLuMieL
Senior Member
Join Date: Jul 2010
Old 12-25-2011 , 08:33   Re: [REQ] Already 2 Flashbang
Reply With Quote #5

thank's you i'll try if have a problem i just edit the post

// Edit.

Work.
Thank's.

Last edited by ShLuMieL; 12-25-2011 at 08:37.
ShLuMieL 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 14:13.


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