Kód: #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #include <fakemeta>
#define PLUGIN "Surf_ski_2 Shop" #define VERSION "1.0" #define AUTHOR "JoX !"
static const Mario_Room[][ 3 ] = { { 3610, 1053, -2317 }, { 3612, 629, -2317 }, { 3403, 1079, -2273 }, { 3081, 1091, -2317 }, { 3391, 641, -2317 }, { 3056, 578, -2317 }, { 3116, 285, -2275 }, { 3343, 245, -2317 } }; static const Gun_Room[][ 3 ] = { { -689, -949, -138 }, { -590, -958, -138 }, { -485, -947, -138 }, { -396, -961, -138 }, { -324, -960, -138 }, { -688, -840, -138 }, { -594, -844, -138 }, { -486, -866, -138 }, { -398, -852, -138 }, { -331, -845, -138 }, { -383, -697, -138 }, { -317, -683, -138 } };
new Hecost new Hpcost new Benelli1cost new Benelli2cost new GunRoomcost new MarioRoomcost
public plugin_init() { register_plugin( "Surf_ski_2 Shop", "v1.0", "JoX !" ) register_concmd("say /shop","SurfShop") register_concmd("say_team /shop","SurfShop") Hecost = register_cvar( "surf_he_cost", "1000" ); Hpcost = register_cvar( "surf_hp_cost", "5000" ); Benelli1cost = register_cvar( "surf_benelli1_cost", "7000" ); Benelli2cost = register_cvar( "surf_benelli2_cost", "7000" ); GunRoomcost = register_cvar( "surf_gunroom_cost", "10000" ); MarioRoomcost = register_cvar( "surf_marioroom_cost", "12000" ); } public SurfShop(id) { if(is_user_alive(id)) { new menu= menu_create("Surf_ski_2 Shop Menu","menu_handler") menu_additem(menu, "Robbanó Gránát - \y%d$^n", "1", get_pcvar_num( Hecost ) ); menu_additem(menu, "Élet (50 HP) - \y%d$^n", "2", get_pcvar_num(Hpcost)); menu_additem(menu, "XM1014 (Auto Soti) - \y%d$^n", "3", get_pcvar_num(Benelli1cost)); menu_additem(menu, "M3 (Pumpas Soti) - \y%d$^n", "4", get_pcvar_num(Benelli2cost)); menu_additem(menu, "Márió Teleport - \y%d$^n", "5", get_pcvar_num(MarioRoomcost)); menu_additem(menu, "Gun Room Teleport - \y%d$^n", "6", get_pcvar_num(GunRoomcost))
menu_display(id,menu) } } public menu_handler(id,menu,item) { if(item==MENU_EXIT) { menu_destroy(menu) // Closing Menu return PLUGIN_CONTINUE } new cena switch(item) { case 0: { cena = get_pcvar_num(Hecost); if(cs_get_user_money(id)<cena) { client_print(id,print_chat,"Nincs elég pénzed"); } else { give_item(id, "weapon_hegrenade") cs_set_user_money(id, cs_get_user_money(id) - cena) client_print(id, print_chat,"Vettél egy HE gránátot !") } } case 1: { cena = get_pcvar_num(Hpcost); if(cs_get_user_money(id)<cena) { client_print(id,print_chat,"Nincs elég pénzed") } else { new hp = get_user_health(id) set_user_health(id,hp+50); cs_set_user_money(id, cs_get_user_money(id) - cena) client_print(id, print_chat,"Vettel 50 HP-t !") } } case 2: { cena = get_pcvar_num(Benelli1cost); if(cs_get_user_money(id)<cena) { client_print(id,print_chat,"Nincs elég pénzed") } else { give_item(id, "weapon_m3") cs_set_user_money(id, cs_get_user_money(id) - cena) client_print(id, print_chat,"Vettél egy M3-at !") } } case 3: { cena = get_pcvar_num(Benelli2cost); if(cs_get_user_money(id)<cena) { client_print(id,print_chat,"Nincs elég pénzed") } else { give_item(id, "weapon_xm1014") cs_set_user_money(id, cs_get_user_money(id) - cena) client_print(id, print_chat,"Vettél egy Auto Sotit !") } } case 4: { cena = get_pcvar_num(MarioRoomcost); if(cs_get_user_money(id)<cena) { client_print(id,print_chat,"Nincs elég pénzed") } else { set_user_origin(id, Gun_Room[random_num(0,charsmax(Gun_Room))]); client_print(id, print_chat,"Teleportálva lettél a GR-be !") cs_set_user_money(id, cs_get_user_money(id) - cena) } } case 5: { cena = get_pcvar_num(GunRoomcost); if(cs_get_user_money(id)<cena) { client_print(id,print_chat,"Nincs elég pénzed") } else { set_user_origin(id, Mario_Room[ random_num( 0, charsmax( Mario_Room ) ) ] ); client_print(id, print_chat,"Teleportálva lettél Marióba !") cs_set_user_money(id, cs_get_user_money(id) - cena) } } } return PLUGIN_CONTINUE }
|