Всем привет|| помогите пожалуйста

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
8
Реакции
-10
Неверный раздел форума
Помогите сделать что бы в магазине можно было брать Deagle 1 раз в 5 раундов очень надо!

C++:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <fakemeta>

#define PLUGIN "[DR]Shop"
#define VERSION "1.0"
#define AUTHOR "StudenT"

#define ADMIN_FLAG            ADMIN_LEVEL_H
#define SKIDKA_PROCENT        get_pcvar_num(skidka_procent)
#define HEGRENADE             get_pcvar_num(cost_hegrenade)
#define ALLGRENADE            get_pcvar_num(cost_allgrenade)
#define HEALTH                get_pcvar_num(cost_health)
#define GRAVITY               get_pcvar_num(cost_gravity)
#define SPEED                 get_pcvar_num(cost_speed)
#define RENDERING             get_pcvar_num(cost_rendering)
#define TWO_JUMP              get_pcvar_num(cost_two_jump)
#define SHIELD                get_pcvar_num(cost_shield)
#define DEAGLE                get_pcvar_num(cost_deagle)
#define MP5                   get_pcvar_num(cost_mp5)
#define NIGHTVISION           get_pcvar_num(cost_nightvision)
#define SILENT                get_pcvar_num(cost_silent)
#define INVIS                 get_pcvar_num(cost_invis)
#define USKORITEL             get_pcvar_num(cost_uskoritel)
#define FL_WATERJUMP          (1<<11)
#define FL_ONGROUND           (1<<9)

new skidka_procent

new shop_enable
new cost_hegrenade
new cost_allgrenade
new cost_health
new cost_gravity
new cost_speed
new cost_rendering
new cost_two_jump
new cost_shield
new cost_deagle
new cost_mp5
new cost_nightvision
new cost_silent
new cost_invis
new cost_uskoritel

new HeGrenade[33]
new AllGrenade[33]
new Health[33]
new Gravity[33]
new Speed[33]
new Rendering[33]
new Two_Jump[33]
new Shield[33]
new Deagle[33]
new Mp5[33]
new NightVision[33]
new Silent[33]
new Invis[33]
new Uskoritel[33]

new gSpeed[33]
new Twojump[33]
new jumpnum[33]
new bool:dojump[33] = false
new Bigspeed[33]

new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
new keys2 = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_0

public plugin_init(){
     register_plugin(PLUGIN, VERSION, AUTHOR)
     register_menu("ShopMenu_1", keys, "ShopMenu_1_Func")
     register_clcmd("say /drshops", "Shop")
     register_menu("ShopMenu_2", keys2, "ShopMenu_2_Func")
     RegisterHam(Ham_Spawn, "player", "PlayerSpawn",1)
     register_event("CurWeapon", "WeaponChange", "be", "1=1")
     register_forward(FM_PlayerPostThink, "PostThink")
     register_forward(FM_PlayerPreThink, "PreThink")
     shop_enable = register_cvar("drshop_enable", "1")
     cost_hegrenade = register_cvar("drshop_hegrenade", "")
     cost_allgrenade = register_cvar("drshop_allgrenade", "")
     cost_health = register_cvar("drshop_health", "")
     cost_gravity = register_cvar("drshop_gravity", "")
     cost_speed = register_cvar("drshop_speed", "")
     cost_rendering = register_cvar("drshop_rendering", "")
     cost_two_jump = register_cvar("drshop_two_jump", "")
     cost_shield = register_cvar("drshop_shield", "")
     cost_deagle = register_cvar("drshop_deagle", "")
     cost_mp5 = register_cvar("drshop_mp5", "")
     cost_nightvision = register_cvar("drshop_nightvision", "")
     cost_silent = register_cvar("drshop_silent", "")
     cost_invis = register_cvar("drshop_invis", "")
     cost_uskoritel = register_cvar("drshop_uskoritel", "")
     skidka_procent = register_cvar("drshop_skidka_procent", "")
     register_dictionary("drshop_lang.txt")
}

