Oleg
Пользователь
- Регистрация
- 17 Июн 2017
- Сообщения
- 85
- Симпатии
- 5
- Предупреждения
- 30
- Пол
- Мужской
ВИПКА работает на карте с приставками _de и _cs
В остальных отключается вип. Но мне надо, чтоб она включилась еще и на карте $2000$ и $7000$|
Капаясь в исходнике, нашёл вот такой код:
if(equali(mapname, "de_") || equali(mapname, "cs_"))
Я изменял вот так его:
if(equali(mapname, "de_") || mapname, "$_") || equali(mapname, "cs_"))
Что я только не делал, то приставку писал такую, то просто доллар, то полностью карту вписывал. Не помогает. Не работает.
Я в кодах не силён, поэтому прошу помощи вас.
Ниже будет предоставлен исходник custom_vip.sma
Есть и другие. (custom_оружие.sma)
Что бы вам не искать строчку ^ , то я в коде покрасил текст в цвет красный.
Или 156 строчка
Если нужен код целиком. Могу скинуть файл
В остальных отключается вип. Но мне надо, чтоб она включилась еще и на карте $2000$ и $7000$|
Капаясь в исходнике, нашёл вот такой код:
if(equali(mapname, "de_") || equali(mapname, "cs_"))
Я изменял вот так его:
if(equali(mapname, "de_") || mapname, "$_") || equali(mapname, "cs_"))
Что я только не делал, то приставку писал такую, то просто доллар, то полностью карту вписывал. Не помогает. Не работает.
Я в кодах не силён, поэтому прошу помощи вас.
Ниже будет предоставлен исходник custom_vip.sma
Есть и другие. (custom_оружие.sma)
Что бы вам не искать строчку ^ , то я в коде покрасил текст в цвет красный.
Или 156 строчка
Если нужен код целиком. Могу скинуть файл
// Copyright © 2015 Vaqtincha
/************************ V.I.P Custom Weapons *************************
*
* Last update:
* 05/12/2015
*
* Cmds:
* weaponmenu or (say /vipmenu) - Free guns menu
*
* Credits:
* - Safety1st - for plugin "Weapon Menu Hardcoded" (edited by me)
* - Eg@r4$il - for plugin "Admins are VIPs + grenades + kevlar" (edited by me)
* - ZETA [M|E|N] - for plugin "VSVipPrefix"
* - xPaw - for code "ScoreBoard "VIP" string"
* - ConnorMcLeod for plugin "Bullet Damage" and cstrike_pdatas
* - Subb98 for plugin "No fall damage"
* - MrBone - for pieces of advice
* - Patriot~ua~ - for ideas and testing
* - c-s.net.ua members
*
***********************************************************************/
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN_NAME "V.I.P Custom Weapons"
#define PLUGIN_VERSION "1.0.0"
#define PLUGIN_AUTHOR "Vaqtincha"
// macro; %1 - variable being modified, %2 - player id
#define CheckFlag(%1,%2) (%1 & (1 << (%2 & 31)))
#define SetFlag(%1,%2) (%1 |= (1 << (%2 & 31)))
#define ClearFlag(%1,%2) (%1 &= ~(1 << (%2 & 31)))
#define SetFlagConnected(%1) g_bConnected |= 1<<(%1 & 31)
#define ClearFlagConnected(%1) g_bConnected &= ~( 1<<(%1 & 31))
#define UserConnected(%1) (g_bConnected & 1<<(%1 & 31))
#define cs_get_user_hasprim(%1,%2) (get_pdata_cbase(%1, m_rgpPlayerItems_CBasePlayer[%2])>0)
#define fm_get_user_money(%1) get_pdata_int(%1, m_iAccount, XO_PLAYER)
#define fm_get_weapon_id(%1) get_pdata_int(%1, m_iId, XO_WEAPON)
#define fm_set_weapon_ammo(%1,%2) set_pdata_int(%1, m_iClip, %2, XO_WEAPON)
#if AMXX_VERSION_NUM < 183
#define HasShield(%1) (get_pdata_int(%1, m_iUserPrefs, XO_PLAYER) & m_bHasShield)
#else
#define HasShield(%1) get_pdata_bool(%1, m_bHasShield)
#endif
#define MAX_PLAYERS 32
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
#define ITEM_DEAGLE (1<<0)
#define ITEM_HE (1<<1)
#define ITEM_SMOKE (1<<2)
#define ITEM_FLASH (1<<3)
#define ITEM_AMMO (1<<4)
#define ITEM_ARMOR (1<<5)
#define ITEM_DEFUSER (1<<6)
new Trie:vipChannels
new g_iAlive[MAX_PLAYERS+1]
new bool:g_bAccess[MAX_PLAYERS+1]
new g_iPlayerPos[MAX_PLAYERS+1]
new g_iPlayerCol[MAX_PLAYERS+1]
new gbIsUsed, giCounter, g_bConnected, g_iMaxPlayers, target_map
new g_iKNFPluginId, g_iDGLPluginId, g_iM4A1PluginId, g_iAK47PluginId, g_iAWPPluginId
new g_iDGLGive, g_iM4A1Give, g_iAK47Give, g_iAWPGive
new g_iKNFReload, g_iDGLReload, g_iM4A1Reload, g_iAK47Reload, g_iAWPReload
new alw_round_eq, alw_round_fm, alw_round_m4ak, alw_round_awp, alw_round_buy
new vampire, vampire_max, hp_bonus, hp_bonus_hs, item_flags, delay, damager, droptype
new dmgcolors[3], scrtag, prefix, info, remove_limit, openmenu, nofall, recieved
new dglcost, m4cost, akcost, awpcost
static flagaccess, buyaccess
// Offsets
new const m_rgpPlayerItems_CBasePlayer[6] = {367, 368, ...}
#if AMXX_VERSION_NUM < 183
const m_bHasShield = 1<<24
const m_iUserPrefs = 510
#else
const m_bHasShield = 2043
#endif
const m_pNext = 42
const m_iClip = 51
const m_iId = 43
const XO_PLAYER = 5
const XO_WEAPON = 4
#if cellbits == 32
const m_iAccount = 115
#else
const m_iAccount = 140
#endif
const MENUKEYS = 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
const KEY_EXIT = 10
const PRIMARY_WEAPONS_BIT_SUM = 1<<CSW_SCOUT|1<<CSW_XM1014|1<<CSW_MAC10|1<<CSW_AUG|1<<CSW_UMP45
|1<<CSW_SG550|1<<CSW_GALIL|1<<CSW_FAMAS|1<<CSW_AWP|1<<CSW_MP5NAVY|1<<CSW_M249|1<<CSW_M3
|1<<CSW_M4A1|1<<CSW_TMP|1<<CSW_G3SG1|1<<CSW_SG552|1<<CSW_AK47|1<<CSW_P90
const SECONDARY_WEAPONS_BIT_SUM = 1<<CSW_P228|1<<CSW_ELITE|1<<CSW_FIVESEVEN|1<<CSW_USP|1<<CSW_GLOCK18|1<<CSW_DEAGLE
const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
// Max BP ammo for weapons
new const MAXBPAMMO[31] = { -1, 52, -1, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90,
90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, -1, 100
}
// Max clip for weapons
new const MAXCLIP[CSW_P90+1] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30,
35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50
}
// Ammo Type Names for weapons
new const AMMOTYPE[][] = { "", "357sig", "", "762nato", "", "buckshot", "", "45acp", "556nato",
"", "9mm", "57mm", "45acp", "556nato", "556nato", "556nato", "45acp", "9mm", "338magnum", "9mm",
"556natobox","buckshot", "556nato", "9mm", "762nato", "", "50ae", "556nato", "762nato", "", "57mm"
}
new const Float:g_flCoords[][] = { {0.50, 0.40},{0.56, 0.44},{0.60, 0.50},
{0.56, 0.56},{0.50, 0.60},{0.44, 0.56},{0.40, 0.50},{0.44, 0.44}
}
new const g_iColors[][] = { {0, 127, 255},/*blue*/{255, 127, 0},/*orange*/
{127, 0, 255},/*purple*/{0, 255, 0},/*green*/{255, 24, 119},/*pink*/
{228, 228, 228},/*gray*/{165, 42, 42},/*brown*/{255, 255, 0}/*yellow*/
}
new channels[8][] = {
"#Cstrike_Chat_CT","#Cstrike_Chat_T","#Cstrike_Chat_CT_Dead","#Cstrike_Chat_T_Dead",
"#Cstrike_Chat_Spec","#Cstrike_Chat_All","#Cstrike_Chat_AllDead","#Cstrike_Chat_AllSpec"
}
new newChannels[8][] = {
"^4(^1Counter-Terrorist^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^4(^1Terrorist^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^1*DEAD*^4(^1Counter-Terrorist^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^1*DEAD*^4(^1Terrorist^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^4(^1Spectator^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^4[^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^1*DEAD* ^4[^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^1*SPEC* ^4[^3V.I.P^4] ^3%s1^1 : ^4%s2"
}
public plugin_init()
{
new mapname[4]
get_mapname(mapname, charsmax(mapname))
if(equali(mapname, "ma_") || equali (mapname, "_de") || equali(mapname, "cs_"))
{
target_map = true
}
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_cvar("vip_custom_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
register_concmd("vip_custom_reloadcfg", "cmdReloadCfg", ADMIN_CFG)
register_dictionary ("vip_custom.txt" )
loadconfig()
g_iMaxPlayers = get_maxplayers()
RegisterHam(Ham_Spawn, "player", "playerspawn_post", 1)
RegisterHam(Ham_Killed, "player", "playerkilled_post", 1)
if(nofall) RegisterHam(Ham_TakeDamage, "player", "HamTakeDamagePlayerPre", 0)
if(scrtag) register_message( get_user_msgid("ScoreAttrib"), "msgScoreAttrib" )
if(damager) register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
if(prefix)
{
vipChannels = TrieCreate()
for (new i = 0; i < 8; i++)
{
TrieSetString(vipChannels, channels, newChannels)
}
register_message(get_user_msgid("SayText"), "messageSayText")
}
if(target_map)
{
// Cmds
register_clcmd( "weaponmenu", "MenuCommand" )
register_clcmd( "say /vipmenu", "MenuCommand" )
// Menu
register_menucmd( register_menuid( "WeaponMenu" ),MENUKEYS, "MenuHandler" )
register_menucmd( register_menuid( "BuyMenu" ),MENUKEYS, "MenuHandlerCustom" )
// Events
register_event( "HLTV", "Event_NewRound", "a", "1=0", "2=0" )
register_event( "TextMsg", "Event_NewGame", "a", "2=#Game_will_restart_in", "2=#Game_Commencing" )
if(vampire) register_event( "DeathMsg", "Event_DeathMsg", "a")
if(remove_limit) register_event( "BarTime", "event_bomb_planting", "be", "1=3")
}
}
public cmdReloadCfg(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
set_task(0.2, "delayed_load")
return PLUGIN_HANDLED
}
public delayed_load()
{
item_flags = 0
loadconfig()
if( g_iKNFPluginId > 0 && g_iKNFReload > 0)
{
callfunc_begin_i(g_iKNFReload, g_iKNFPluginId)
callfunc_end()
}
if( g_iDGLPluginId > 0 && g_iDGLReload > 0)
{
callfunc_begin_i(g_iDGLReload, g_iDGLPluginId)
callfunc_end()
}
if(g_iM4A1PluginId > 0 && g_iM4A1Reload > 0)
{
callfunc_begin_i(g_iM4A1Reload, g_iM4A1PluginId)
callfunc_end()
}
if(g_iAK47PluginId > 0 && g_iAK47Reload > 0)
{
callfunc_begin_i(g_iAK47Reload, g_iAK47PluginId)
callfunc_end()
}
if(g_iAWPPluginId > 0 && g_iAWPReload > 0)
{
callfunc_begin_i(g_iAWPReload, g_iAWPPluginId)
callfunc_end()
}
}
public loadconfig()
{
new ConfigFile[64], szMsg[128] // "addons/amxmodx/configs/vip_custom.ini" 37
get_localinfo("amxx_configsdir", ConfigFile, charsmax(ConfigFile))
add(ConfigFile, charsmax(ConfigFile), "/vip_custom.ini")
if( !file_exists(ConfigFile) )
{
formatex( szMsg, charsmax(szMsg), "%s Config File Not Found!", PLUGIN_NAME )
set_fail_state(szMsg)
return
}
new fp = fopen(ConfigFile, "rt")
if( fp )
{
new Datas[86], Setting[32], Value[15]
while( !feof(fp) )
{
fgets(fp, Datas, charsmax(Datas))
trim(Datas)
if(!Datas[0] || Datas[0] == ';' || Datas[0] == '#' || Datas[0] == '/' || Datas[0] == '[')
{
continue
}
new Sign[3]
parse(Datas, Setting, charsmax(Setting), Sign, charsmax(Sign), Value, charsmax(Value))
if( equali(Setting, "flag_access"))
{
flagaccess = read_flags(Value)
}else if( equali(Setting, "buy_access")){
buyaccess = read_flags(Value)
}else if( equali(Setting, "give_item_flags"))
{
if (containi(Value, "p") != -1)
{
item_flags |= ITEM_DEAGLE
}
if (containi(Value, "h") != -1)
{
item_flags |= ITEM_HE
}
if (containi(Value, "s") != -1)
{
item_flags |= ITEM_SMOKE
}
if (containi(Value, "f") != -1)
{
item_flags |= ITEM_FLASH
}
if (containi(Value, "a") != -1)
{
item_flags |= ITEM_AMMO
}
if (containi(Value, "v") != -1)
{
item_flags |= ITEM_ARMOR
}
if (containi(Value, "d") != -1)
{
item_flags |= ITEM_DEFUSER
}
}else if( equali(Setting, "allowed_round_equip")){
alw_round_eq = str_to_num(Value)
}else if( equali(Setting, "vip_tag")){
scrtag = str_to_num(Value) ? true : false
}else if( equali(Setting, "vip_prefix")){
prefix = str_to_num(Value) ? true : false
}else if( equali(Setting, "vip_info")){
info = str_to_num(Value) ? true : false
}else if( equali(Setting, "drop_type")){
droptype = str_to_num(Value)
}else if( equali(Setting, "no_fall_damage")){
nofall = str_to_num(Value) ? true : false
}else if( equali(Setting, "remove_limit")){
remove_limit = str_to_num(Value) ? true : false
}else if( equali(Setting, "bullet_damage")){
damager = str_to_num(Value)
}else if( equali(Setting, "bullet_damage_recieved")){
recieved = str_to_num(Value) ? true : false
}else if( equali(Setting, "bullet_damage_color")){
new red[10], green[10], blue[10]
parse(Value, red, charsmax(red), green, charsmax(green), blue, charsmax(blue))
dmgcolors[0] = str_to_num(red)
dmgcolors[1] = str_to_num(green)
dmgcolors[2] = str_to_num(blue)
}else if( equali(Setting, "vampire")){
vampire = str_to_num(Value) ? true : false
}else if( equali(Setting, "vampire_max_hp")){
vampire_max = str_to_num(Value)
}else if( equali(Setting, "vampire_hp")){
hp_bonus = str_to_num(Value)
}else if( equali(Setting, "vampire_hp_hs")){
hp_bonus_hs = str_to_num(Value)
}else if( equali(Setting, "open_menu")){
openmenu = str_to_num(Value) ? true : false
}else if( equali(Setting, "close_delay")){
delay = str_to_num(Value)
}else if( equali(Setting, "allowed_round_famas")){
alw_round_fm = str_to_num(Value)
}else if( equali(Setting, "allowed_round_m4ak")){
alw_round_m4ak = str_to_num(Value)
}else if( equali(Setting, "allowed_round_awp")){
alw_round_awp = str_to_num(Value)
}else if( equali(Setting, "allowed_round_buymenu")){
alw_round_buy = str_to_num(Value)
}else if( equali(Setting, "deagle_cost")){
dglcost = str_to_num(Value)
}else if( equali(Setting, "m4a1_cost")){
m4cost = str_to_num(Value)
}else if( equali(Setting, "ak47_cost")){
akcost = str_to_num(Value)
}else if( equali(Setting, "awp_cost")){
awpcost = str_to_num(Value)
}
}
formatex( szMsg, charsmax(szMsg), "%s Config Successfully Loaded!", PLUGIN_NAME )
server_print(szMsg)
}
}
public plugin_cfg()
{
g_iKNFPluginId = is_plugin_loaded("V.I.P Custom KNIFE")
if( g_iKNFPluginId > 0 )
{
g_iKNFReload = get_func_id("loadconfig", g_iKNFPluginId)
}
g_iDGLPluginId = is_plugin_loaded("V.I.P Custom DEAGLE")
if( g_iDGLPluginId > 0 )
{
g_iDGLGive = get_func_id("buyCMD", g_iDGLPluginId)
g_iDGLReload = get_func_id("loadconfig", g_iDGLPluginId)
}
g_iM4A1PluginId = is_plugin_loaded("V.I.P Custom M4A1")
if( g_iM4A1PluginId > 0 )
{
g_iM4A1Give = get_func_id("buyCMD", g_iM4A1PluginId)
g_iM4A1Reload = get_func_id("loadconfig", g_iM4A1PluginId)
}
g_iAK47PluginId = is_plugin_loaded("V.I.P Custom AK-47")
if( g_iAK47PluginId > 0 )
{
g_iAK47Give = get_func_id("buyCMD", g_iAK47PluginId)
g_iAK47Reload = get_func_id("loadconfig", g_iAK47PluginId)
}
g_iAWPPluginId = is_plugin_loaded("V.I.P Custom AWP")
if( g_iAWPPluginId > 0 )
{
g_iAWPGive = get_func_id("buyCMD", g_iAWPPluginId)
g_iAWPReload = get_func_id("loadconfig", g_iAWPPluginId)
}
}
public client_putinserver(id)
{
g_iAlive[id] = 0
g_bAccess[id] = get_user_flags(id) & flagaccess ? true : false
if(info)
{
set_task(1.0, "vip_connected", id)
if(target_map)
{
set_task(30.0, "vip_help", id)
}
}
if(!is_user_hltv(id))
{
SetFlagConnected(id)
}
}
public client_disconnect(id)
{
ClearFlagConnected(id)
}
public playerspawn_post(id)
{
g_iAlive[id] = is_user_alive(id)
g_bAccess[id] = get_user_flags(id) & flagaccess ? true : false
set_task(0.2, "GiveItem", id + 6910)
}
public playerkilled_post(id, attacker, shouldgib)
{
g_iAlive[id] = 0
}
public Event_NewRound()
{
gbIsUsed = 0
giCounter++
}
public Event_NewGame()
{
giCounter = 0
}
// Vip connected info/help
public vip_connected(id)
{
if(g_bAccess[id])
{
new name[32]
get_user_name(id, name, 31)
ChatColor(0, "%L", LANG_SERVER,"VIP_CONNECTED", name)
}
}
public vip_help(id)
{
if(g_bAccess[id])
{
new name[32]
get_user_name(id, name, 31)
ChatColor(id, "%L", LANG_SERVER,"VIP_HELP", name)
}
}
/************************ V.I.P Custom Weapons *************************
*
* Last update:
* 05/12/2015
*
* Cmds:
* weaponmenu or (say /vipmenu) - Free guns menu
*
* Credits:
* - Safety1st - for plugin "Weapon Menu Hardcoded" (edited by me)
* - Eg@r4$il - for plugin "Admins are VIPs + grenades + kevlar" (edited by me)
* - ZETA [M|E|N] - for plugin "VSVipPrefix"
* - xPaw - for code "ScoreBoard "VIP" string"
* - ConnorMcLeod for plugin "Bullet Damage" and cstrike_pdatas
* - Subb98 for plugin "No fall damage"
* - MrBone - for pieces of advice
* - Patriot~ua~ - for ideas and testing
* - c-s.net.ua members
*
***********************************************************************/
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN_NAME "V.I.P Custom Weapons"
#define PLUGIN_VERSION "1.0.0"
#define PLUGIN_AUTHOR "Vaqtincha"
// macro; %1 - variable being modified, %2 - player id
#define CheckFlag(%1,%2) (%1 & (1 << (%2 & 31)))
#define SetFlag(%1,%2) (%1 |= (1 << (%2 & 31)))
#define ClearFlag(%1,%2) (%1 &= ~(1 << (%2 & 31)))
#define SetFlagConnected(%1) g_bConnected |= 1<<(%1 & 31)
#define ClearFlagConnected(%1) g_bConnected &= ~( 1<<(%1 & 31))
#define UserConnected(%1) (g_bConnected & 1<<(%1 & 31))
#define cs_get_user_hasprim(%1,%2) (get_pdata_cbase(%1, m_rgpPlayerItems_CBasePlayer[%2])>0)
#define fm_get_user_money(%1) get_pdata_int(%1, m_iAccount, XO_PLAYER)
#define fm_get_weapon_id(%1) get_pdata_int(%1, m_iId, XO_WEAPON)
#define fm_set_weapon_ammo(%1,%2) set_pdata_int(%1, m_iClip, %2, XO_WEAPON)
#if AMXX_VERSION_NUM < 183
#define HasShield(%1) (get_pdata_int(%1, m_iUserPrefs, XO_PLAYER) & m_bHasShield)
#else
#define HasShield(%1) get_pdata_bool(%1, m_bHasShield)
#endif
#define MAX_PLAYERS 32
#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
#define ITEM_DEAGLE (1<<0)
#define ITEM_HE (1<<1)
#define ITEM_SMOKE (1<<2)
#define ITEM_FLASH (1<<3)
#define ITEM_AMMO (1<<4)
#define ITEM_ARMOR (1<<5)
#define ITEM_DEFUSER (1<<6)
new Trie:vipChannels
new g_iAlive[MAX_PLAYERS+1]
new bool:g_bAccess[MAX_PLAYERS+1]
new g_iPlayerPos[MAX_PLAYERS+1]
new g_iPlayerCol[MAX_PLAYERS+1]
new gbIsUsed, giCounter, g_bConnected, g_iMaxPlayers, target_map
new g_iKNFPluginId, g_iDGLPluginId, g_iM4A1PluginId, g_iAK47PluginId, g_iAWPPluginId
new g_iDGLGive, g_iM4A1Give, g_iAK47Give, g_iAWPGive
new g_iKNFReload, g_iDGLReload, g_iM4A1Reload, g_iAK47Reload, g_iAWPReload
new alw_round_eq, alw_round_fm, alw_round_m4ak, alw_round_awp, alw_round_buy
new vampire, vampire_max, hp_bonus, hp_bonus_hs, item_flags, delay, damager, droptype
new dmgcolors[3], scrtag, prefix, info, remove_limit, openmenu, nofall, recieved
new dglcost, m4cost, akcost, awpcost
static flagaccess, buyaccess
// Offsets
new const m_rgpPlayerItems_CBasePlayer[6] = {367, 368, ...}
#if AMXX_VERSION_NUM < 183
const m_bHasShield = 1<<24
const m_iUserPrefs = 510
#else
const m_bHasShield = 2043
#endif
const m_pNext = 42
const m_iClip = 51
const m_iId = 43
const XO_PLAYER = 5
const XO_WEAPON = 4
#if cellbits == 32
const m_iAccount = 115
#else
const m_iAccount = 140
#endif
const MENUKEYS = 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
const KEY_EXIT = 10
const PRIMARY_WEAPONS_BIT_SUM = 1<<CSW_SCOUT|1<<CSW_XM1014|1<<CSW_MAC10|1<<CSW_AUG|1<<CSW_UMP45
|1<<CSW_SG550|1<<CSW_GALIL|1<<CSW_FAMAS|1<<CSW_AWP|1<<CSW_MP5NAVY|1<<CSW_M249|1<<CSW_M3
|1<<CSW_M4A1|1<<CSW_TMP|1<<CSW_G3SG1|1<<CSW_SG552|1<<CSW_AK47|1<<CSW_P90
const SECONDARY_WEAPONS_BIT_SUM = 1<<CSW_P228|1<<CSW_ELITE|1<<CSW_FIVESEVEN|1<<CSW_USP|1<<CSW_GLOCK18|1<<CSW_DEAGLE
const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
// Max BP ammo for weapons
new const MAXBPAMMO[31] = { -1, 52, -1, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90,
90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, -1, 100
}
// Max clip for weapons
new const MAXCLIP[CSW_P90+1] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30,
35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50
}
// Ammo Type Names for weapons
new const AMMOTYPE[][] = { "", "357sig", "", "762nato", "", "buckshot", "", "45acp", "556nato",
"", "9mm", "57mm", "45acp", "556nato", "556nato", "556nato", "45acp", "9mm", "338magnum", "9mm",
"556natobox","buckshot", "556nato", "9mm", "762nato", "", "50ae", "556nato", "762nato", "", "57mm"
}
new const Float:g_flCoords[][] = { {0.50, 0.40},{0.56, 0.44},{0.60, 0.50},
{0.56, 0.56},{0.50, 0.60},{0.44, 0.56},{0.40, 0.50},{0.44, 0.44}
}
new const g_iColors[][] = { {0, 127, 255},/*blue*/{255, 127, 0},/*orange*/
{127, 0, 255},/*purple*/{0, 255, 0},/*green*/{255, 24, 119},/*pink*/
{228, 228, 228},/*gray*/{165, 42, 42},/*brown*/{255, 255, 0}/*yellow*/
}
new channels[8][] = {
"#Cstrike_Chat_CT","#Cstrike_Chat_T","#Cstrike_Chat_CT_Dead","#Cstrike_Chat_T_Dead",
"#Cstrike_Chat_Spec","#Cstrike_Chat_All","#Cstrike_Chat_AllDead","#Cstrike_Chat_AllSpec"
}
new newChannels[8][] = {
"^4(^1Counter-Terrorist^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^4(^1Terrorist^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^1*DEAD*^4(^1Counter-Terrorist^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^1*DEAD*^4(^1Terrorist^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^4(^1Spectator^4) [^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^4[^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^1*DEAD* ^4[^3V.I.P^4] ^3%s1^1 : ^4%s2",
"^1*SPEC* ^4[^3V.I.P^4] ^3%s1^1 : ^4%s2"
}
public plugin_init()
{
new mapname[4]
get_mapname(mapname, charsmax(mapname))
if(equali(mapname, "ma_") || equali (mapname, "_de") || equali(mapname, "cs_"))
{
target_map = true
}
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_cvar("vip_custom_version", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)
register_concmd("vip_custom_reloadcfg", "cmdReloadCfg", ADMIN_CFG)
register_dictionary ("vip_custom.txt" )
loadconfig()
g_iMaxPlayers = get_maxplayers()
RegisterHam(Ham_Spawn, "player", "playerspawn_post", 1)
RegisterHam(Ham_Killed, "player", "playerkilled_post", 1)
if(nofall) RegisterHam(Ham_TakeDamage, "player", "HamTakeDamagePlayerPre", 0)
if(scrtag) register_message( get_user_msgid("ScoreAttrib"), "msgScoreAttrib" )
if(damager) register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
if(prefix)
{
vipChannels = TrieCreate()
for (new i = 0; i < 8; i++)
{
TrieSetString(vipChannels, channels, newChannels)
}
register_message(get_user_msgid("SayText"), "messageSayText")
}
if(target_map)
{
// Cmds
register_clcmd( "weaponmenu", "MenuCommand" )
register_clcmd( "say /vipmenu", "MenuCommand" )
// Menu
register_menucmd( register_menuid( "WeaponMenu" ),MENUKEYS, "MenuHandler" )
register_menucmd( register_menuid( "BuyMenu" ),MENUKEYS, "MenuHandlerCustom" )
// Events
register_event( "HLTV", "Event_NewRound", "a", "1=0", "2=0" )
register_event( "TextMsg", "Event_NewGame", "a", "2=#Game_will_restart_in", "2=#Game_Commencing" )
if(vampire) register_event( "DeathMsg", "Event_DeathMsg", "a")
if(remove_limit) register_event( "BarTime", "event_bomb_planting", "be", "1=3")
}
}
public cmdReloadCfg(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
set_task(0.2, "delayed_load")
return PLUGIN_HANDLED
}
public delayed_load()
{
item_flags = 0
loadconfig()
if( g_iKNFPluginId > 0 && g_iKNFReload > 0)
{
callfunc_begin_i(g_iKNFReload, g_iKNFPluginId)
callfunc_end()
}
if( g_iDGLPluginId > 0 && g_iDGLReload > 0)
{
callfunc_begin_i(g_iDGLReload, g_iDGLPluginId)
callfunc_end()
}
if(g_iM4A1PluginId > 0 && g_iM4A1Reload > 0)
{
callfunc_begin_i(g_iM4A1Reload, g_iM4A1PluginId)
callfunc_end()
}
if(g_iAK47PluginId > 0 && g_iAK47Reload > 0)
{
callfunc_begin_i(g_iAK47Reload, g_iAK47PluginId)
callfunc_end()
}
if(g_iAWPPluginId > 0 && g_iAWPReload > 0)
{
callfunc_begin_i(g_iAWPReload, g_iAWPPluginId)
callfunc_end()
}
}
public loadconfig()
{
new ConfigFile[64], szMsg[128] // "addons/amxmodx/configs/vip_custom.ini" 37
get_localinfo("amxx_configsdir", ConfigFile, charsmax(ConfigFile))
add(ConfigFile, charsmax(ConfigFile), "/vip_custom.ini")
if( !file_exists(ConfigFile) )
{
formatex( szMsg, charsmax(szMsg), "%s Config File Not Found!", PLUGIN_NAME )
set_fail_state(szMsg)
return
}
new fp = fopen(ConfigFile, "rt")
if( fp )
{
new Datas[86], Setting[32], Value[15]
while( !feof(fp) )
{
fgets(fp, Datas, charsmax(Datas))
trim(Datas)
if(!Datas[0] || Datas[0] == ';' || Datas[0] == '#' || Datas[0] == '/' || Datas[0] == '[')
{
continue
}
new Sign[3]
parse(Datas, Setting, charsmax(Setting), Sign, charsmax(Sign), Value, charsmax(Value))
if( equali(Setting, "flag_access"))
{
flagaccess = read_flags(Value)
}else if( equali(Setting, "buy_access")){
buyaccess = read_flags(Value)
}else if( equali(Setting, "give_item_flags"))
{
if (containi(Value, "p") != -1)
{
item_flags |= ITEM_DEAGLE
}
if (containi(Value, "h") != -1)
{
item_flags |= ITEM_HE
}
if (containi(Value, "s") != -1)
{
item_flags |= ITEM_SMOKE
}
if (containi(Value, "f") != -1)
{
item_flags |= ITEM_FLASH
}
if (containi(Value, "a") != -1)
{
item_flags |= ITEM_AMMO
}
if (containi(Value, "v") != -1)
{
item_flags |= ITEM_ARMOR
}
if (containi(Value, "d") != -1)
{
item_flags |= ITEM_DEFUSER
}
}else if( equali(Setting, "allowed_round_equip")){
alw_round_eq = str_to_num(Value)
}else if( equali(Setting, "vip_tag")){
scrtag = str_to_num(Value) ? true : false
}else if( equali(Setting, "vip_prefix")){
prefix = str_to_num(Value) ? true : false
}else if( equali(Setting, "vip_info")){
info = str_to_num(Value) ? true : false
}else if( equali(Setting, "drop_type")){
droptype = str_to_num(Value)
}else if( equali(Setting, "no_fall_damage")){
nofall = str_to_num(Value) ? true : false
}else if( equali(Setting, "remove_limit")){
remove_limit = str_to_num(Value) ? true : false
}else if( equali(Setting, "bullet_damage")){
damager = str_to_num(Value)
}else if( equali(Setting, "bullet_damage_recieved")){
recieved = str_to_num(Value) ? true : false
}else if( equali(Setting, "bullet_damage_color")){
new red[10], green[10], blue[10]
parse(Value, red, charsmax(red), green, charsmax(green), blue, charsmax(blue))
dmgcolors[0] = str_to_num(red)
dmgcolors[1] = str_to_num(green)
dmgcolors[2] = str_to_num(blue)
}else if( equali(Setting, "vampire")){
vampire = str_to_num(Value) ? true : false
}else if( equali(Setting, "vampire_max_hp")){
vampire_max = str_to_num(Value)
}else if( equali(Setting, "vampire_hp")){
hp_bonus = str_to_num(Value)
}else if( equali(Setting, "vampire_hp_hs")){
hp_bonus_hs = str_to_num(Value)
}else if( equali(Setting, "open_menu")){
openmenu = str_to_num(Value) ? true : false
}else if( equali(Setting, "close_delay")){
delay = str_to_num(Value)
}else if( equali(Setting, "allowed_round_famas")){
alw_round_fm = str_to_num(Value)
}else if( equali(Setting, "allowed_round_m4ak")){
alw_round_m4ak = str_to_num(Value)
}else if( equali(Setting, "allowed_round_awp")){
alw_round_awp = str_to_num(Value)
}else if( equali(Setting, "allowed_round_buymenu")){
alw_round_buy = str_to_num(Value)
}else if( equali(Setting, "deagle_cost")){
dglcost = str_to_num(Value)
}else if( equali(Setting, "m4a1_cost")){
m4cost = str_to_num(Value)
}else if( equali(Setting, "ak47_cost")){
akcost = str_to_num(Value)
}else if( equali(Setting, "awp_cost")){
awpcost = str_to_num(Value)
}
}
formatex( szMsg, charsmax(szMsg), "%s Config Successfully Loaded!", PLUGIN_NAME )
server_print(szMsg)
}
}
public plugin_cfg()
{
g_iKNFPluginId = is_plugin_loaded("V.I.P Custom KNIFE")
if( g_iKNFPluginId > 0 )
{
g_iKNFReload = get_func_id("loadconfig", g_iKNFPluginId)
}
g_iDGLPluginId = is_plugin_loaded("V.I.P Custom DEAGLE")
if( g_iDGLPluginId > 0 )
{
g_iDGLGive = get_func_id("buyCMD", g_iDGLPluginId)
g_iDGLReload = get_func_id("loadconfig", g_iDGLPluginId)
}
g_iM4A1PluginId = is_plugin_loaded("V.I.P Custom M4A1")
if( g_iM4A1PluginId > 0 )
{
g_iM4A1Give = get_func_id("buyCMD", g_iM4A1PluginId)
g_iM4A1Reload = get_func_id("loadconfig", g_iM4A1PluginId)
}
g_iAK47PluginId = is_plugin_loaded("V.I.P Custom AK-47")
if( g_iAK47PluginId > 0 )
{
g_iAK47Give = get_func_id("buyCMD", g_iAK47PluginId)
g_iAK47Reload = get_func_id("loadconfig", g_iAK47PluginId)
}
g_iAWPPluginId = is_plugin_loaded("V.I.P Custom AWP")
if( g_iAWPPluginId > 0 )
{
g_iAWPGive = get_func_id("buyCMD", g_iAWPPluginId)
g_iAWPReload = get_func_id("loadconfig", g_iAWPPluginId)
}
}
public client_putinserver(id)
{
g_iAlive[id] = 0
g_bAccess[id] = get_user_flags(id) & flagaccess ? true : false
if(info)
{
set_task(1.0, "vip_connected", id)
if(target_map)
{
set_task(30.0, "vip_help", id)
}
}
if(!is_user_hltv(id))
{
SetFlagConnected(id)
}
}
public client_disconnect(id)
{
ClearFlagConnected(id)
}
public playerspawn_post(id)
{
g_iAlive[id] = is_user_alive(id)
g_bAccess[id] = get_user_flags(id) & flagaccess ? true : false
set_task(0.2, "GiveItem", id + 6910)
}
public playerkilled_post(id, attacker, shouldgib)
{
g_iAlive[id] = 0
}
public Event_NewRound()
{
gbIsUsed = 0
giCounter++
}
public Event_NewGame()
{
giCounter = 0
}
// Vip connected info/help
public vip_connected(id)
{
if(g_bAccess[id])
{
new name[32]
get_user_name(id, name, 31)
ChatColor(0, "%L", LANG_SERVER,"VIP_CONNECTED", name)
}
}
public vip_help(id)
{
if(g_bAccess[id])
{
new name[32]
get_user_name(id, name, 31)
ChatColor(id, "%L", LANG_SERVER,"VIP_HELP", name)
}
}