View Single Post
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 09-04-2016 , 12:43   Re: [request] After 1 rounds
Reply With Quote #4

Code:
#include <amxmodx> #include <fun> new purchasedFlashiCount[33]; new bool:purchasedFlash[33]; public plugin_init() {     register_logevent( "logevent_RoundStart", 2, "1=Round_Start" );         register_clcmd("say /flash", "ShowMenu"); } public logevent_RoundStart() {         new iPlayers[32], iCount         get_players(iPlayers, iCount, "ch")     if( !iCount ) return         new id     for(--iCount; iCount>=0; iCount--)     {         id = iPlayers[iCount]                 if(purchasedFlash[id]) purchasedFlashiCount[id]++;             } } public ShowMenu(id) {     if(is_user_alive(id)){                 if(purchasedFlashiCount[id] == 0){                         new menu = menu_create("Grenade_Menu", "mh_MyMenu");             menu_additem(menu, "flashbang", "", 0); // case 0             menu_display(id, menu, 0);                     }         else{                         client_print(id, 3, "You need to wait for 1 more round to use Grenade_Menu.")                     }     }     else{                 client_print(id, 3, "You need to be alive to use Grenade_Menu.")             }     return PLUGIN_HANDLED;     } public mh_MyMenu(id, menu, item) {     switch(item)     {         case 0:           {             give_item(id, "weapon_flashbang");             client_print(id, print_chat, "You have purchased flashbang");                         purchasedFlash[id] = true;             purchasedFlashiCount[id]--;         }     }     menu_destroy(menu);     return PLUGIN_HANDLED; }

Last edited by Freezo Begin; 09-05-2016 at 06:41.
Freezo Begin is offline