public plugin_cfg(){
     new configsdir[128]
     get_localinfo("amxx_configsdir", configsdir, 127)
     return server_cmd("exec %s/shop.cfg", configsdir)
}

public WeaponChange(id){
     if(gSpeed[id]){
          set_user_maxspeed(id, 400.0)
     }
}

public PlayerSpawn(id){
     if(is_user_alive(id)){
          HeGrenade[id] = 0
          AllGrenade[id] = 0
          Health[id] = 0
          Gravity[id] = 0
          Speed[id] = 0
          Rendering[id] = 0
          Two_Jump[id] = 0
          Shield[id] = 0
          Deagle[id] = 0
          Mp5[id] = 0
          NightVision[id] = 0
          Silent[id] = 0
          Invis[id] = 0
          Uskoritel[id] = 0
          Bigspeed[id] = false
          gSpeed[id] = false
          Twojump[id] = false
     }
}

public Render(id){
     new Red = random_num(0, 255)
     new Green = random_num(0, 255)
     new Blue = random_num(0, 255)
     set_user_rendering(id, kRenderFxGlowShell, Red, Green, Blue, kRenderNormal, 0)
}

public Shop(id){
     if(!(get_pcvar_num(shop_enable)))
          return PLUGIN_CONTINUE

     new my_money = cs_get_user_money(id)
     static shop_menu[650], len
     len = 0
     if(get_user_flags(id) & ADMIN_FLAG){
     len = formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_TITLE_SKIDKA", my_money, SKIDKA_PROCENT)
     }else{
     len = formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_TITLE_NOSKIDKA", my_money)
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < HEGRENADE - (HEGRENADE / 100 * SKIDKA_PROCENT) || HeGrenade[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_1", HEGRENADE - (HEGRENADE / 100 * SKIDKA_PROCENT))
               keys &= ~MENU_KEY_1
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_1_2", HEGRENADE - (HEGRENADE / 100 * SKIDKA_PROCENT))
               keys |= MENU_KEY_1
          }
     }else{
          if(!is_user_alive(id) || my_money < HEGRENADE || HeGrenade[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_1", HEGRENADE)
               keys &= ~MENU_KEY_1
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_1_2", HEGRENADE)
               keys |= MENU_KEY_1
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < ALLGRENADE - (ALLGRENADE / 100 * SKIDKA_PROCENT) || AllGrenade[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_2", ALLGRENADE - (ALLGRENADE / 100 * SKIDKA_PROCENT))
               keys &= ~MENU_KEY_2
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_2_2", ALLGRENADE - (ALLGRENADE / 100 * SKIDKA_PROCENT))
               keys |= MENU_KEY_2
          }
     }else{
          if(!is_user_alive(id) || my_money < ALLGRENADE || AllGrenade[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_2", ALLGRENADE)
               keys &= ~MENU_KEY_2
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_2_2", ALLGRENADE)
               keys |= MENU_KEY_2
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < HEALTH - (HEALTH / 100 * SKIDKA_PROCENT) || Health[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_3", HEALTH - (HEALTH / 100 * SKIDKA_PROCENT))
               keys &= ~MENU_KEY_3
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_3_2", HEALTH - (HEALTH / 100 * SKIDKA_PROCENT))
               keys |= MENU_KEY_3
          }
     }else{
          if(!is_user_alive(id) || my_money < HEALTH || Health[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_3", HEALTH)
               keys &= ~MENU_KEY_3
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_3_2", HEALTH)
               keys |= MENU_KEY_3
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < GRAVITY - (GRAVITY / 100 * SKIDKA_PROCENT) || Gravity[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_4", GRAVITY - (GRAVITY / 100 * SKIDKA_PROCENT))
               keys &= ~MENU_KEY_4
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_4_2", GRAVITY - (GRAVITY / 100 * SKIDKA_PROCENT))
               keys |= MENU_KEY_4
          }
     }else{
          if(!is_user_alive(id) || my_money < GRAVITY || Gravity[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_4", GRAVITY)
               keys &= ~MENU_KEY_4
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_4_2", GRAVITY)
               keys |= MENU_KEY_4
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < SPEED - (SPEED / 100 * SKIDKA_PROCENT) || Speed[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_5", SPEED - (SPEED / 100 * SKIDKA_PROCENT))
               keys &= ~MENU_KEY_5
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_5_2", SPEED - (SPEED / 100 * SKIDKA_PROCENT))
               keys |= MENU_KEY_5
          }
     }else{
          if(!is_user_alive(id) || my_money < SPEED || Speed[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_5", SPEED)
               keys &= ~MENU_KEY_5
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_5_2", SPEED)
               keys |= MENU_KEY_5
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < RENDERING - (RENDERING / 100 * SKIDKA_PROCENT) || Rendering[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_6", RENDERING - (RENDERING / 100 * SKIDKA_PROCENT))
               keys &= ~MENU_KEY_6
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_6_2", RENDERING - (RENDERING / 100 * SKIDKA_PROCENT))
               keys |= MENU_KEY_6
          }
     }else{
          if(!is_user_alive(id) || my_money < RENDERING || Rendering[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_6", RENDERING)
               keys &= ~MENU_KEY_6
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_6_2", RENDERING)
               keys |= MENU_KEY_6
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < TWO_JUMP - (TWO_JUMP / 100 * SKIDKA_PROCENT) || Two_Jump[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_7", TWO_JUMP - (TWO_JUMP / 100 * SKIDKA_PROCENT))
               keys &= ~MENU_KEY_7
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_7_2", TWO_JUMP - (TWO_JUMP / 100 * SKIDKA_PROCENT))
               keys |= MENU_KEY_7
          }
     }else{
          if(!is_user_alive(id) || my_money < TWO_JUMP || Two_Jump[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_7", TWO_JUMP)
               keys &= ~MENU_KEY_7
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_7_2", TWO_JUMP)
               keys |= MENU_KEY_7
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < SHIELD - (SHIELD / 100 * SKIDKA_PROCENT) || Shield[id] >= 1 || get_user_team(id) != 2){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_ITEM_8", SHIELD - (SHIELD / 100 * SKIDKA_PROCENT))
               keys &= ~MENU_KEY_8
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_ITEM_8_2", SHIELD - (SHIELD / 100 * SKIDKA_PROCENT))
               keys |= MENU_KEY_8
          }
     }else{
          if(!is_user_alive(id) || my_money < SHIELD || Shield[id] >= 1 || get_user_team(id) != 2){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_ITEM_8", SHIELD)
               keys &= ~MENU_KEY_8
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_ITEM_8_2", SHIELD)
               keys |= MENU_KEY_8
          }
     }

     len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_NEXT")
     keys |= MENU_KEY_9

     len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L", LANG_PLAYER, "MENU_ITEM_EXIT")
     keys |= MENU_KEY_0

     show_menu(id, keys, shop_menu, -1, "ShopMenu_1")
     return PLUGIN_HANDLED
}
             
public ShopMenu_1_Func(id, key){
     new my_money = cs_get_user_money(id)
     switch(key){
          case 0:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < HEGRENADE - (HEGRENADE / 100 * SKIDKA_PROCENT) || HeGrenade[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (HEGRENADE - (HEGRENADE / 100 * SKIDKA_PROCENT)))
                         give_item(id, "weapon_hegrenade")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_1")
                         HeGrenade[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < HEGRENADE || HeGrenade[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - HEGRENADE)
                         give_item(id, "weapon_hegrenade")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_1")
                         HeGrenade[id]++
                    }
               }
          }
             
          case 1:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < ALLGRENADE - (ALLGRENADE / 100 * SKIDKA_PROCENT) || AllGrenade[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (ALLGRENADE - (ALLGRENADE / 100 * SKIDKA_PROCENT)))
                         give_item(id,"weapon_hegrenade")
                         give_item(id,"weapon_flashbang")
                         give_item(id,"weapon_flashbang")
                         give_item(id,"weapon_smokegrenade")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_2")
                         AllGrenade[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < ALLGRENADE || AllGrenade[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - ALLGRENADE)
                         give_item(id,"weapon_hegrenade")
                         give_item(id,"weapon_flashbang")
                         give_item(id,"weapon_flashbang")
                         give_item(id,"weapon_smokegrenade")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_2")
                         AllGrenade[id]++
                    }
               }
          }

          case 2:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < HEALTH - (HEALTH / 100 * SKIDKA_PROCENT) || Health[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (HEALTH - (HEALTH / 100 * SKIDKA_PROCENT)))
                         set_user_health(id, get_user_health(id) + 100)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_3")
                         Health[id]++            
                    }
               }else{
                    if(!is_user_alive(id) || my_money < HEALTH || Health[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - HEALTH)
                         set_user_health(id, get_user_health(id) + 100)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_3")
                         Health[id]++    
                    }
               }
          }

          case 3:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < GRAVITY - (GRAVITY / 100 * SKIDKA_PROCENT) || Gravity[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (GRAVITY - (GRAVITY / 100 * SKIDKA_PROCENT)))
                         set_user_gravity(id, 0.4)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_4")
                         Gravity[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < GRAVITY || Gravity[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - GRAVITY)
                         set_user_gravity(id, 0.4)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_4")
                         Gravity[id]++
                    }
               }
          }

          case 4:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < SPEED - (SPEED / 100 * SKIDKA_PROCENT) || Speed[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (SPEED - (SPEED / 100 * SKIDKA_PROCENT)))
                         set_user_maxspeed(id, 400.0)
                         gSpeed[id] = true
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_5")
                         Speed[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < SPEED || Speed[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - SPEED)
                         set_user_maxspeed(id, 400.0)
                         gSpeed[id] = true
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_5")
                         Speed[id]++
                    }
               }
          }

          case 5:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < RENDERING - (RENDERING / 100 * SKIDKA_PROCENT) || Rendering[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (RENDERING - (RENDERING / 100 * SKIDKA_PROCENT)))
                         Render(id)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_6")
                         Rendering[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < RENDERING || Rendering[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - RENDERING)
                         Render(id)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_6")
                         Rendering[id]++
                    }
               }
          }

          case 6:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < TWO_JUMP - (TWO_JUMP / 100 * SKIDKA_PROCENT) || Two_Jump[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (TWO_JUMP - (TWO_JUMP / 100 * SKIDKA_PROCENT)))
                         Twojump[id] = true
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_7")
                         Two_Jump[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < TWO_JUMP || Two_Jump[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - TWO_JUMP)
                         Twojump[id] = true
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_7")
                         Two_Jump[id]++
                    }
               }
          }

          case 7:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < SHIELD - (SHIELD / 100 * SKIDKA_PROCENT) || Shield[id] >= 1 || get_user_team(id) != 2){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (SHIELD - (SHIELD / 100 * SKIDKA_PROCENT)))
                         give_item(id, "weapon_shield")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_8")
                         Shield[id]++      
                    }
               }else{
                    if(!is_user_alive(id) || my_money < SHIELD || Shield[id] >= 1 || get_user_team(id) != 2){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - SHIELD)
                         give_item(id, "weapon_shield")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_8")
                         Shield[id]++
                    }
               }
          }

          case 8: Shop2(id)
     }
     return PLUGIN_HANDLED
}

