
   /*********************************************************************
   ******
   *   amx_ejl_flamethrower.sma     version  5.3.1                  Date:
   5/4/2003
   *  Author: Eric Lidman      ejlmozart@hotmail.com
   *  Alias: Ludwig van        Upgrade:
   http://lidmanmusic.com/cs/plugins.html
   *
   *  Add  a  flamethrower  weapon  to any Half-Life mod. Clients need to
   bind a
   *   key  to  amx_fire_flamethrower  and then use that key to use their
   flame-
   *   thrower.  The  flamethower is a deadly weapon and give frag credit
   to the
   *   player  who  burned another player with a flamethrower burst. Lots
   of
   *   cool  FX fire etc. It is sensitive to the mp_friendlyfire cvar and
   will
   *   thus kill teamates if friendlyfire is on and not if its off.
   *
   *  PODBOT:  If  using  my  podbots controller, podbots use this plugin
   too.
   *
   *  CLIENT COMMANDS:
   *
   *   amx_fire_flamethrower            --should be bound to a key, fires
   *                                      flamethrower  if enabled and if
   there
   *                                      are  sufficient  funds from the
   client
   *                                      in   either   armor   or  money
   depending
   *                                      on the buytype cvar
   *   say  /flamethrower                --gives cleints info on setup of
   the
   *                                      flamethrower in an motd window
   *   say   vote_flamethrower            --starts   a   vote   to   have
   flamethrowers
   *                                      enabled or disabled
   *
   *  ADMIN COMMANDS:
   *
   *   amx_flamethrowers                --toggles  flamethrowers  enabled
   or not
   *   amx_flamethrowers_buytype        --toggles   flamethrowers  to  be
   bought
   *                                      with money or armor points
   *   amx_flamethrowers_cost <ammount> --sets the cost of a flamethrower
   *   amx_flamethrowers_vote           --toggles   on/off   ability  for
   players
   *                                      to start votes, default setting
   is on
   *   amx_flamethrowers_vote_default   --sets  current flamethrowersvote
   status
   *                                      as        server        default
   auto-refreshed at
   *                                      every  map  change.  ADMIN_RCON
   level
   *                                      admin  required  to  set server
   default
   *   stopvote                         --stops vote in progress
   *
   *  CVARS: can be set in admin.cfg, see corresponding commands for info
   *
   *   amx_luds_flamethrower 1          -- 0= disable  1= enable
   *   amx_flamethrower_buytype 0       -- 0= armor    1= money
   *   amx_flamethrower_cost  30         --  amount  of  money  or  armor
   depending
   *                                       on buytype for each flameburst
   *   amx_flvote_delay  180.0           --  Default 180.0 seconds. Delay
   between
   *                                       flamethrower   votes   allowed
   started
   *                                       by a non admin
   *   amx_flamethrower_free  0          --  for  mods other than cstrike
   which do
   *                                       not  have  money  and armor to
   use as
   *                                       payment  for flamethrower. Set
   the
   *                                       number  of flamethrower blasts
   given
   *                                       to  each  player  at spawn. If
   this is
   *                                       set  to  1  or higher in CS it
   will
   *                                       override the buying system.
   *   amx_flamethrower_obeyffcvar  1    --  if  mp_friendlyfire is 1 and
   this
   *                                       cvar  is set to 0, this plugin
   will
   *                                       act as if friendlyfire is off
   *                                       ... even if its on.
   *   amx_flamethrower_tkpunish1   1     --  for  friendlyfire  on,  the
   option to
   *                                       punish  team  killer. Quota is
   from
   *                                       amx_flamethrower_tkpunsish2
   cvar
   *                                       options:  a  mix of kill,kick,
   and ban
   *                                        0 = no action on team killer
   *                                        1 = kick tker on tk quota
   *                                        2 = 3 hour ban tker on quota
   *                                        3 = always kill tker, kick on
   quota
   *                                        4  = always kill tker, ban on
   quota
   *   amx_flamethrower_tkpunish2  3     -- for friendlyfire on, quantity
   of
   *                                       teammates  a  player  can kill
   before a
   *                                       kick   or   ban   can   result
   depending on
   *                                       how amx_flamethrower_tkpunish1
   cvar
   *                                       is set
   *   amx_flamethrower_botsnolimit 1   -- since bots are stupid, wasting
   their
   *                                       flamebursts,  we  give  them a
   handicap
   *                                       with  this  cvar  set  to 1 so
   that bots
   *                                       get  an unlimited flamethrower
   use
   *
   *  Additional info:
   *
   *   Flamethrower  kills  and  damage are sent to the sever logs in the
   same
   *   format   as   normal   kills   and  damage.  A  log  parser  (like
   pysychostats)
   *   should  be  able to take the log output of this plugin and include
   them
   *   in   the   stats  output.  Flamethrower  kills  count  on  the  CS
   scoreboard,
   *   but  are  only  refeshed  at the end of each round. This is for CS
   only by
   *   the way.
   *
   *   If you have the module from SpaceDude's warcraft3 plugin (war3_ms)
   you
   *   can  make  the deahtmessages look more real, so flamethrower kills
   look
   *   like  an actual player killing another player instead of a suicide
   on the
   *   part  of the killed player. To enable this, you need to change the
   code
   *   below.  Simply change the value to 1 where it has #define use_war3
   0
   *   Its  simple, a one line change, thats it, compile and its ready to
   go.
   *
   **********************************************************************
   *****/
   /*  To get the better deathmessages. Change this one  */
   /*  line so it looks like:    #define use_war3 1      */
   #define use_war3 0
   /*********************************************************************
   ***************
   *
                *
   *  *end*  customizable section of code. other changes can be done with
   the cvars    *
   *
                *
   **********************************************************************
   **************/
   #include <amxmod>
   #include <amxmisc>
   #if use_war3 == 1
   #include <war3>
   new gmsgDeathMsg
   new redundant_plug
   #endif
   new smoke
   new fire
   new burning
   new isburning[33]
   new bool:cstrike_running
   new bool:dod_running
   new dlog = 0
   new vault_value[128]
   new votenumber = 0
   new votecontroller[33][2]
   new option[4]
   new Float:vote_ratio
   new st_vote = 0
   new totalvoters = 0
   new bool:bVoteToStop = false
   new bool:flvote_deny = false
   new bool:bFLvote = true
   new restrict_override
   new flame_count[33]
   new tkcount[33]
   new dod_team[33]
   public amx_fl(id,level,cid){
       if (!cmd_access(id,level,cid,1))
           return PLUGIN_HANDLED
       new command[60]
       new variable[6]
       new name[32]
       get_user_name(id,name,31)
       read_argv(0,command,59)
       read_argv(1,variable,5)
       if(get_cvar_num("amx_luds_flamethrower") == 1){
           set_cvar_string("amx_luds_flamethrower","0")
           console_print(id,"[AMX] %s has been turned OFF",command)
           switch(get_cvar_num("amx_show_activity"))    {
               case  2:    client_print(0,print_chat,"ADMIN  %s: Executed
   %s OFF",name,command)
               case  1:    client_print(0,print_chat,"ADMIN:  Executed %s
   OFF",command)
           }
       }else{
           set_cvar_string("amx_luds_flamethrower","1")
           console_print(id,"[AMX] %s has been turned ON.",command)
           switch(get_cvar_num("amx_show_activity"))    {
               case  2:    client_print(0,print_chat,"ADMIN  %s: Executed
   %s ON",name,command)
               case  1:    client_print(0,print_chat,"ADMIN:  Executed %s
   ON",command)
           }
       }
       new authid[16]
       get_user_authid(id,authid,16)
       get_user_name(id,name,32)
       log_to_file("addons/amx/admin.log","^"%s<%d><%s><>^"
   flamethrowers", name,get_user_userid(id),authid)
       return PLUGIN_HANDLED
   }
   public amx_fl_b(id,level,cid){
       if (!cmd_access(id,level,cid,1))
           return PLUGIN_HANDLED
       if(!cstrike_running){
           console_print(id,"[AMX]  cstrike only. Other mods use the CVAR
   amx_flamethrower_free to set number of flame bursts")
           return PLUGIN_HANDLED
       }
       if(get_cvar_num("amx_flamethrower_free")){
           console_print(id,"[AMX] amx_flamethrower_free cvar needs to be
   0 to use this command")
           return PLUGIN_HANDLED
       }
       new variable[6]
       new name[32]
       get_user_name(id,name,31)
       read_argv(1,variable,5)
       if(get_cvar_num("amx_flamethrower_buytype") == 1){
           set_cvar_string("amx_flamethrower_buytype","0")
           console_print(id,"[AMX]  Flamethrower  has  been  set  to  use
   ARMOR")
           switch(get_cvar_num("amx_show_activity"))    {
               case    2:    client_print(0,print_chat,"ADMIN   %s:   Set
   flamethrower to use ARMOR for fuel",name)
               case      1:    client_print(0,print_chat,"ADMIN:      Set
   flamethrower to use ARMOR for fuel")
           }
       }else{
           set_cvar_string("amx_flamethrower_buytype","1")
           console_print(id,"[AMX]  Flamethrower  has  been  set  to  use
   MONEY")
           switch(get_cvar_num("amx_show_activity"))    {
               case    2:    client_print(0,print_chat,"ADMIN   %s:   Set
   flamethrower to use MONEY",name)
               case      1:    client_print(0,print_chat,"ADMIN:      Set
   flamethrower to use MONEY")
           }
       }
       new authid[16]
       get_user_authid(id,authid,16)
       get_user_name(id,name,32)
       log_to_file("addons/amx/admin.log","^"%s<%d><%s><>^"
   flamethrowers_buytype", name,get_user_userid(id),authid)
       return PLUGIN_HANDLED
   }
   public amx_fl_c(id,level,cid){
       if (!cmd_access(id,level,cid,1))
           return PLUGIN_HANDLED
       if(!cstrike_running){
           console_print(id,"[AMX]  cstrike only. Other mods use the CVAR
   amx_flamethrower_free to set number of flame bursts")
           return PLUGIN_HANDLED
       }
       if(get_cvar_num("amx_flamethrower_free")){
           console_print(id,"[AMX] amx_flamethrower_free cvar needs to be
   0 to use this command")
           return PLUGIN_HANDLED
       }
       new command[60]
       new variable[6]
       new name[32]
       get_user_name(id,name,31)
       read_argv(0,command,59)
       read_argv(1,variable,5)
       set_cvar_string("amx_flamethrower_cost",variable)
       console_print(id,"[AMX] %s has been set to %s",command,variable)
       switch(get_cvar_num("amx_show_activity"))    {
           case   2:  client_print(0,print_chat,"ADMIN  %s:  Executed  %s
   %s",name,command,variable)
           case    1:   client_print(0,print_chat,"ADMIN:   Executed   %s
   %s",command,variable)
       }
       new authid[16]
       get_user_authid(id,authid,16)
       get_user_name(id,name,32)
       log_to_file("addons/amx/admin.log","^"%s<%d><%s><>^"
   flamethrowers_cost %s", name,get_user_userid(id),authid,variable)
       return PLUGIN_HANDLED
   }
   public amx_flvote(id,level,cid){
       if (!cmd_access(id,level,cid,1))
           return PLUGIN_HANDLED
       if(bFLvote == false) {
           bFLvote = true
           client_print(0,print_chat,"[AMX]  Admin has allowed players to
   initiate vote_flamethrower")
           console_print(id,"[AMX]  You  have allowed players to initiate
   vote_flamethrower")
       }else {
           bFLvote = false
           client_print(0,print_chat,"[AMX]  Admin  has forbidden players
   to initiate vote_flamethrower")
           console_print(id,"[AMX]  You   have   forbidden   players   to
   initiate vote_flamethrower")
       }
       new authid[16],name[32]
       get_user_authid(id,authid,16)
       get_user_name(id,name,32)
       log_to_file("addons/amx/admin.log","^"%s<%d><%s><>^"
   flamethrowervote_mode",name,get_user_userid(id),authid)
       return PLUGIN_HANDLED
   }
   public amx_flvote_d(id,level,cid){
       if (!cmd_access(id,level,cid,1))
           return PLUGIN_HANDLED
       if(bFLvote == false){
           ejl_vault("WRITE","FLAMETHROWER_VOTE","OFF")
           console_print(id,"[AMX]    Player    initiated    flamethrower
   voting  OFF   is now the default.")
       }else{
           ejl_vault("WRITE","FLAMETHROWER_VOTE","ON")
           console_print(id,"[AMX]    Player    initiated    flamethrower
   voting  ON    is now the default.")
       }
       new authid[16],name[32]
       get_user_authid(id,authid,16)
       get_user_name(id,name,32)
       log_to_file("addons/amx/admin.log","^"%s<%d><%s><>^"
   flamethrowervote_mode_d",name,get_user_userid(id),authid)
       return PLUGIN_HANDLED
   }
   public bot_interface(){
       if(get_cvar_num("amx_luds_flamethrower") == 0)
           return PLUGIN_HANDLED
       new sid[8],id
       read_argv(1,sid,7)
       id = strtonum(sid)
       if(is_user_alive(id) == 0)
           return PLUGIN_HANDLED
       if(get_cvar_num("amx_flamethrower_botsnolimit") == 0){
           new fl_cost = get_cvar_num("amx_flamethrower_cost")
           new freeF = get_cvar_num("amx_flamethrower_free")
           if((!cstrike_running) || (freeF > 0)){
               if(flame_count[id] < 1)
                   return PLUGIN_HANDLED
               flame_count[id] -= 1
           }else{
               if(get_cvar_num("amx_flamethrower_buytype") == 0){
                   new armr = get_user_armor(id)
                   if(armr < fl_cost)
                       return PLUGIN_HANDLED
                   set_user_armor(id,armr - fl_cost)
               }else{
                   new um = get_user_money(id)
                   if(um < fl_cost)
                       return PLUGIN_HANDLED
                   else
                       set_user_money(id,um - fl_cost)
               }
           }
       }
       fire_flamethrower(id)
       return PLUGIN_HANDLED
   }
   public amx_fflame(id){
       if(get_cvar_num("amx_luds_flamethrower") == 0){
           client_print(id,print_chat,"[AMX]  Flamethrower             is
   disabled")
           return PLUGIN_HANDLED
       }
       if(is_user_alive(id) == 0)
           return PLUGIN_HANDLED
       new fl_cost = get_cvar_num("amx_flamethrower_cost")
       new freeF = get_cvar_num("amx_flamethrower_free")
       if((!cstrike_running) || (freeF > 0)){
           if(flame_count[id] < 1){
               client_print(id,print_chat,"[AMX]  Insufficient  fuel. You
   have used all your flamethrower blasts")
               return PLUGIN_HANDLED
           }
           flame_count[id] -= 1
           set_hudmessage(255,0,0,  -1.0,  0.25, 0, 0.02, 3.0, 1.01, 1.1,
   4)
           new msg[64]
           format(msg,63,"FLAMETHROWER          BURSTS         REMAINING:
   %d",flame_count[id])
           show_hudmessage(id,msg)
       }else{
           if(get_cvar_num("amx_flamethrower_buytype") == 0){
               new armr = get_user_armor(id)
               if(armr < fl_cost){
                   client_print(id,print_chat,"[AMX]  Insufficient  fuel.
   Flamethrower blasts cost %d armor points each",fl_cost)
                   return PLUGIN_HANDLED
               }
               set_user_armor(id,armr - fl_cost)
           }else{
               new um = get_user_money(id)
               if(um < fl_cost){
                   client_print(id,print_chat,"[AMX]  Insufficient funds.
   Flamethrower bursts cost $%d each",fl_cost)
                   return PLUGIN_HANDLED
               }else{
                   client_print(id,print_center,"[AMX]  You        bought
   flamethrower fuel^nfor %d money.",fl_cost)
                   set_user_money(id,um - fl_cost)
               }
           }
       }
       fire_flamethrower(id)
       return PLUGIN_HANDLED
   }
   fire_flamethrower(id){
       emit_sound(id,   CHAN_WEAPON,   "ambience/flameburst1.wav",   1.0,
   ATTN_NORM, 0, PITCH_NORM)
       new vec[3]
       new aimvec[3]
       new velocityvec[3]
       new length
       new speed = 10
       get_user_origin(id,vec)
       get_user_origin(id,aimvec,2)
       new dist = get_distance(vec,aimvec)
       new speed1 = 160
       new speed2 = 350
       new radius = 105
       if(dist < 50){
           radius = 0
           speed = 5
       }
       else if(dist < 150){
           speed1 = speed2 = 1
           speed = 5
           radius = 50
       }
       else if(dist < 200){
           speed1 = speed2 = 1
           speed = 5
           radius = 90
       }
       else if(dist < 250){
           speed1 = speed2 = 90
           speed = 6
           radius = 90
       }
       else if(dist < 300){
           speed1 = speed2 = 140
           speed = 7
       }
       else if(dist < 350){
           speed1 = speed2 = 190
           speed = 7
       }
       else if(dist < 400){
           speed1 = 150
           speed2 = 240
           speed = 8
       }
       else if(dist < 450){
           speed1 = 150
           speed2 = 290
           speed = 8
       }
       else if(dist < 500){
           speed1 = 180
           speed2 = 340
           speed = 9
       }
       velocityvec[0]=aimvec[0]-vec[0]
       velocityvec[1]=aimvec[1]-vec[1]
       velocityvec[2]=aimvec[2]-vec[2]
       length=sqrt(velocityvec[0]*velocityvec[0]+velocityvec[1]*velocityv
   ec[1]+velocityvec[2]*velocityvec[2])
       velocityvec[0]=velocityvec[0]*speed/length
       velocityvec[1]=velocityvec[1]*speed/length
       velocityvec[2]=velocityvec[2]*speed/length
       new args[8]
       args[0] = vec[0]
       args[1] = vec[1]
       args[2] = vec[2]
       args[3] = velocityvec[0]
       args[4] = velocityvec[1]
       args[5] = velocityvec[2]
       set_task(0.1,"te_spray",0,args,8,"a",2)
       check_burnzone(id,vec,aimvec,speed1,speed2,radius)
   }
   public te_spray(args[]){
       //TE_SPRAY
       message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
       write_byte (120) // Throws a shower of sprites or models
       write_coord(args[0]) // start pos
       write_coord(args[1])
       write_coord(args[2])
       write_coord(args[3]) // velocity
       write_coord(args[4])
       write_coord(args[5])
       write_short (fire) // spr
       write_byte (8) // count
       write_byte (70) // speed
       write_byte (100) //(noise)
       write_byte (5) // (rendermode)
       message_end()
       return PLUGIN_CONTINUE
   }
   public sqrt(num) {
       new div = num
       new result = 1
       while (div > result) { // end when div == result, or just below
           div = (div + result) / 2 // take mean value as new divisor
           result = num / div
       }
       return div
   }
   check_burnzone(id,vec[],aimvec[],speed1,speed2,radius){
       new maxplayers = get_maxplayers()+1
       new tbody,tid
       get_user_aiming(id,tid,tbody,550)
       if((tid > 0) && (tid < maxplayers)){
           if(cvar_exists("mp_friendlyfire")){
               new ffcvar = get_cvar_num("mp_friendlyfire")
               if(    (ffcvar    ==    0)    ||   ((ffcvar   ==   1)   &&
   (get_cvar_num("amx_flamethrower_obeyffcvar") == 0)) ){
                   if(dod_running){
                       if(dod_team[tid] != dod_team[id])
                           burn_victim(tid,id,0)
                   }else{
                       if(get_user_team(tid) != get_user_team(id))
                           burn_victim(tid,id,0)
                   }
               }else{
                   if(dod_running){
                       if(dod_team[tid] == dod_team[id])
                           burn_victim(tid,id,1)
                       else
                           burn_victim(tid,id,0)
                   }else{
                       if(get_user_team(tid) == get_user_team(id))
                           burn_victim(tid,id,1)
                       else
                           burn_victim(tid,id,0)
                   }
               }
           }else{
               burn_victim(tid,id,0)
           }
       }

       new burnvec1[3],burnvec2[3],length1
       burnvec1[0]=aimvec[0]-vec[0]
       burnvec1[1]=aimvec[1]-vec[1]
       burnvec1[2]=aimvec[2]-vec[2]
       length1=sqrt(burnvec1[0]*burnvec1[0]+burnvec1[1]*burnvec1[1]+burnv
   ec1[2]*burnvec1[2])
       burnvec2[0]=burnvec1[0]*speed2/length1
       burnvec2[1]=burnvec1[1]*speed2/length1
       burnvec2[2]=burnvec1[2]*speed2/length1
       burnvec1[0]=burnvec1[0]*speed1/length1
       burnvec1[1]=burnvec1[1]*speed1/length1
       burnvec1[2]=burnvec1[2]*speed1/length1
       burnvec1[0] += vec[0]
       burnvec1[1] += vec[1]
       burnvec1[2] += vec[2]
       burnvec2[0] += vec[0]
       burnvec2[1] += vec[1]
       burnvec2[2] += vec[2]
       new origin[3]
       for (new i=1; i<=maxplayers; i++) {
           if(cvar_exists("mp_friendlyfire")){
               new ffcvar = get_cvar_num("mp_friendlyfire")
               if(    (ffcvar    ==    0)    ||   ((ffcvar   ==   1)   &&
   (get_cvar_num("amx_flamethrower_obeyffcvar") == 0)) ){
                   if(dod_running){
                       if(dod_team[i] != dod_team[id]){
                           if((is_user_alive(i) == 1) && (i != id)){
                               get_user_origin(i,origin)
                               if(get_distance(origin,burnvec1) < radius)
                                   burn_victim(i,id,0)
                               else   if(get_distance(origin,burnvec2)  <
   radius)
                                   burn_victim(i,id,0)
                           }
                       }
                   }else{
                       if(get_user_team(i) != get_user_team(id)){
                           if((is_user_alive(i) == 1) && (i != id)){
                               get_user_origin(i,origin)
                               if(get_distance(origin,burnvec1) < radius)
                                   burn_victim(i,id,0)
                               else   if(get_distance(origin,burnvec2)  <
   radius)
                                   burn_victim(i,id,0)
                           }
                       }
                   }
               }else{
                   if((is_user_alive(i) == 1) && (i != id)){
                       get_user_origin(i,origin)
                       if(dod_running){
                           if(dod_team[i] == dod_team[id]){
                               if(get_distance(origin,burnvec1) < radius)
                                   burn_victim(i,id,1)
                               else   if(get_distance(origin,burnvec2)  <
   radius)
                                   burn_victim(i,id,1)
                           }else{
                               if(get_distance(origin,burnvec1) < radius)
                                   burn_victim(i,id,0)
                               else   if(get_distance(origin,burnvec2)  <
   radius)
                                   burn_victim(i,id,0)
                           }
                       }else{
                           if(get_user_team(i) == get_user_team(id)){
                               if(get_distance(origin,burnvec1) < radius)
                                   burn_victim(i,id,1)
                               else   if(get_distance(origin,burnvec2)  <
   radius)
                                   burn_victim(i,id,1)
                           }else{
                               if(get_distance(origin,burnvec1) < radius)
                                   burn_victim(i,id,0)
                               else   if(get_distance(origin,burnvec2)  <
   radius)
                                   burn_victim(i,id,0)
                           }
                       }
                   }
               }
           }else{
               if((is_user_alive(i) == 1) && (i != id)){
                   get_user_origin(i,origin)
                   if(get_distance(origin,burnvec1) < radius)
                       burn_victim(i,id,0)
                   else if(get_distance(origin,burnvec2) < radius)
                       burn_victim(i,id,0)

               }
           }
       }
       return PLUGIN_CONTINUE
   }
   burn_victim(id,killer,tk){
       if(isburning[id] == 1)
           return PLUGIN_CONTINUE
       isburning[id] = 1
       emit_sound(id, CHAN_ITEM, "ambience/burning1.wav", 1.0, ATTN_NORM,
   0, PITCH_NORM)
       new hp,args[4]
       hp = get_user_health(id)
       if(hp > 250)
           hp = 250
       args[0] = id
       args[1] = killer
       args[2] = tk
       set_task(0.3,"on_fire",451,args,4,"a",hp / 10)
       set_task(0.7,"fire_scream",0,args,4)
       set_task(5.5,"stop_firesound",0,args,4)
       if(tk == 1){
           new namea[32]
           get_user_name(killer,namea,31)
           new teama[32]
           get_user_team(killer,teama,31)
           new players[32],pNum
           get_players(players,pNum,"e",teama)
           for(new i=0;i<pNum;i++)
               client_print(players[i],print_chat,"%s  attacked         a
   teammate",namea)
           new punish1 = get_cvar_num("amx_flamethrower_tkpunish1")
           new punish2 = get_cvar_num("amx_flamethrower_tkpunish2")
           if(punish1 > 2){
               user_kill(killer,0)
               set_hudmessage(255,50,50, -1.0, 0.45, 0, 0.02, 10.0, 1.01,
   1.1, 4)
               show_hudmessage(killer,"YOU   WERE  KILLED^nFOR  ATTACKING
   TEAMMATES.^nSEE THAT IT HAPPENS NO MORE!")
           }
           tkcount[killer] +=1
           if((punish1) && (tkcount[killer] > punish2 - 1)){
               if(punish1 == 1 || punish1 == 3)
                   client_cmd(killer,"echo   You  were  kicked  for  team
   killing;disconnect")
               else if(punish1 == 2 || punish1 == 4){
                   client_cmd(killer,"echo   You  were  banned  for  team
   killing")
                   new authida[16]
                   get_user_authid(killer,authida,15)

                   if (equal("4294967295",authida)){
                       new ipa[32]
                       get_user_ip(killer,ipa,31,1)
                       server_cmd("addip 180.0 %s;writeip",ipa)
                   }else{
                       server_cmd("banid 180.0 %s kick;writeid",authida)
                   }
               }
           }
       }
       return PLUGIN_CONTINUE
   }
   public on_fire(args[]){
       new hp,rx,ry,rz,forigin[3]
       new id = args[0]
       new killer = args[1]
       new tk = args[2]
       if(isburning[id] == 0)
           return PLUGIN_CONTINUE
       rx = random_num(-30,30)
       ry = random_num(-30,30)
       rz = random_num(-30,30)
       get_user_origin(id,forigin)
       //TE_SPRITE - additive sprite, plays 1 cycle
       message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
       write_byte( 17 )
       write_coord(forigin[0]+rx) // coord, coord, coord (position)
       write_coord(forigin[1]+ry)
       write_coord(forigin[2]+10+rz)
       write_short( burning ) // short (sprite index)
       write_byte( 30 ) // byte (scale in 0.1's)
       write_byte( 200 ) // byte (brightness)
       message_end()
       //Smoke
       message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
       write_byte( 5 )
       write_coord(forigin[0]+(rx*2)) // coord, coord, coord (position)
       write_coord(forigin[1]+(ry*2))
       write_coord(forigin[2]+100+(rz*2))
       write_short( smoke )// short (sprite index)
       write_byte( 60 ) // byte (scale in 0.1's)
       write_byte( 15 ) // byte (framerate)
       message_end()
       if(is_user_alive(id) == 0)
           return PLUGIN_CONTINUE
       hp = get_user_health(id)
       set_user_health(id,hp - 11)
       if(hp - 11 < 1){
           new
   namek[32],namev[32],authida[40],authidv[40],teama[32],teamv[32]
           get_user_name(id,namev,31)
           get_user_name(killer,namek,31)
           get_user_authid(id,authidv,39)
           get_user_authid(killer,authida,39)
           get_user_team(id,teamv,31)
           get_user_team(killer,teama,31)
           if(dlog)
               log_to_file("admin_logs/FIRE.log","%s   burned   %s",namek
   ,namev)
           log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with
   ^"Flame Thrower^"",
               namek,get_user_userid(killer),authida,teama,namev,get_user
   _userid(id),authidv,teamv)
           client_print(id,print_chat,"[AMX]  You  were  killed  by  %s's
   flamethrower",namek)
           client_print(killer,print_chat,"[AMX]  You killed %s with your
   flamethrower",namev)
           new fr = get_user_frags(killer)
           if(tk == 1){
               client_print(killer,print_center,"You killed a teammate")
               set_user_frags(killer,fr - 1)
           }else{
               set_user_frags(killer,fr + 1)
           }
           new fr2 = get_user_frags(id)
           set_user_frags(id,fr2 + 1)
           #if use_war3 == 1
           stop_dm(killer,id,1,9876)
           #endif
           server_cmd("artificial_dm %d %d",killer,id)
       }
       return PLUGIN_CONTINUE
   }
   public fire_scream(args[]){
       emit_sound(args[0], CHAN_AUTO, "scientist/c1a0_sci_catscream.wav",
   1.0, ATTN_NORM, 0, PITCH_NORM)
       return PLUGIN_CONTINUE
   }
   public stop_firesound(args[]){
       isburning[args[0]] = 0
       emit_sound(args[0],  CHAN_ITEM, "vox/_period.wav", 1.0, ATTN_NORM,
   0, PITCH_NORM)
       return PLUGIN_CONTINUE
   }
   public HandleSay(id) {
       new Speech[192]
       read_args(Speech,192)
       remove_quotes(Speech)
       if (equal(Speech, "vote_flamethrower")) {
           if (restrict_override == 1) {
               client_print(id,print_chat,"[AMX]             Flamethrower
   restrictions cannot be changed. Override is on.")
               return PLUGIN_HANDLED
           }
           FLVote(id)
       }
       else if( (restrict_override == 0) && (bFLvote == true) ){
           if(  (containi(Speech,  "fire")  !=  -1)  || (containi(Speech,
   "flam") != -1) ){
               if(get_cvar_num("amx_luds_flamethrower") == 1){
                   client_print(id,print_chat,      "[AMX]  Flamethrowers
   enabled.    To    change    say   vote_flamethrower   For   help   say
   /flamethrower")
               }else{
                   client_print(id,print_chat,      "[AMX]  Flamethrowers
   disabled.    To    change   say   vote_flamethrower   For   help   say
   /flamethrower")
               }
           }
       }
       return PLUGIN_CONTINUE
   }
   public flamet_motd(id){
       new hk_motd[1300]
       new temp[768]
       temp   =   "Bind  a  key  to  amx_fire_flamethrower.  Go  to  your
   console,^n\
                   choose a key for firing your flamethrower. Lets say^n\
               we want to use CAPSLOCK. Do this in console:^n^n\
               bind capslock amx_fire_flamethrower^n^n\
               Enter that and now whenever you press the CAPSLOCK key,^n\
                     it   fires   your   flamethrower.  By  default  each
   flamethrower^n"
       add(hk_motd,1299,temp)
       temp  =  "burst  costs  you  50  armor  points. So you need to buy
   armor^n\
               in order to use your flamethrower. Also, flamethrower^n\
               may need to be enabled by admin for you to use it. The^n\
               flamethrower,  while  not  having  a  long range, does not
   by^n"
       add(hk_motd,1299,temp)
       temp  =  "nature  require  a  high  degree of accuracy and is thus
   very^n\
               effective   and  highly  lethal  at  short  range  against
   members^n\
               of the opposite team.^n^n\
               Admin  might  have  set  that flamethrowers be bought with
   money^n\
               instead  of  using  armor  points in which case every time
   you^n\
               use the flame thrower money is taken from you."
       add(hk_motd,1299,temp)
       show_motd(id,hk_motd,"Flamethrower Help:")
       return PLUGIN_CONTINUE
   }
   public FLVote(id) {
       if( (flvote_deny == true) && (!(get_user_flags(id)&ADMIN_MAP)) ){
           client_print(id,print_chat,"[AMX]  We  just had a flamethrower
   vote. Wait a little longer.")
           return PLUGIN_HANDLED
       }
       if( (bFLvote == false) && (!(get_user_flags(id)&ADMIN_MAP)) ){
           client_print(id,print_chat,"[AMX]  Server  is set so that only
   admins can start this vote.")
           return PLUGIN_HANDLED
       }
       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 inprogress[32]
       get_cvar_string("amx_vote_inprogress",inprogress,32)
       if(equal(inprogress, "0",1)){
       new menu_msg[256]
       new keys
       if(cstrike_running)
           format(menu_msg,256,"\yAllow  Flamethrowers?  \w^n^n1.  Yes, I
   am a pyromaniac!^n2.  No, fire scares me")
       else
           format(menu_msg,256,"Allow  Flamethrowers? ^n^n1.  Yes, I am a
   pyromaniac!^n2.  No, fire scares me")
       keys = (1<<0)|(1<<1)
       new authid[16],name[32]
       get_user_authid(id,authid,16)
       get_user_name(id,name,32)
       log_to_file("addons/amx/admin.log","^"%s<%d><%s><>^"
   flamethrower",
           name,get_user_userid(id),authid)
       new Float:vote_time = get_cvar_float("amx_vote_time") + 2.0
       set_cvar_float("amx_last_voting",  get_gametime() + vote_time )
       vote_ratio = get_cvar_float("amx_fl_vote_ratio")
       for(new a = 0; a < 33; a++){
           votecontroller[a][1] = 0
       }
       votenumber++
       set_cvar_string("amx_vote_inprogress","1")
       ejl_vault("WRITE","CURRENT_VOTE","FT_VOTE")
       bVoteToStop = true
       totalvoters = 0
       new Team[33]
       new maxpl = get_maxplayers()+1
       for(new k = 1; k < maxpl; k++){
           if(!is_user_bot(k)){
               get_user_team(k,Team,33)
               if(!((equali(Team,"UNAS",4)) || (equali(Team,"SPEC",4)) ||
   (get_user_time(k)== 0) )){
                   show_menu(k,keys,menu_msg,floatround(vote_time))
                   totalvoters++
               }
           }
       }
       set_task(vote_time,"HandleFTVote")
       client_print(id,print_console,"[AMX] Voting has started...")
       for(new j = 0; j < 4;++j) option[j] = 0
       }else{
       client_print(id,print_chat,"[AMX] Voting not allowed yet.")
       }
       return PLUGIN_HANDLED
   }
   public HandleFTVote() {
       set_hudmessage(63,187,239,  -1.0,  0.70, 2, 0.02, 10.0, 0.01, 0.1,
   2)
       flvote_deny = true
       set_task(get_cvar_float("amx_flvote_delay"),"fl_vote_deny")
       set_cvar_string("amx_vote_inprogress","0")
       ejl_vault("WRITE","CURRENT_VOTE","NULL")
       bVoteToStop = false
       for(new a = 0; a < 33; a++){
           votecontroller[a][1] = 0
       }
       if(st_vote == 1){
           st_vote = 0
           client_print(0,print_chat,"[AMX]  Voting           sucessfully
   stopped.")
           return PLUGIN_HANDLED
       }
       new best = 0
       new best_count = 0
       for(new a = 0; a < 4; ++a) {
           if (option[a] > best_count){
               best_count = option[a]
               best = a
           }
       }
       new inum = totalvoters
       new  Float:result_v = inum ? (float(option[best]) / float(inum)) :
   0.0
       if (result_v >= vote_ratio) {
           if(best == 0){
               client_print(0,print_chat,"[AMX]    Voting    over    ....
   Flamethrower wins.")
               if(get_cvar_num("amx_luds_flamethrower") == 1){
                   show_hudmessage(0,"Vote over.^nFlamethrowers will stay
   enabled.^n^n%d  votes for Flamethrowers ON^n%d votes for Flamethrowers
   OFF^n^n%d Total eligible voters",
                   option[0],option[1],totalvoters)
               } else {
                   set_hudmessage(63,187,239,  -1.0, 0.70, 2, 0.02, 10.0,
   0.01, 0.1, 2)
                   show_hudmessage(0,"Vote  over.^nUse Flamethrower wins.
   Burn   baby!!!^n^n%d   votes   for   Flamethrowers  ON^n%d  votes  for
   Flamethrowers OFF^n^n%d Total eligible voters",
                   option[0],option[1],totalvoters)
                   set_cvar_string("amx_luds_flamethrower","1")
               }
               log_to_file("addons/amx/admin.log","World        triggered
   ^"voting_success^"   (needed   ^"%.2f^")   (ratio   ^"%.2f^")  (result
   ^"flamethrower^")",
                   vote_ratio,result_v)
           }else {
               client_print(0,print_chat,"[AMX]   Voting   over  ....  No
   Flamethrowers.")
               if(get_cvar_num("amx_luds_flamethrower") == 0){
                   show_hudmessage(0,"Vote over.^nFlamethrowers will stay
   disabled.^n^n%d votes for Flamethrowers ON^n%d votes for Flamethrowers
   OFF^n^n%d Total eligible voters",
                   option[0],option[1],totalvoters)
               } else {
                   show_hudmessage(0,"Vote over.^nFlamethrower loses, put
   the   fire   out.^n^n%d  votes  for  Flamethrowers  ON^n%d  votes  for
   Flamethrowers OFF^n^n%d Total eligible voters",
                   option[0],option[1],totalvoters)
                   set_cvar_string("amx_luds_flamethrower","0")
               }
               log_to_file("addons/amx/admin.log","World        triggered
   ^"voting_failure^" (needed ^"%.2f^") (ratio ^"%.2f^")",
                   vote_ratio,result_v)
           }
       }else{
           client_print(0,print_chat,"[AMX]   Voting   for  flamethrowers
   failed... No clear majority.")
       }
       return PLUGIN_HANDLED
   }
   public vote_count(id,key)
   {
       ejl_vault("READ","CURRENT_VOTE","")
       if(equal(vault_value,"FT_VOTE")){
       new name[32]
       get_user_name(id,name,32)
       if(votenumber != votecontroller[id][0]){
           votecontroller[id][0] = votenumber
           if (get_cvar_float("amx_vote_answers")) {
               client_print(0,print_chat,"[AMX]  %s  voted  for  option #
   %d",name,key+1)
           }
           option[key] += 1
       }else{
           votecontroller[id][1] +=1
       }
       }else{
           return PLUGIN_CONTINUE
       }
       return PLUGIN_HANDLED
   }
   public stopvote(id,level,cid){
       if (!cmd_access(id,level,cid,1))
           return PLUGIN_HANDLED
       if(bVoteToStop == true){
           new name[32]
           get_user_name(id,name,32)
           st_vote = 1
           client_print(id,print_console,"[AMX]  ADMIN   !!!  Ignore  the
   unknown command message -- its ok")
           client_print(0,print_chat,"[AMX]  %s  has disabled the vote in
   progress.",name)
       }
       return PLUGIN_CONTINUE
   }
   public fl_vote_deny(){
       flvote_deny = false
       return PLUGIN_CONTINUE
   }
   public client_connect(id){
       dod_team[id] = 0
       isburning[id] = 0
       tkcount[id] = 0
       votecontroller[id][1] = 0
       flame_count[id] = get_cvar_num("amx_flamethrower_free")
       return PLUGIN_CONTINUE
   }
   public client_disconnect(id){
       dod_team[id] = 0
       isburning[id] = 0
       tkcount[id] = 0
       votecontroller[id][1] = 0
       return PLUGIN_CONTINUE
   }
   public plugin_log(){
       new args = read_logargc()
       if(args == 2){
           new msg[32]
           read_logargv(1,msg,31)
           if(msg[6] == 'S')
               round_start()
       }
       else if(args == 3){
           new msg[32]
           read_logargv(1,msg,31)
           if(equal(msg,"joined t",8)){
               new clinfo[64],won[32],cutoff,bcount
               new classinfo[32]
               read_logargv(0,clinfo,63)
               read_logargv(2,classinfo,31)
               new tcbackw = strlen(clinfo)
               new cbackw = tcbackw
               for(new i=0;i<tcbackw;i++){
                   cbackw -= 1
                   if(cbackw > 0){
                       if(clinfo[cbackw] == '<'){
                           bcount +=1
                           if(bcount == 3){
                               copy(won,i-cutoff,clinfo[cbackw+1])
                           }
                           else if(bcount == 2)
                               cutoff = i + 2
                       }
                   }
               }
               new iwon = strtonum(won)
               new playerl = find_player("k",iwon)
               if(!playerl) return PLUGIN_CONTINUE
               if(equali(classinfo,"Axis"))
                   dod_team[playerl] = 1
               else
                   dod_team[playerl] = 2
           }
       }
       return PLUGIN_CONTINUE
   }
   round_start(){
       new maxpl = get_maxplayers()+1
       for(new k = 1; k < maxpl; k++){
           isburning[k] = 0
           new freeF = get_cvar_num("amx_flamethrower_free")
           if(freeF > 0)
               flame_count[k] = freeF
       }
   }
   public new_spawn(id){
       #if use_war3 == 1
       block_message(gmsgDeathMsg)
       #endif
       isburning[id] = 0
       new freeF = get_cvar_num("amx_flamethrower_free")
       if((!cstrike_running) || (freeF > 0))
           flame_count[id] = freeF
       return PLUGIN_CONTINUE
   }
   #if use_war3 == 1
   public stop_dm(id,tid,tbody,num){
       if(num == 9876){
           if (tbody == 1){
               message_begin( MSG_ALL, gmsgDeathMsg,{0,0,0},0)
               write_byte(id)
               write_byte(tid)
               write_string(" flamethrower")
               message_end()
           }else{
               message_begin( MSG_ALL, gmsgDeathMsg,{0,0,0},0)
               write_byte(id)
               write_byte(tid)
               write_byte(0)
               write_string(" flamethrower")
               message_end()
           }
       }else{
           if(redundant_plug == 0){
               new killer_id = read_data(1)
               new victim_id = read_data(2)
               new headshot = read_data(3)
               new weaponname[20]
               if(cstrike_running)
                   read_data(4,weaponname,31)
               else
                   read_data(3,weaponname,31)
               new weapon
               get_user_attacker(victim_id,weapon)

               if     (!(killer_id==victim_id     &&     !headshot     &&
   equal(weaponname,"world"))){
                   message_begin( MSG_ALL, gmsgDeathMsg,{0,0,0},0)
                   write_byte(killer_id)
                   write_byte(victim_id)
                   write_byte(headshot)
                   write_string(weaponname)
                   message_end()
               }
           }
       }
       return PLUGIN_HANDLED
   }
   public regulate_plugins_dm(){
       new nump = get_pluginsnum()
       new filename[64],name[64],version[32],author[32],status[32]
       for(new i=0;i<nump;++i){
           get_plugin(i,filename,63,name,63,version,31,author,31,status,3
   1)
           if(equali(filename,"warcraft3.amx")){
               set_cvar_num("amx_ejl_rpdm",1)
               redundant_plug = 1
           }
       }
       for(new i=0;i<nump;++i){
           get_plugin(i,filename,63,name,63,version,31,author,31,status,3
   1)
           if(get_cvar_num("amx_ejl_rpdm")){
               if(     (equali(filename,"amx_ejl_laserweapon.amx"))    &&
   (strtonum(version[0]) > 1) )
                   redundant_plug = 1
               else     if(     (equali(filename,"laser_guns.amx"))    &&
   (strtonum(version[0]) > 1) )
                   redundant_plug = 1
               else   if(   (equali(filename,"amx_ejl_missiles.amx"))  &&
   (strtonum(version[0]) > 1) )
                   redundant_plug = 1
               else     if(    (equali(filename,"cs_missiles.amx"))    &&
   (strtonum(version[0]) > 1) )
                   redundant_plug = 1
               else   if(   (equali(filename,"amx_ejl_timebomb.amx"))  &&
   (strtonum(version[0]) > 2) )
                   redundant_plug = 1
               else      if(     (equali(filename,"kamikaze.amx"))     &&
   (strtonum(version[0]) > 2) )
                   redundant_plug = 1
               else   if(   (equali(filename,"amx_ejl_jetpack.amx"))   &&
   (strtonum(version[0]) > 1) )
                   redundant_plug = 1
               else    if(    (equali(filename,"luds_jetpack.amx"))    &&
   (strtonum(version[0]) > 1) )
                   redundant_plug = 1
           }
       }
       set_cvar_num("amx_ejl_rpdm",1)
       set_task(1.0,"regulate_plugins_rs")
       return PLUGIN_CONTINUE
   }
   public regulate_plugins_rs(){
       set_cvar_num("amx_ejl_rpdm",0)
       return PLUGIN_CONTINUE
   }
   #endif
   public plugin_precache(){
       fire = precache_model("sprites/explode1.spr")
       new mod_name[32]
       get_modname(mod_name,31)
       dod_running = equal(mod_name,"dod") ? true : false
       if(dod_running){
           smoke = precache_model("sprites/smoke.spr")
           burning = precache_model("sprites/fire.spr")
       }else{
           smoke = precache_model("sprites/steam1.spr")
           burning = precache_model("sprites/xfire.spr")
       }
       precache_sound("ambience/burning1.wav")
       precache_sound("ambience/flameburst1.wav")
       precache_sound("scientist/c1a0_sci_catscream.wav")
       precache_sound("vox/_period.wav")
       return PLUGIN_CONTINUE
   }
   public plugin_init(){
       register_plugin("CS FLAMETHROWER","5.3.1","EJL")
       register_concmd("amx_flamethrowers","amx_fl",ADMIN_LEVEL_H,":
   toggles flamethrowers on and off")
       register_concmd("amx_flamethrowers_cost","amx_fl_c",ADMIN_LEVEL_H,
   ": sets flamethrowers cost in money or armor amount")
       register_concmd("amx_flamethrowers_buytype","amx_fl_b",ADMIN_LEVEL
   _H,": toggles flamethrowers buytype: armor or money")
       register_concmd("amx_flamethrowers_vote","amx_flvote",ADMIN_LEVEL_
   H,":  toggles  ability  for players to start flamethrower votes on and
   off")
       register_concmd("amx_flamethrowers_vote_default","amx_flvote_d",AD
   MIN_RCON,": sets the current flamethrowervote mode to server default")
       register_clcmd("amx_fire_flamethrower","amx_fflame")
       register_clcmd("say /flamethrower","flamet_motd")
       register_clcmd("say","HandleSay")
       register_cvar("amx_luds_flamethrower","1",FCVAR_SERVER)
       register_cvar("amx_flamethrower_cost","30")
       register_cvar("amx_flamethrower_buytype","0")
       register_cvar("amx_flamethrower_free","0")
       register_cvar("amx_flamethrower_tkpunish1","1")
       register_cvar("amx_flamethrower_tkpunish2","3")
       register_cvar("amx_flamethrower_obeyffcvar","1")
       register_cvar("amx_flamethrower_botsnolimit","1")
       set_cvar_string("amx_luds_flamethrower","1")
       set_cvar_string("amx_flamethrower_cost","30")
       set_cvar_string("amx_flamethrower_buytype","0")
       set_cvar_string("amx_flamethrower_free","0")
       set_cvar_string("amx_flamethrower_tkpunish1","1")
       set_cvar_string("amx_flamethrower_tkpunish2","3")
       set_cvar_string("amx_flamethrower_obeyffcvar","1")
       set_cvar_string("amx_flamethrower_botsnolimit","1")
       register_concmd("stopvote","stopvote",ADMIN_MAP,"stops   vote   in
   progress")
       register_menucmd(register_menuid("Allow      Flamethrowers?     ")
   ,(1<<0)|(1<<1)|(1<<2)|(1<<3),"vote_count")
       register_cvar("amx_fl_vote_ratio","0.51")
       register_cvar("amx_vote_time","15")
       register_cvar("amx_vote_answers","1")
       register_cvar("amx_vote_delay","1")
       register_cvar("amx_last_voting","0")
       register_cvar("amx_vote_inprogress","0")
       register_cvar("amx_flvote_delay","180.0")
       set_cvar_string("amx_flvote_delay","180.0")
       register_event("ResetHUD", "new_spawn", "b")
       register_srvcmd("bot_flamethrower","bot_interface")
       new mod_name[32]
       get_modname(mod_name,31)
       cstrike_running = equal(mod_name,"cstrike") ? true : false
       ejl_vault("READ","FLAMETHROWER_VOTE","")
       if(equal(vault_value,"OFF"))
           bFLvote = false
       else
           bFLvote = true

       #if use_war3 == 1
       gmsgDeathMsg = get_user_msgid("DeathMsg")
       register_event("DeathMsg", "stop_dm", "a")
       block_message(gmsgDeathMsg)
       set_task(1.0,"regulate_plugins_dm")
       register_cvar("amx_ejl_rpdm","0")
       #endif
       return PLUGIN_CONTINUE
   }
   public ejl_vault(rw[],key[],value[]){
       new data[192]
       new stxtsize = 0
       new line = 0
       new skip = 0
       new vkey[64]
       new vvalue[128]
       new vaultwrite[192]
       if(equal(rw,"READ")){
           if(file_exists("addons/amx/ejl_vault.ini") == 1){
               copy(vault_value,128,"")
               while((line=read_file("addons/amx/ejl_vault.ini",line,data
   ,192,stxtsize))!=0){
                   parse(data,vkey,64,vvalue,128)
                   if(equal(vkey,key)){
                       copy(vault_value,128,vvalue)
                   }
               }
           }else{
               write_file("addons/amx/ejl_vault.ini",  "****  Plugins use
   to store values -- immune to crashes and map changes ****", 0)
           }
       }
       else if(equal(rw,"WRITE")){
           if(file_exists("addons/amx/ejl_vault.ini") == 1){
               format(vaultwrite,192,"%s %s",key,value)
               while((line=read_file("addons/amx/ejl_vault.ini",line,data
   ,192,stxtsize))!=0){
                   parse(data,vkey,64,vvalue,128)
                   if(skip == 0){
                       if( (equal(data,"")) || (equal(vkey,key)) ){
                           skip = 1
                           write_file("addons/amx/ejl_vault.ini",vaultwri
   te,line-1)
                       }
                   }
                   else if(equal(vkey,key)){
                       write_file("addons/amx/ejl_vault.ini","",line-1)
                   }
               }
               if(skip == 0){
                   write_file("addons/amx/ejl_vault.ini",vaultwrite,-1)
               }
           }
       }
       return PLUGIN_CONTINUE
   }
