Raised This Month: $ Target: $400
 0% 

Grenade plugin, i want menu no close.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
KillerMasa
Senior Member
Join Date: May 2012
Old 07-02-2012 , 15:45   Grenade plugin, i want menu no close.
Reply With Quote #1

Hey,

i found grenade shop plugin, could you please make when players buy one grenade the menu not close, but you can close it.
PHP Code:
/* Script generated by Pawn Studio */
#include <amxmodx>
#include <cstrike>
#include <csx>
#include <fun>
#define PLUGIN "Grenade Shop"
#define AUTHOR "GXLZPGX"
#define VERSION "1.0"
new hecostflashcostsmokecost;
public 
plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
//command to open the menu
 
register_clcmd"say /nades""gshop" )
 
register_clcmd"say_team /nades""gshop" )
 
register_clcmd"say nades""gshop" )
 
register_clcmd"say_team nades""gshop" )
 
 
//cvars
 
hecost  register_cvar"gshop_hecost""500" )
 
flashcost  register_cvar"gshop_flashcost""750" )
 
smokecost  register_cvar"gshop_smokecost""500" )
}
public 
gshop(id)
{
 if( !
is_user_alive(id) )
 {
  return 
PLUGIN_HANDLED;
 }
 
 new 
menu menu_create"\yGrenade Shop""gshop_handler" )
 
 new 
szHE[32];
 
formatexszHEcharsmax(szHE), "HE Grenade %i$"get_pcvar_num(hecost) )
 
menu_additemmenuszHE"1")
 
 new 
szFLASH[32];
 
formatexszFLASHcharsmax(szFLASH), "Flash Grenade %i$"get_pcvar_num(flashcost) )
 
menu_additemmenuszFLASH"2")
 
 new 
szSMOKE[32];
 
formatexszSMOKEcharsmax(szSMOKE), "Smoke Grenade %i$"get_pcvar_num(smokecost) )
 
menu_additemmenuszSMOKE"3")
 
 
menu_setprop(menuMPROP_EXITMEXIT_ALL);
 
menu_display(idmenu0);
 
 return 
PLUGIN_HANDLED;
}
public 
gshop_handler(idmenuitem)
{
 if( 
item == MENU_EXIT )
 {
  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:
  {
   if( !
is_user_alive(id) )
   {
    return 
PLUGIN_HANDLED;
   }
 
   new 
money cs_get_user_money(id)
 
   if( 
money get_pcvar_num(hecost) )
   {
    return 
PLUGIN_HANDLED;
   }
 
   if( 
user_has_weapon(idCSW_HEGRENADE) )
   {
    new 
ammo cs_get_user_bpammo(idCSW_HEGRENADE)
    
cs_set_user_bpammo(idCSW_HEGRENADEammo 1)
   } else {
    
give_itemid"weapon_hegrenade" )
   }
 
   
cs_set_user_moneyidmoney -= get_pcvar_num(hecost) )
  }
 
  case 
2:
  {
   if( !
is_user_alive(id) )
   {
    return 
PLUGIN_HANDLED;
   }
 
   new 
money cs_get_user_money(id)
 
   if( 
money get_pcvar_num(flashcost) )
   {
    return 
PLUGIN_HANDLED;
   }
 
   if( 
user_has_weapon(idCSW_FLASHBANG) )
   {
    new 
ammo cs_get_user_bpammo(idCSW_FLASHBANG)
    
cs_set_user_bpammo(idCSW_FLASHBANGammo 1)
   } else {
    
give_itemid"weapon_flashbang" )
   }
 
   
cs_set_user_moneyidmoney -= get_pcvar_num(flashcost) )
  }
 
  case 
3:
  {
   if( !
is_user_alive(id) )
   {
    return 
PLUGIN_HANDLED;
   }
 
   new 
money cs_get_user_money(id)
 
   if( 
money get_pcvar_num(smokecost) )
   {
    return 
PLUGIN_HANDLED;
   }
 
   if( 
user_has_weapon(idCSW_SMOKEGRENADE) )
   {
    new 
ammo cs_get_user_bpammo(idCSW_SMOKEGRENADE)
    
cs_set_user_bpammo(idCSW_SMOKEGRENADEammo 1)
   } else {
    
give_itemid"weapon_smokegrenade" )
   }
 
   
cs_set_user_moneyidmoney -= get_pcvar_num(smokecost) )
  }
 }
 
 return 
PLUGIN_HANDLED;


Last edited by KillerMasa; 07-02-2012 at 15:49.
KillerMasa 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:17.


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