public Shop2(id){
     if(!(get_pcvar_num(shop_enable)))
          return PLUGIN_CONTINUE

     new my_money = cs_get_user_money(id)
     static shop_menu[650], len
     len = 0
     if(get_user_flags(id) & ADMIN_FLAG){
     len = formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_TITLE_SKIDKA", my_money, SKIDKA_PROCENT)
     }else{
     len = formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_TITLE_NOSKIDKA", my_money)
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < DEAGLE - (DEAGLE / 100 * SKIDKA_PROCENT) || Deagle[id] >= 1 || get_user_team(id) != 2){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_1_1", DEAGLE - (DEAGLE / 100 * SKIDKA_PROCENT))
               keys2 &= ~MENU_KEY_1
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_1_1_2", DEAGLE - (DEAGLE / 100 * SKIDKA_PROCENT))
               keys2 |= MENU_KEY_1
          }
     }else{
          if(!is_user_alive(id) || my_money < DEAGLE || Deagle[id] >= 1 || get_user_team(id) != 2){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_1_1", DEAGLE)
               keys2 &= ~MENU_KEY_1
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_1_1_2", DEAGLE)
               keys2 |= MENU_KEY_1
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < MP5 - (MP5 / 100 * SKIDKA_PROCENT) || Mp5[id] >= 1 || get_user_team(id) != 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_2_2_2", MP5 - (MP5 / 100 * SKIDKA_PROCENT))
               keys2 &= ~MENU_KEY_2
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_2_2_2_2", MP5 - (MP5 / 100 * SKIDKA_PROCENT))
               keys2 |= MENU_KEY_2
          }
     }else{
          if(!is_user_alive(id) || my_money < MP5 || Mp5[id] >= 1 || get_user_team(id) != 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_2_2_2", MP5)
               keys2 &= ~MENU_KEY_2
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_2_2_2_2", MP5)
               keys2 |= MENU_KEY_2
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < NIGHTVISION - (NIGHTVISION / 100 * SKIDKA_PROCENT) || NightVision[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_3_3", NIGHTVISION - (NIGHTVISION / 100 * SKIDKA_PROCENT))
               keys2 &= ~MENU_KEY_3
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_3_3_2", NIGHTVISION - (NIGHTVISION / 100 * SKIDKA_PROCENT))
               keys2 |= MENU_KEY_3
          }
     }else{
          if(!is_user_alive(id) || my_money < NIGHTVISION || NightVision[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_3_3", NIGHTVISION)
               keys2 &= ~MENU_KEY_3
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_3_3_2", NIGHTVISION)
               keys2 |= MENU_KEY_3
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < SILENT - (SILENT / 100 * SKIDKA_PROCENT) || Silent[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_4_4", SILENT - (SILENT / 100 * SKIDKA_PROCENT))
               keys2 &= ~MENU_KEY_4
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_4_4_2", SILENT - (SILENT / 100 * SKIDKA_PROCENT))
               keys2 |= MENU_KEY_4
          }
     }else{
          if(!is_user_alive(id) || my_money < SILENT || Silent[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_4_4", SILENT)
               keys2 &= ~MENU_KEY_4
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_4_4_2", SILENT)
               keys2 |= MENU_KEY_4
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < INVIS - (INVIS / 100 * SKIDKA_PROCENT) || Invis[id] >= 1 || get_user_team(id) != 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_5_5", INVIS - (INVIS / 100 * SKIDKA_PROCENT))
               keys2 &= ~MENU_KEY_5
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_5_5_2", INVIS - (INVIS / 100 * SKIDKA_PROCENT))
               keys2 |= MENU_KEY_5
          }
     }else{
          if(!is_user_alive(id) || my_money < INVIS || Invis[id] >= 1 || get_user_team(id) != 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_5_5", INVIS)
               keys2 &= ~MENU_KEY_5
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n", LANG_PLAYER, "MENU_ITEM_5_5_2", INVIS)
               keys2 |= MENU_KEY_5
          }
     }

     if(get_user_flags(id) & ADMIN_FLAG){
          if(!is_user_alive(id) || my_money < USKORITEL - (USKORITEL / 100 * SKIDKA_PROCENT) || Uskoritel[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_ITEM_6_6", USKORITEL - (USKORITEL / 100 * SKIDKA_PROCENT))
               keys2 &= ~MENU_KEY_6
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_ITEM_6_6_2", USKORITEL - (USKORITEL / 100 * SKIDKA_PROCENT))
               keys2 |= MENU_KEY_6
          }
     }else{
          if(!is_user_alive(id) || my_money < USKORITEL || Uskoritel[id] >= 1){
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_ITEM_6_6", USKORITEL)
               keys2 &= ~MENU_KEY_6
          }else{
               len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L^n^n", LANG_PLAYER, "MENU_ITEM_6_6_2", USKORITEL)
               keys2 |= MENU_KEY_6
          }
     }

     len += formatex(shop_menu[len], charsmax(shop_menu) - len, "%L", LANG_PLAYER, "MENU_ITEM_BACK")
     keys2 |= MENU_KEY_0

     show_menu(id, keys2, shop_menu, -1, "ShopMenu_2")
     return PLUGIN_HANDLED
}

public ShopMenu_2_Func(id, key){
     new my_money = cs_get_user_money(id)
     switch(key){
          case 0:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < DEAGLE - (DEAGLE / 100 * SKIDKA_PROCENT) || Deagle[id] >= 1 || get_user_team(id) != 2){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (DEAGLE - (DEAGLE / 100 * SKIDKA_PROCENT)))
                         give_item(id, "weapon_deagle")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_1_1")
                         Deagle[id]++        
                    }
               }else{
                    if(!is_user_alive(id) || my_money < DEAGLE || Deagle[id] >= 1 || get_user_team(id) != 2){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - DEAGLE)
                         give_item(id, "weapon_deagle")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_1_1")
                         Deagle[id]++  
                    }
               }
          }

          case 1:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < MP5 - (MP5 / 100 * SKIDKA_PROCENT) || Mp5[id] >= 1 || get_user_team(id) != 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (MP5 - (MP5 / 100 * SKIDKA_PROCENT)))
                         give_item(id, "weapon_mp5navy")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_2_2")
                         Mp5[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < MP5 || Mp5[id] >= 1 || get_user_team(id) != 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - MP5)
                         give_item(id, "weapon_mp5navy")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_2_2")
                         Mp5[id]++
                    }
               }
          }

          case 2:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < NIGHTVISION - (NIGHTVISION / 100 * SKIDKA_PROCENT) || NightVision[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (NIGHTVISION - (NIGHTVISION / 100 * SKIDKA_PROCENT)))
                         cs_set_user_nvg(id, 1)
                         client_cmd(id, "nightvision")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_3_3")
                         NightVision[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < NIGHTVISION || NightVision[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - NIGHTVISION)
                         cs_set_user_nvg(id, 1)
                         client_cmd(id, "nightvision")
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_3_3")
                         NightVision[id]++
                    }
               }
          }

          case 3:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < SILENT - (SILENT / 100 * SKIDKA_PROCENT) || Silent[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (SILENT - (SILENT / 100 * SKIDKA_PROCENT)))
                         set_user_footsteps(id, 1)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_4_4")
                         Silent[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < SILENT || Silent[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - SILENT)
                         set_user_footsteps(id, 1)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_4_4")
                         Silent[id]++
                    }
               }
          }

          case 4:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < INVIS - (INVIS / 100 * SKIDKA_PROCENT) || Invis[id] >= 1 || get_user_team(id) != 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (INVIS - (INVIS / 100 * SKIDKA_PROCENT)))
                         set_user_rendering(id, kRenderFxNone, 0,0,0, kRenderTransAdd, 0)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_5_5")
                         Invis[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < INVIS || Invis[id] >= 1 || get_user_team(id) != 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - INVIS)
                         set_user_rendering(id, kRenderFxNone, 0,0,0, kRenderTransAdd, 0)
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_5_5")
                         Invis[id]++
                    }
               }
          }

          case 5:{
               if(get_user_flags(id) & ADMIN_FLAG){
                    if(!is_user_alive(id) || my_money < USKORITEL - (USKORITEL / 100 * SKIDKA_PROCENT) || Uskoritel[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - (USKORITEL - (USKORITEL / 100 * SKIDKA_PROCENT)))
                         Bigspeed[id] = true
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_6_6")
                         Uskoritel[id]++
                    }
               }else{
                    if(!is_user_alive(id) || my_money < USKORITEL || Uskoritel[id] >= 1){
                         return PLUGIN_CONTINUE
                    }else{
                         cs_set_user_money(id, my_money - USKORITEL)
                         Bigspeed[id] = true
                         Color_Print(id, "%L", LANG_PLAYER, "MSG_ITEM_6_6")
                         Uskoritel[id]++
                    }
               }
          }

          case 9: Shop(id)
     }
     return PLUGIN_HANDLED
}

