Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <cstrike>
- #include <colorchat>
- #include <fun>
- #define PLUGIN "Plugin"
- #define VERSION "v1.0"
- #define AUTHOR "GaMeR FoReVeR"
- new const ShopItems[][] =
- {
- "Respawn\y 15000$\d - Opet ces da ozivis",
- "+15hp \y14500$ \d- Dodaje ti 15hp",
- "+500 EXP \y16000$ \d- Dodaje ti 500 Experience"
- };
- new const cmdShop[][][] =
- {
- // Komanda Funkcija
- {"say /shop", "ShopMenu"},
- {"say_team /shop", "ShopMenu"}
- };
- new gMenu;
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR);
- for(new i; i < sizeof cmdShop; i++)
- register_clcmd(cmdShop[i][0], cmdShop[i][1]);
- }
- public ShopMenu(id)
- {
- if(!is_user_connected(id) || is_user_bot(id))
- return PLUGIN_HANDLED;
- new title[64];
- formatex(title, charsmax(title), "Knife Shop \d%s", VERSION);
- gMenu = menu_create(title, "ShopMenuH");
- for(new i = 1; i < sizeof ShopItems; i++)
- menu_additem(gMenu, ShopItems[i][0]);
- menu_display(id, gMenu);
- return PLUGIN_CONTINUE;
- }
- public ShopMenuH(id, menu, item)
- {
- if(!is_user_connected(id) || is_user_bot(id))
- return PLUGIN_HANDLED;
- if(item == MENU_EXIT)
- {
- menu_destroy(gMenu);
- return PLUGIN_HANDLED;
- }
- new lPrice;
- new user_money = cs_get_user_money(id);
- switch(item)
- {
- case 0:
- {
- lPrice = 15000;
- if(is_user_alive(id))
- ColorChat(id, NORMAL, "^4[Knife Shop]^1 Moras biti mrtav !");
- else if(user_money < lPrice)
- ColorChat(id, NORMAL, "^4[Knife Shop]^1 Nemas dovoljno novca.");
- else
- {
- ColorChat(id, NORMAL, "^4[Knife Shop]^1 Kupio si^4 Respawn.");
- cs_set_user_money(id, user_money-lPrice);
- cs_user_spawn(id);
- }
- }
- case 1:
- {
- lPrice = 15000;
- if(!is_user_alive(id))
- ColorChat(id, NORMAL, "^4[Knife Shop]^1 Moras biti ziv !");
- else if(user_money < lPrice)
- ColorChat(id, NORMAL, "^4[Knife Shop]^1 Nemas dovoljno novca.");
- else
- {
- ColorChat(id, NORMAL, "^4[Knife Shop]^1 Kupio si^4 +15 HP.");
- cs_set_user_money(id, user_money-lPrice);
- set_user_health(id, get_user_health(id)+15);
- }
- }
- case 2:
- {
- lPrice = 15000;
- if(!is_user_alive(id))
- ColorChat(id, NORMAL, "^4[Knife Shop]^1 Moras biti ziv !");
- else if(user_money < lPrice)
- ColorChat(id, NORMAL, "^4[Knife Shop]^1 Nemas dovoljno novca.");
- else
- {
- ColorChat(id, NORMAL, "^4[Knife Shop]^1 Kupio si^4 +500 EXP.");
- cs_set_user_money(id, user_money-lPrice);
- // OVDE NAPISI KAKO SE DOBIJA XP
- }
- }
- }
- return PLUGIN_CONTINUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement