
   #include <amxmod>
   static const VERSION[] = "1.1"
   new bool:slapMod
   public plugin_init(){
       register_plugin("SlapMod","VERSION","SentryIII")
       register_clcmd("say   /voteslapmod","vote_slapmod",0,":  Starts  A
   Vote To Enable/Disable Slapmod")
       register_clcmd("say voteslapmod","vote_slapmod",0,": Starts A Vote
   To Enable/Disable Slapmod")
       register_cvar("amx_slapmod","0")
       register_event("StatusValue","slap_action","b","1=2")
       register_event("CurWeapon","holdwpn","be","1=1")
       register_menucmd(register_menuid("Slapmod?"),(1<<0)|(1<<1),"mvote_
   count")
       set_task(2.0, "display", 0, "", 0, "b")
       return PLUGIN_CONTINUE
   }
   public display(){
       if (get_cvar_num("amx_slapmod") == 1) {
           set_hudmessage(255,255,255, -1.0, -0.75)
           show_hudmessage(0,"Slapmod  Is  Enabled!^nSay  /voteslapmod To
   Disable")
       }
       return PLUGIN_CONTINUE
   }
   public holdwpn(id){
       if (!get_cvar_num("amx_slapmod"))
           return PLUGIN_CONTINUE
       new weaponTypeId = read_data(2)
       if (weaponTypeId == CSW_HEGRENADE
       || weaponTypeId == CSW_SMOKEGRENADE
       || weaponTypeId == CSW_FLASHBANG
       || weaponTypeId == CSW_KNIFE
       || weaponTypeId == CSW_C4) {
       return PLUGIN_CONTINUE
       }
       else {
           set_hudmessage(255,255,255, -1.0, -0.75, 0, 2.0, 0.1, 0.5)
           show_hudmessage(id,"No Guns Allowed!")
           engclient_cmd(id,"weapon_knife")
       }
       return PLUGIN_CONTINUE
   }
   public slap_action(){
       new killer = read_data(1)
       new victim = read_data(2)
       new Killer[33]
       new Victim[33]
       new vName[33]
       new kName[33]
       new vOrigin[3]
       new kOrigin[3]
       get_user_name(killer,kName,32)
       get_user_name(victim,vName,32)
       get_user_name(killer, Killer,32)
       get_user_name(victim, Victim,32)
       get_user_origin(killer, kOrigin, 2)
       get_user_origin(victim, vOrigin, 2)
       new distance = get_distance(kOrigin,vOrigin)
       new distanceFeet  = distance / 12
       if  ((get_cvar_num("amx_slapmod")  == 1) && (get_user_team(killer)
   != get_user_team(victim)) && (killer != victim)){
           set_hudmessage(255,255,255, -1.0, -0.75)
           show_hudmessage(0,"*SLAP* Damage: %d",(500 / (distanceFeet)))
           user_slap(victim,(500 / (distanceFeet)))
       }
       return PLUGIN_CONTINUE
   }
   public client_putinserver(id){
       if (get_cvar_num("amx_slapmod") == 1) {
           new param[1]
           param[0] = id
           set_task(10.0,"welcome",0,param,1)
       }
       return PLUGIN_CONTINUE
   }
   public welcome(param[]){
       if (get_cvar_num("amx_slapmod") == 1) {
           set_hudmessage(255,255,255, -1.0, -0.75)
           show_hudmessage(param[0],"Welcome!  Slapmod  is enabled!^nLook
   At Your Enemys To Slap Them To Their Doom")
       }
       return PLUGIN_CONTINUE
   }
   new moptions[2]
   new voteslapmod[] = "\yAMX Toggle Slapmod\w^n^n1. Enable^n2. Disable"
   public vote_slapmod(id){
       new Float:voting = get_cvar_float("amx_last_voting")
       if (voting > get_gametime()) {
           client_print(id,print_chat,"* There is already one voting...")
           return PLUGIN_HANDLED
       }
       if   (voting   &&   voting  +  get_cvar_float("amx_vote_delay")  >
   get_gametime()) {
           client_print(id,print_chat,"*   Voting  not  allowed  at  this
   time...")
           return PLUGIN_HANDLED
       }
       new menu_msg[256]
       format(menu_msg,255,voteslapmod,slapMod ? "Disable" : "Enable")
       new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
       set_cvar_float("amx_last_voting",  get_gametime() + vote_time )
       show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(vote_time))
       set_task(vote_time,"check_mvotes")
       client_print(0,print_chat,"* Voting has started...")
       moptions[0]=moptions[1]=0
       return PLUGIN_CONTINUE
   }
   public mvote_count(key){
       ++moptions[key]
       return PLUGIN_HANDLED
   }
   public check_mvotes(){
       set_hudmessage(255,255,255, -1.0, -0.75)
       if (moptions[0] > moptions[1]){
           if (get_cvar_num("amx_slapmod") == 1){
               server_cmd("amx_slapmod 0")
               show_hudmessage(0,  "Slapmod by SentryIII^nHas Been Turned
   OFF^nVersion: %s",VERSION)
           }
           else if (get_cvar_num("amx_slapmod") == 0){
               server_cmd("amx_slapmod 1")
               show_hudmessage(0,  "Slapmod by SentryIII^nHas Been Turned
   ON^nVersion: %s",VERSION)
           }
       }
       else{
           if (get_cvar_num("amx_slapmod") == 0){
               server_cmd("amx_slapmod 1")
               show_hudmessage(0,  "Slapmod by SentryIII^nHas Been Turned
   ON^nVersion: %s",VERSION)
           }
           else if (get_cvar_num("amx_slapmod") == 1){
               server_cmd("amx_slapmod 0")
               show_hudmessage(0,  "Slapmod by SentryIII^nHas Been Turned
   OFF^nVersion: %s",VERSION)
           }
       }
       return PLUGIN_CONTINUE
   }
