#include < amxmodx >
#include < cstrike >
#include <fun>
#include <jail>
new acAltMenuTag[32],acUstMenuTag[32];
//new bool:secti1[32],secti2[32],secti3[32],secti4[32],secti5[32],secti6[32],secti7[32];
public plugin_init(){
register_plugin("New Plug-In","1.0","author");
register_clcmd("say /getir","aeGetirMenu");
new acMenuTag = register_cvar("ac_MenuTag","\w[\rwD\w]");
get_pcvar_string(acMenuTag,acAltMenuTag,charsmax(acAltMenuTag));
new acUstTag = register_cvar("ac_UstMenuTag","WEBDiyo");
get_pcvar_string(acUstTag,acUstMenuTag,charsmax(acUstMenuTag));
}
public aeGetirMenu(acID){
new acMenu = acMenuOlustur("Silah Seciniz","aeGetirMenu_devam");
acMenuSecenekEkle(acMenu,"AK-47","1");
acMenuSecenekEkle(acMenu,"M4A1","2");
acMenuSecenekEkle(acMenu,"AWP","3");
acMenuSecenekEkle(acMenu,"DEAGLE","4");
acMenuSecenekEkle(acMenu,"GLOCK","5");
acMenuSecenekEkle(acMenu,"USP","6");
acMenuSecenekEkle(acMenu,"AUG","7");
acMenuBitir(acID,acMenu);
}
public aeGetirMenu_devam(acID,acMenu,acMEsya){
if(acMEsya == MENU_EXIT){ menu_destroy(acMenu); return PLUGIN_HANDLED; }
new acMVeri[6],acBos;
menu_item_getinfo(acMenu,acMEsya,acBos,acMVeri,5,_,_,acBos);
new acKey = str_to_num(acMVeri);
switch(acKey){
case 1 : {
if(jb_get_user_packs(acID) >= 20){
give_item(acID, "weapon_ak47")
mermi_ver(acID)
jb_set_user_packs(acID,jb_get_user_packs(acID) - 20)
}
}
case 2 : {
if(jb_get_user_packs(acID) >= 20){
give_item(acID, "weapon_m4a1")
mermi_ver(acID)
jb_set_user_packs(acID,jb_get_user_packs(acID) - 20)
}
}
case 3 : {
if(jb_get_user_packs(acID) >= 20){
give_item(acID, "weapon_awp")
mermi_ver(acID)
jb_set_user_packs(acID,jb_get_user_packs(acID) - 20)
}
}
case 4 : {
if(jb_get_user_packs(acID) >= 20){
give_item(acID, "weapon_deagle")
mermi_ver(acID)
jb_set_user_packs(acID,jb_get_user_packs(acID) - 20)
}
}
case 5 : {
if(jb_get_user_packs(acID) >= 20){
give_item(acID, "weapon_glock")
mermi_ver(acID)
jb_set_user_packs(acID,jb_get_user_packs(acID) - 20)
}
}
case 6 : {
if(jb_get_user_packs(acID) >= 20){
give_item(acID, "weapon_usp")
mermi_ver(acID)
jb_set_user_packs(acID,jb_get_user_packs(acID) - 20)
}
}
case 7 : {
if(jb_get_user_packs(acID) >= 20){
give_item(acID, "weapon_aug")
mermi_ver(acID)
jb_set_user_packs(acID,jb_get_user_packs(acID) - 20)
}
}
}
menu_destroy(acMenu);
return PLUGIN_HANDLED;
}
public mermi_ver(acID) {
{
client_cmd(acID, "messagemode mermi")
new sayy[300]
read_args(sayy, charsmax(sayy))
remove_quotes(sayy)
if(!is_str_num(sayy) || equal(sayy, ""))
return PLUGIN_HANDLED
mermi(acID, sayy)
return PLUGIN_CONTINUE
}
}
mermi(acID, sayy[]) {
new amount = str_to_num(sayy)
new szWeapon[ 20 ];
get_weaponname( get_user_weapon( acID ) , szWeapon , 19 );
if(jb_get_user_packs(acID) < amount){
renkli_yazi(acID,("!nMermi Alabilmek Icin Yeteri Kadar !tJB'n Yok.!y!"))
}
else{
cs_set_user_bpammo(acID,szWeapon[ 7 ],amount)
jb_set_user_packs(acID,jb_get_user_packs(acID) - amount)
renkli_yazi(acID,("!nBasarili Bir Sekilde %d !nAdet Mermi Satin ALDIN."),amount)
}
return PLUGIN_HANDLED
}
stock acMenuOlustur(const acBaslik[],const acDevam[], any:...){
new acYeniBaslik[256],acDuzeltBaslik[256];
vformat(acDuzeltBaslik,charsmax(acDuzeltBaslik),acBaslik,3);
formatex(acYeniBaslik,charsmax(acYeniBaslik),"\r( \w%s \r~\w> \ySilah Menu \r) \y>> \r( \w%s \r)",acUstMenuTag,acDuzeltBaslik);
new acMenu = menu_create(acYeniBaslik,acDevam);
return acMenu;
}
stock acMenuSecenekEkle(acMenuID,const acSecenekBaslik[],const acBilgi[],acTag = 1, any:...){
new acYeniSecenekBaslik[256],acSecenekDuzelt[256];
vformat(acSecenekDuzelt,charsmax(acSecenekDuzelt),acSecenekBaslik,5);
if(acTag == 1){
formatex(acYeniSecenekBaslik,charsmax(acYeniSecenekBaslik),"%s \w~\r> \w%s",acAltMenuTag,acSecenekDuzelt);
} else {
formatex(acYeniSecenekBaslik,charsmax(acYeniSecenekBaslik),"%s",acSecenekDuzelt);
}
menu_additem(acMenuID,acYeniSecenekBaslik,acBilgi);
}
stock acMenuBitir(acID,acMenuID,acSecenek = 1,acCikis = 1,acSayfa = 0){
menu_setprop(acMenuID,MPROP_EXITNAME,"\rCikis");
menu_setprop(acMenuID,MPROP_PERPAGE, acSecenek ? 7:0 );
menu_setprop(acMenuID,MPROP_EXIT,acCikis ? MEXIT_ALL:MEXIT_NEVER);
menu_display(acID,acMenuID,acSayfa);
}
#if AMXX_VERSION_NUM < 183
stock renkli_yazi(const id, const input[], any:...){
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^x01"); // Default Renk(Sarı)
replace_all(msg, 190, "!n", "^x04"); // Yeşil Renk
replace_all(msg, 190, "!t", "^x03"); // Takım Renk( CT mavi , T kırmızı )
if (id) players[0] = id; else get_players(players, count, "ch");{
for (new i = 0; i < count; i++){
if (is_user_connected(players[i])){
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]),write_string(msg),message_end();
}
}
}
}
#else
stock renkli_yazi(const id, const input[], any:...){
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "!g", "^x01");
replace_all(msg, 190, "!n", "^x04");
replace_all(msg, 190, "!t", "^x03");
client_print_color(id, id, msg);
}
#endif