Page 1 of 1

Cerere plugin /shop

Posted: 12 Jul 2012, 15:16
by Soke
Salut vreau si eu un plugin shop pentru deathrun sa aiba asa :
1.Deagle [cost 10000$]
2.Viata [cost 2000$]
3.Grenada HE,SMOKE [cost 4500$]
4.Viteza [cost 5000$]


La viteza vreau sa fie viteza mare ff mare nu extrema dar sa fie mare
Cand scri /shop

Re: Cerere plugin /shop

Posted: 13 Jul 2012, 23:30
by Soke
UP .....

Re: Cerere plugin /shop

Posted: 14 Jul 2012, 00:31
by tre3fla
pentru ce echipe il vrei? T/CT

Re: Cerere plugin /shop

Posted: 14 Jul 2012, 00:32
by CamPagNe
Vezi daca merge, sunt incepator deci fara critici :D

SMA | Afiseaza codul
#include <amxmodx>
#include <fun>
#include <amxmisc>
#include <cstrike>
			
public plugin_init(){

    register_plugin("Shop Menu", "1.0", "Power.")
    
    register_menucmd(register_menuid("SHOP MENU"), 1023, "setoption") 
    
    register_clcmd("say /shop","shop_menu")
}

public shop_menu(id) 
{
	if(cs_get_user_team(id) == CS_TEAM_T)
        {
             client_print(id, print_chat,"[SHOP] doar CT pot folosi comanda de shop !");
             return PLUGIN_HANDLED
        } 
             
	chooseoption(id)
	
	return PLUGIN_HANDLED
       
}

public chooseoption(id)
{
    new menu[192] 
    new keys = MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9     
    format(menu, 191, "\yShop Menu^n^n\r1.\w Deagle \r- \y10000$ ^n\r2.\w Viata \r- \y2000$^n\r3.\w Greanda HE/Smoke \r- \y4500$^n\r4.\w Viteza \r- \y5000$^n^n\r0.\w Exit") 
    show_menu(id, keys, menu)      
    return PLUGIN_CONTINUE
}

public setoption(id, key, menu)
{
    if(key == 0) {
    	
         new money = cs_get_user_money(id);
	 
         new cost = 10000;
         if (money < cost)
         {
            client_print(id, print_chat, "[SHOP] Nu ai destui bani !");
            return PLUGIN_CONTINUE;
         }
       
	 give_item(id, "weapon_deagle ");
	
	 cs_set_user_money(id, money-cost);
	 client_print(id, print_chat, "[SHOP] Ai primit un Deagle !");
         menu_destroy(menu)
         return PLUGIN_HANDLED
         
    }

    if(key == 1) {
       
         new money = cs_get_user_money(id);
	 
         new cost = 2000;
         if (money < cost)
         {
            client_print(id, print_chat, "[SHOP] Nu ai destui bani !");
            return PLUGIN_CONTINUE;
         }
       
	 set_user_health(id, 100)
	
	 cs_set_user_money(id, money-cost);
	 client_print(id, print_chat, "[SHOP] Ai primit 100 HP !");
         menu_destroy(menu)
         return PLUGIN_HANDLED

    }

    if(key == 2) {
         new money = cs_get_user_money(id);
	 
         new cost = 4500;
         if (money < cost)
         {
            client_print(id, print_chat, "[SHOP] Nu ai destui bani !");
            return PLUGIN_CONTINUE;
         }
       
	 give_item(id, "weapon_hegrenade");
	 give_item(id, "weapon_smokegrenade");
	
	 cs_set_user_money(id, money-cost);
	 client_print(id, print_chat, "[SHOP] Ai primit o grenada HE & Smoke !");
         menu_destroy(menu)
         return PLUGIN_HANDLED
    }

    if(key == 3) {
            new money = cs_get_user_money(id);
	 
         new cost = 5000;
         if (money < cost)
         {
            client_print(id, print_chat, "[SHOP] Nu ai destui bani !");
            return PLUGIN_CONTINUE;
         }
       
         set_user_maxspeed(id, 420.0);
	
	 cs_set_user_money(id, money-cost);
	 client_print(id, print_chat, "[SHOP] Viteza ti-a crescut la 420 !");
         menu_destroy(menu)
         return PLUGIN_HANDLED

    }
         
    else {
         return PLUGIN_HANDLED
    }

    return PLUGIN_HANDLED
}