Проблем с Shop за Cs 1.6 BB

Всичко свързано с AMX mod (X), плъгини, проблеми с плъгини, заявки и тн.
Потребителски аватар
MuHaBaM
Member
Мнения: 56
Регистриран: ср май 25, 2016 12:50 pm
Баланс: Locked

нед авг 07, 2016 2:37 pm

Здравейте, от доста време търся шоп за BaseBuildeR... Пуснах тема тук, в др. форуми, но никой не ми хелпна.. И така реших да поискам помощ от "{ S p @ W n } +++" и той ми помогна. Имаше само 5 минутки, защото отиваше на работа... Написа ми го и ми каза, ако има проблеми да му пиша, но аз не го направих, защото е натрупан с работа.

И така...

Имам проблем с отката, Невидимостта и безкрайните патрони..

Код:

Код: Трябва да си влязъл в системата, за да можеш да виждаш линковете

#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <coll_msg>
#include <basebuilder>
#include <hamsandwich>
#include <engine>
#include <fun>

#define m_pActiveItem 373
#define  cost cs_get_user_money(id)

new bool:norecoil[33]
new bool:ulimitedclip[33]
new bool:isinvisible[33]
new bool:superknife[33]

new pcvar_string[12]
new pcvar_prefix, pcvar_damage, g_MaxPlayers

new const v_dragon_barlog9[] = { "models/bb/v_dragon_barlog9.mdl" }

new const cmd_bmenu[][] = 
{
   "say shop",
   "say !shop",
   "say /shop",
   "say_team shop",
   "say_team !shop",
   "say_team /shop"
}

