
   /*********************************************************************
   AMX Mod Script
   Created by Zaltoa
   Smoke Knivez
   Version 1.0
   Email = Darkelite1776@yahoo.com
   Aim = WhorableExistens
   Commands -
   amx_smokeknivez <1|0> Default off
   1 = on
   0 = off
   Client Command -
   say /votesmokeknivez
   Starts a vote to turn smoke knivez on and off...
   Description - You are given a smoke grenade every 20 seconds and you
   can only use your knife...
   *********************************************************************/
   #include <amxmod>
   #include <amxmisc>
   new knifesmoke = 0
   new choice[2]
   new votesmoke[] = "\ySmoke Knivez?\w^n^n1. On^n2. Off"
   public plugin_init(){
   register_plugin("Smoke Knivez","1.0","Zaltoa")
   register_concmd("amx_smokeknivez","cmdsmokeknife",0,"-   disable   and
   enable smoke knife war 1 = on 0 = off")
   register_clcmd("say  /votesmokeknivez","cmdvote",0,"-  start a vote to
   turn smoke knviez on or off")
   register_menucmd(register_menuid("\ySmoke
   Knivez?"),(1<<0)|(1<<1),"count_votes")
   register_event("CurWeapon","knife","b")
   new parm[1]
   set_task(20.0,"givenade",0,parm,1,"b")
   }
   public cmdsmokeknife(id){
      new arg[2]
      read_argv(1,arg,1)
      set_hudmessage(200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2)
      if(equal(arg,"1")){
      give_item(0,"weapon_smokegrenade")
      knifesmoke = 1
      client_cmd(id,"weapon_knife")
      console_print(id,"Smoke Knivez has been turned on.")
      show_hudmessage(0,"Smoke Knivez has been turned on.")
      } else if(equal(arg,"0")){
      knifesmoke = 0
      console_print(id,"Smoke Knivez War has been turned off.")
      show_hudmessage(0,"Smoke Knivez War been turned off.")
      } else {
      if (knifesmoke==0){
      console_print(id,"Usage:  amx_smokeknivez 1 = 0n 0 = off Currently:
   OFF")
      }
      if (knifesmoke==1){
      console_print(id,"Usage:  amx_smokeknivez 1 = 0n 0 = off Currently:
   ON")
      }
      }
      return PLUGIN_CONTINUE
      }
   public knife(id){
           if(knifesmoke==0){
               //nothing
           }
           if(knifesmoke==1){
               new clip, ammo
               new usersweapon = get_user_weapon(id,clip,ammo)
               if(usersweapon==CSW_SMOKEGRENADE){
                   //do nothing
               } else if(usersweapon==CSW_KNIFE) {
                   //nothing
               } else {
                   client_cmd(id,"weapon_knife")
               }
           }
           return PLUGIN_CONTINUE
   }
   public givenade(parm[]){
           if(knifesmoke==0){
               //nothing
           }
           if(knifesmoke==1){
               new players[32], inum
               get_players(players,inum)
               for(new a=0;a<inum;++a) {
                   give_item(players[a],"weapon_smokegrenade")
               }
           }
           return PLUGIN_CONTINUE
   }
   public cmdvote(id){
       new Float:voting = get_cvar_float("amx_last_voting")
       if (voting > get_gametime()){
           client_print(id,print_chat,"*A vote has already been cast.*")
           return PLUGIN_HANDLED
       }
       if   (voting   &&   voting  +  get_cvar_float("amx_vote_delay")  >
   get_gametime()) {
           client_print(id,print_chat,"*Please wait awhile before you can
   vote again.*")
           return PLUGIN_HANDLED
       }
       new menu_msg[256]
       format(menu_msg,255,votesmoke)
       new Float:votetime = get_cvar_float("amx_vote_time") + 10.0
       set_cvar_float("amx_last_voting",  get_gametime() + votetime )
       show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(votetime))
       set_task(votetime,"check_the_votes")
       client_print(0,print_chat,"*Voting has started.*")
       choice[0]=choice[1]=0
       return PLUGIN_HANDLED
   }
   public count_votes(id,key){
       if (get_cvar_float("amx_vote_answers") ) {
           new name[32]
           get_user_name(id,name,31)
           client_print(0,print_chat,"*   %s   voted  %s",  name,  key  ?
   "against Smoke Knivez" : "for Smoke Knivez" )
       }
       ++choice[key]
       return PLUGIN_HANDLED
   }
   public check_the_votes(id){
       if (choice[0] > choice[1]){
           server_cmd("amx_smokeknivez 1")
           client_print(0,print_chat,"*  Votes  For Smoke Knivez Succeded
   (yes ^"%d^") (no ^"%d^"). *",choice[0],choice[1])
       } else {
           server_cmd("amx_smokeknivez 0")
           client_print(0,print_chat,"*  Votes  For  Against Smoke Knivez
   Succeded (yes ^"%d^") (no ^"%d^"). *",choice[0],choice[1])
       }
       return PLUGIN_CONTINUE
   }