public PreThink(id)
{
     if(Twojump[id])
     {
          if(!is_user_alive(id)) return PLUGIN_CONTINUE
          new nbut = pev(id, pev_button)
          new obut = pev(id, pev_oldbuttons)
          if((nbut & IN_JUMP) && !(pev(id, pev_flags) & FL_ONGROUND) && !(obut & IN_JUMP))
          {
               if(jumpnum[id] < 1)
               {
                    dojump[id] = true
                    jumpnum[id]++
                    return PLUGIN_CONTINUE
               }
          }
          if((nbut & IN_JUMP) && (pev(id, pev_flags) & FL_ONGROUND))
          {
               jumpnum[id] = 0
               return PLUGIN_CONTINUE
          }
     }
     return PLUGIN_CONTINUE
}

public PostThink(id)
{
     if(Twojump[ id ])
     {
          if(!is_user_alive(id)) return PLUGIN_CONTINUE
          if(dojump[id] == true)
          {
               new Float:velocity[3]
               pev(id, pev_velocity, velocity)
               velocity[2] = random_float(295.0,305.0)
               set_pev(id, pev_velocity, velocity)
               dojump[id] = false
               return PLUGIN_CONTINUE
          }
     }    
     return PLUGIN_CONTINUE
}

public client_PreThink(id)
{
     if(!Bigspeed[id])
     return PLUGIN_CONTINUE

     entity_set_float(id, EV_FL_fuser2, 0.0)

     if(entity_get_int(id, EV_INT_button) & 2)
     {
          new flags = entity_get_int(id, EV_INT_flags)
          if(flags & FL_WATERJUMP)
               return PLUGIN_CONTINUE
          if(entity_get_int(id, EV_INT_waterlevel) >= 2)
               return PLUGIN_CONTINUE
          if(!(flags & FL_ONGROUND))
               return PLUGIN_CONTINUE

          new Float:vecVelocity[3]

          entity_get_vector(id, EV_VEC_velocity, vecVelocity)

          vecVelocity[0] *= 1.15;
          vecVelocity[1] *= 1.15;

          entity_set_vector(id, EV_VEC_velocity, vecVelocity);
          entity_set_int(id, EV_INT_gaitsequence, 6)    // Play the Jump Animation
     }
     return PLUGIN_CONTINUE
}