public plugin_init()
{
   RegisterHam(Ham_Spawn, "player", "HookSpawn", true)
   
   register_event("DeathMsg", "event_deathmsg", "a")
   register_event("HLTV", "event_hltv", "a", "1=0", "2=0")
   register_event("CurWeapon", "event_curweapon", "be", "1=1", "2=29")
   
   register_forward(FM_PlayerPreThink, "forward_PreThink", true)
   
   for(new i = 0; i < sizeof(cmd_bmenu); i++)
      register_clcmd(cmd_bmenu[i], "open_bmenu")
}
public plugin_cfg()
{
   pcvar_prefix = register_cvar("bb_shop_prefix", "BaseBuilder")
   pcvar_damage = register_cvar("bb_shop_damage", "3.0")
   g_MaxPlayers = get_maxplayers()
}
public plugin_precache()
{
   precache_model(v_dragon_barlog9)
   precache_sound("items/smallmedkit1.wav")
}
public client_putinserver(id)
{
   Execute(id) 
}
public event_hltv()
{
   for(new i = 0; i <= g_MaxPlayers; i++) 
      Execute(i)
}
public HookSpawn(const id)
{
   if(is_user_alive(id))
   {
      Execute(id)
      set_user_footsteps(id, 0)
      set_user_rendering(id, _, 0, 0, 0, _, 0)
   }
   
   return HAM_IGNORED
}
Execute(id)
{
   norecoil[id] = false
   ulimitedclip[id] = false 
   isinvisible[id] = false 
   superknife[id] = false 
}
public HookHamDamage(victim, inflictor, attacker, Float:damage, damage_bits)
{
   if(is_user_alive(attacker) && attacker != victim)
      if(superknife[attacker]) SetHamParamFloat(4, damage * get_pcvar_float(pcvar_damage))
}
public open_bmenu(id)
{
   new Text[256 char], menu
   get_pcvar_string(pcvar_prefix, pcvar_string, charsmax(pcvar_string))
   
   if(!is_user_alive(id))
   {
      Chat(id, "^3[%s] ^4Trqbva da si jiv^1!", pcvar_string)
      return PLUGIN_HANDLED
   }
   
   if(bb_is_build_phase())
   {
      new a = bb_get_build_time()
      Chat(id, "^3[%s] ^4Vreme do nachaloto na rounda ^3[^4 %d ^1:^4 %02d ^3] ^1!", pcvar_string, (a / 60), (a % 60))
      return PLUGIN_HANDLED
   }
   
   if(!bb_is_user_zombie(id))
   {
      formatex(Text, charsmax(Text), "\w[%s]^n\yHuman Shop\d| \yImash: \r$%d\r", pcvar_string, cost)
      
      menu = menu_create(Text, "handler_bmenu")
      
      menu_additem(menu, "\y100 health  \d- \r$8000", "1", 0)
      menu_additem(menu, "\yUnlimited clip \d- \r$10000 \w{20 sec}", "2", 0)
      menu_additem(menu, "\yNo recoil \d- \r$6000", "3", 0)
   }
   else
   {
      formatex(Text, charsmax(Text), "\w[%s]^n\yZombie Shop\d| \yImash: \r$%d\r", pcvar_string, cost)
      
      menu = menu_create(Text, "handler_bmenu")
      
      menu_additem(menu, "\y3000 health \d- \r$15000", "1", 0)
      menu_additem(menu, "\yInvisible \d- \r$8000 \w{80%}", "2", 0)
      menu_additem(menu, "\ySuper knife \d \r$10000 \w{x3 dmg}", "3", 0)      
   }
   
   menu_setprop(menu, MPROP_EXITNAME, "\dIzhod")
   menu_display(id, menu, 0)
   
   return PLUGIN_HANDLED_MAIN
}
public handler_bmenu(id, menu, item)
{
   if(!is_user_alive(id)) return ITEM_IGNORE
   get_pcvar_string(pcvar_prefix, pcvar_string, charsmax(pcvar_string))
   
   if(item == MENU_EXIT)
   {
      menu_destroy(menu)
      return ITEM_IGNORE
   }
   
   new data[4]
   new access, callback
   
   menu_item_getinfo(menu, item, access, data,charsmax(data), _, _, callback)
   
   new key = str_to_num(data)
   
   if(!bb_is_user_zombie(id))
   {
      switch(key)
      {
         case 1:
         {
            if(cost < 8000)
            {
               open_bmenu(id)
               Chat(id, "^3[%s] ^4Nqmash dostatuchno pari^1!", pcvar_string)
               return ITEM_IGNORE
            }
            
            cs_get_money(id, 8000, 1)
            set_user_health(id, get_user_health(id) + 100)
            emit_sound(id, CHAN_AUTO, "items/smallmedkit1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
            Chat(id, "^3[%s] ^4Ti poluchi^1: ^3+100 health^1!", pcvar_string)
         }
         case 2:
         {
            if(ulimitedclip[id])
            {
               open_bmenu(id)
               Chat(id, "^3[%s] ^4Tozi item veche e zakupen ot teb^1!", pcvar_string)
               return ITEM_IGNORE
            }
            
            if(cost < 10000)
            {
               open_bmenu(id)
               Chat(id, "^3[%s] ^4Nqmash dostatuchno pari^1!", pcvar_string)
               return ITEM_IGNORE
            }
            
            cs_get_money(id, 10000, 1)
            set_task(Float:20.0, "iDrop", id)
            client_cmd(id, "items/gunpickup2")
            cs_set_weapon_ammo(get_pdata_cbase(id,m_pActiveItem), 97280)
            cs_set_user_bpammo(id, get_pdata_cbase(id, m_pActiveItem), 0)
            Chat(id, "^3[%s] ^4Ti poluchi sposobnost^1: ^3Unlimited clip ^1[^3 20 sec ] ^4!", pcvar_string)
            ulimitedclip[id] = true 
         }
         case 3: 
         {
            if(norecoil[id])
            {
               open_bmenu(id)
               Chat(id, "^3[%s] ^4Tozi item veche e zakupen ot teb^1!", pcvar_string)
               return ITEM_IGNORE
            }
            
            if(cost < 6000)
            {
               open_bmenu(id)
               Chat(id, "^3[%s] ^4Nqmash dostatuchno pari^1!", pcvar_string)
               return ITEM_IGNORE
            }
            
            cs_get_money(id, 6000, 1)
            client_cmd(id, "items/gunpickup2")
            Chat(id, "^3[%s] ^4Ti poluchi sposobnost^1: No recoil^1!")
            norecoil[id] = true
         }
      }
   }
   else
   {
      switch(key)
      {
         case 1:
         {
            if(cost < 15000)
            {
               open_bmenu(id)
               Chat(id, "^3[%s] ^4Nqmash dostatuchno pari^1!", pcvar_string)
               return ITEM_IGNORE
            }
            
            cs_get_money(id, 15000, 1)
            set_user_health(id, get_user_health(id) + 3000)
            emit_sound(id, CHAN_AUTO, "items/smallmedkit1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
            Chat(id, "^3[%s] ^4Ti poluchi^1: ^3+3000 health^1!", pcvar_string)            
         }
         case 2:
         {
            if(isinvisible[id])
            {
                open_bmenu(id)
               Chat(id, "^3[%s] ^4Tozi item veche e zakupen ot teb^1!", pcvar_string)
               return ITEM_IGNORE
            }
            
            if(cost < 8000)
            {
               open_bmenu(id)
               Chat(id, "^3[%s] ^4Nqmash dostatuchno pari^1!", pcvar_string)
               return ITEM_IGNORE
            }
            
            cs_get_money(id, 8000, 1)
            set_user_footsteps(id, 1)
            set_user_rendering(id, kRenderFxNone, 255, 255, 255, kRenderTransAlpha, 80)
            client_cmd(id, "spk ^"weapons/mine_deploy mine_charge mine_activate^"")
            Chat(id, "^3[%s] ^4Ti poluchi sposobnost^1: ^3Invisible^1!", pcvar_string)
            isinvisible[id] = true
         }
         case 3:
         {
            if(cost < 10000)
            {
               open_bmenu(id)
               Chat(id, "^3[%s] ^4Nqmash dostatuchno pari^1!", pcvar_string)
               return ITEM_IGNORE
            }
            
            cs_get_money(id, 10000, 1)
            client_cmd(id, "items/gunpickup2")
            Chat(id, "^3[%s] ^4Ti poluchi weapon^1: ^3Super knife ^1[^4x3 dmg^1]^1!", pcvar_string)
            superknife[id] = true
            event_curweapon(id)
         }
      }      
   }
   
   menu_destroy(menu)
   return ITEM_IGNORE
}
public iDrop(id)
{
   if(task_exists(id))
   {
      remove_task(id)
      Chat(id, "^4[Clip] ^3Unlimited clip ^1- ^4izkliucheno^1!")
      ulimitedclip[id] = false 
   }
}
public event_curweapon(id)
{
   if(superknife[id])
   {
      set_pev(id, pev_viewmodel2, v_dragon_barlog9)
      set_pev(id, pev_weaponmodel2, "")
   }
}
public event_deathmsg()
{
   new victim = read_data(2)
   if(isinvisible[victim]) set_user_rendering(victim, _, 0, 0, 0, _, 0)
}
public forward_PreThink(ent)
{
   if(!is_user_alive(ent) || !norecoil[ent]) 
      return 
      
   set_pev(ent, pev_punchangle, {0.0, 0.0, 0.0})
}
stock cs_get_money(id, money, icon)
{
   return cs_set_user_money(id, cost - money, icon)
} 

Отговори

Върни се в “AMX Mod (X)”

  • Информация
  • Кой е на линия

    Потребители, разглеждащи този форум: Няма регистрирани потребители и 0 госта