Otsi Vahvlist
Kuvatakse tulemused sildile ''poemenüü''.
Leitud 1 tulemus
-
Tervist, nagu pealkiri ütleb siis vajan abi poemenüü muudatusega. Oleks vaja juurde panna 2 asja. HE 2x FLASH Kood siin /* Plugin generated by AMXX-Studio Plugin requested: https://forums.alliedmods.net/showthread.php?t=161731 */ #include #include #include #include #define PLUGIN "Shop Menu" #define VERSION "1.0" #define AUTHOR "Aykay" new pCrowbarPrice, pUspPrice, pSpeedPrice, pGravityPrice new bool:BoughtSpeed[32] new bool:BoughtGravity[32] public plugin_init() { register_plugin( PLUGIN, VERSION, AUTHOR ) register_clcmd( "say /shop", "Shop" ) register_clcmd( "say shop", "Shop" ) register_event("HLTV", "event_new_round", "a", "1=0", "2=0") pCrowbarPrice = register_cvar( "amx_crowbarprice", "16000" ) pUspPrice = register_cvar( "amx_uspprice", "14500" ) pSpeedPrice = register_cvar( "amx_speedprice", "7500" ) pGravityPrice = register_cvar( "amx_gravityprice", "6000" ) } public Shop(id) { new menu = menu_create("Choose an Option:", "Menu_Handle"); new msg[50]; format(msg, 49, "Mac10 [$%i]", get_pcvar_num(pCrowbarPrice) ); menu_additem(menu, msg, "0", 0); new msg1[50]; format(msg1, 49, "Five-seven [$%i]", get_pcvar_num(pUspPrice) ); menu_additem(menu, msg1, "1", 0); new msg2[50]; format(msg2, 49, "120 Kiirus [$%i]", get_pcvar_num(pSpeedPrice) ); menu_additem(menu, msg2, "2", 0); new msg3[50]; format(msg3, 49, "300 Gravity [$%i]", get_pcvar_num(pGravityPrice) ); menu_additem(menu, msg3, "3", 0); menu_display(id, menu, 0); return PLUGIN_HANDLED; } public Menu_Handle( id, menu, item ) { new money = cs_get_user_money(id) if( item == MENU_EXIT ) { menu_destroy( menu ); return PLUGIN_CONTINUE; } menu_display( id, menu, 0 ); switch( item ) { case 0: { if( money >= get_pcvar_num( pCrowbarPrice ) ) { give_item( id, "weapon_mac10" ); //I'm guessing this is the crowbar? cs_set_user_money( id, money - get_pcvar_num( pCrowbarPrice ) ) client_print(id, print_chat, "Ostsid mac10!") } else client_print(id, print_chat, "Sul pole piisavalt raha!") menu_destroy( menu ); return PLUGIN_HANDLED; } case 1: { if( money >= get_pcvar_num( pUspPrice ) ) { give_item( id, "weapon_fiveseven" ); cs_set_user_money( id, money - get_pcvar_num( pUspPrice ) ) client_print(id, print_chat, "Ostsid Five-seven k2sirelva!") } else client_print(id, print_chat, "Sul pole piisavalt raha!") menu_destroy( menu ); return PLUGIN_HANDLED; } case 2: { if( money >= get_pcvar_num( pSpeedPrice ) ) { new Float:speed = (get_user_maxspeed(id) + 120.0); set_user_maxspeed(id , speed); cs_set_user_money( id, money - get_pcvar_num( pSpeedPrice ) ) BoughtSpeed[id] = true client_print(id, print_chat, "Ostsid kiiruse!") } else client_print(id, print_chat, "Sul ei ole piisavalt raha, v6i oled selle juba ostnud") menu_destroy( menu ); return PLUGIN_HANDLED; } case 3: { if( money >= get_pcvar_num( pGravityPrice ) && BoughtGravity[id] == false ) { set_user_gravity(id, 0.375) cs_set_user_money( id, money - get_pcvar_num( pGravityPrice ) ) BoughtGravity[id] = true client_print(id, print_chat, "Ostsid gravity!") } else client_print(id, print_chat, "Sul ei ole piisavalt raha, v6i oled selle juba ostnud") menu_destroy( menu ); return PLUGIN_HANDLED; } } menu_destroy(menu); return PLUGIN_HANDLED; } public client_disconnect(id) { BoughtGravity[id] = false BoughtSpeed[id] = false } public event_new_round(id) { BoughtGravity[id] = false BoughtSpeed[id] = false } Tänud ette.