stock Color_Print(const id, const input[], any:...)
{
     new count = 1, players[32]
     static msg[191]
     vformat(msg, 190, input, 3)
   
     replace_all(msg, 190, "!g", "^4") // Green Color
     replace_all(msg, 190, "!y", "^1") // Default Color
     replace_all(msg, 190, "!t", "^3") // Team Color
   
     if (id) players[0] = id; else get_players(players, count, "ch")
     {
          for (new i = 0; i < count; i++)
          {
               if (is_user_connected(players[i]))
               {
                    message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
                    write_byte(players[i]);
                    write_string(msg);
                    message_end();
               }
          }
     }
}
 

Вложения

d3m37r4

111111
Сообщения
1,451
Реакции
1,177
Помог
10 раз(а)
ifor14051997, ты когда тему создавал, зеленую табличку читал? Сверху которая.
Когда уже народ научится нормально создавать темы, банально даже заголовок не могут более информативный придумать.
 
Сообщения
1,042
Реакции
206
Предупреждения
1
Помог
6 раз(а)
RG_CSGameRules_RestartRound отлавшиваешь, записываешь в переменную. При рестарте не забудь обнулить переменную.
и на выдаче проверку на кол-вол раундов
 
Сообщения
1,042
Реакции
206
Предупреждения
1
Помог
6 раз(а)
ifor14051997, В этом разделе помогают сделать если были свои попытки сделать.
Нет попытки своей, значит в раздел покупок и там не сложные задачи помогают решать за бесплатно иногда.
 
Последнее редактирование модератором:
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу