Сompiler AmxModX 1.8.2_fix ошибка при компилировании

backedtracked

Пользователь
Регистрация
26 Мар 2019
Сообщения
57
Симпатии
3
Amx Mod X
AMXX 1.8.2
Ошибка
Код:
12/17/2019 - 23:53:06: [AMXX] Load error 17 (invalid file format or version) (plugin "Welcome.amxx")
Исходник
Код:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN "IDEAL VIP"
#define VERSION "3 c xepoM]"
#define AUTHOR "15% oT Ba/lePa"

#define GOLD //Золотое оружие он/офф
#define TAB_SHOW //VIP в scoreboard
#define AUTO_ARMOR //автовыдача гранат и аммуниции в начале раунда
#define AUTO_PISTOLS //авто-меню пистолетов, если не выбран в наборе
//#define AUTO_WEAPMENU //випменю в начале раунда
#define vip_flag ADMIN_LEVEL_B //флаг випа или кого там надо...
#define c_round 3 //с какого раунда доступно меню
#define c_health 5 //+здоровья за 1 килл
#define c_health_head 10 //+здоровья за 1 килл в башню
#define c_health_max 100 //максимум здоровья для випа (зря бабки платил что-ли)
#define c_money 500 //+баксов за 1 килл
#define c_money_head 800 //+баксов за 1 килл в голову

#define VIP_TAG (1<<2)
#define m_LastHitGroup 75

#if defined GOLD
#define MAX_ITEM_TYPES 6
#define m_linux_entity 4
#define m_pPlayer 41
#define m_pActiveItem 373
#define DMG_VALUE 1.3 //множитель урона
#define linuxdiff 5

new const m_rgpPlayerItems[MAX_ITEM_TYPES] = {34, 35, ...}

new V_AK[] = "models/gold/v_ak47_gold.mdl"
new P_AK[] = "models/gold/p_ak47_gold.mdl"
new W_AK[] = "models/gold/w_ak47_gold.mdl"

new V_M4[] = "models/gold/v_m4a1_gold.mdl"
new P_M4[] = "models/gold/p_m4a1_gold.mdl"
new W_M4[] = "models/gold/w_m4a1_gold.mdl"

new V_AWP[] = "models/gold/v_awp_gold.mdl"
new P_AWP[] = "models/gold/p_awp_gold.mdl"
new W_AWP[] = "models/gold/w_awp_gold.mdl"
#endif

new bool:g_map_valid = false
new bool:g_vip_allow[33] = true
new bool:g_haveGold[33] = false

static g_Round, g_SecondWeap[33], g_SecondHave[33], g_buyTime, set_SecCase, i_Menu, g_maxPlayers

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_message(get_user_msgid("ScoreAttrib"), "msgScoreAttrib")

register_event("HLTV", "round_start", "a", "1=0", "2=0")
register_event("TextMsg", "round_restart", "a", "2=#Game_will_restart_in","2=#Game_Commencing")

RegisterHam(Ham_Killed, "player", "player_killed", 1)
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")

register_clcmd("say /vipmenu", "main_menu")
register_clcmd("say_team /vipmenu", "main_menu")
register_clcmd("vipmenu", "main_menu")

g_maxPlayers = get_maxplayers()

new szPrefixMap[][] = {"de_", "cs_", "css_","as_"}
new map[32]; get_mapname(map, charsmax(map));
for(new i; i < sizeof szPrefixMap; i++)
{
if(containi(map, szPrefixMap) != -1)
g_map_valid = true

}
#if defined GOLD
RegisterHam(Ham_Item_Deploy, "weapon_ak47", "deploy_weapon", 1)
RegisterHam(Ham_Item_Deploy, "weapon_m4a1", "deploy_weapon", 1)
RegisterHam(Ham_Item_Deploy, "weapon_awp", "deploy_weapon", 1)


register_forward(FM_SetModel, "set_model", 1)
#endif
}


#if defined GOLD
public plugin_precache()
{
precache_model (V_AK)
precache_model (P_AK)
precache_model (W_AK)


precache_model (V_M4)
precache_model (P_M4)
precache_model (W_M4)


precache_model (V_AWP)
precache_model (P_AWP)
precache_model (W_AWP)
}
#endif


public client_putinserver(id)
{
g_SecondWeap[id] = 0

new name[32]; get_user_name(id, name, 31)


if(get_user_flags(id) & ADMIN_BAN)
return client_print_color(0, 0, "^4[VIP] ^1На сервер зашел ^4Администратор ^3%s", name)


if(get_user_flags(id) & ADMIN_LEVEL_H)
return client_print_color(0, 0, "^4[VIP] ^1На сервер зашел ^4ВИП игрок ^3%s", name)


return PLUGIN_HANDLED
}

public client_disconnect(id)
{
g_SecondHave[id] = 0
g_SecondWeap[id] = 0
g_haveGold[id] = false
}

public round_start()
{
g_Round++
g_buyTime = get_systime()
}


public round_restart()
g_Round = 0

public player_spawn(Player)
{
if(!g_map_valid || !user_admin(Player))
return 1

g_vip_allow[Player] = true

if(is_user_alive(Player))
{
task_funk(Player)

#if defined AUTO_WEAPMENU
if(g_Round >= c_round)
main_menu(Player)
#endif
}

return 1
}


public task_funk(id)
{
#if defined AUTO_ARMOR
if(cs_get_user_team(id) == CS_TEAM_CT)
cs_set_user_defuse(id, 1, 255, 255, 0,_,0)
cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM)
cs_set_user_armor(id, 100, CS_ARMOR_KEVLAR)

give_item(id, "weapon_hegrenade")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_flashbang")
give_item(id, "weapon_smokegrenade")
#endif

#if defined AUTO_PISTOLS
if(g_SecondHave[id])
return 1
Give_Second_Weapon(id, g_SecondWeap[id])
#endif

return 0
}


public main_menu(id)
{
if(!user_admin(id))
return client_print_color(id, 0, "^1[^4VIP^1] ^3У вас нет доступа для открытия этого меню!")

if(!g_map_valid)
return client_print_color(id, 0, "^1[^4VIP^1] ^1На данной карте Оружейка недоступна!")


if(!is_user_alive(id))
return client_print_color(id, 0, "^1[^4VIP^1] ^3Зачем мертвому оружие?))")

if(g_Round < c_round)
return client_print_color(id, 0, "^1[^4VIP^1] ^3Оружейная комната доступна с %d-го раунда!", c_round)

if(!g_vip_allow[id] || get_systime() > (g_buyTime + 20))
return client_print_color(id, 0, "^1[^4VIP^1] ^3Вип меню недоступно! Ждите нового раунда.")


new s_Title[128], s_Pistol[32], szMenuMulti[64]
switch(g_SecondWeap[id])
{
case 0: s_Pistol = "NONE"
case 1: s_Pistol = "Deagle"
case 2: s_Pistol = "Usp"
case 3: s_Pistol = "Glock"
}


formatex(s_Title, charsmax(s_Title), "\r ВИП стоит кучу денег: ")
i_Menu = menu_create(s_Title, "main_handler", 1);

formatex(szMenuMulti, charsmax(szMenuMulti), "\y%s \d+ Гранаты + \rM4A1", s_Pistol)
menu_additem(i_Menu, szMenuMulti, "1", 0)


formatex(szMenuMulti, charsmax(szMenuMulti), "\y%s \d+ Гранаты + \rAK47", s_Pistol)
menu_additem(i_Menu, szMenuMulti, "2", 0)


formatex(szMenuMulti, charsmax(szMenuMulti), "\y%s \d+ Гранаты + \rAWP", s_Pistol)
menu_additem(i_Menu, szMenuMulti, "3", 0)


formatex(szMenuMulti, charsmax(szMenuMulti), "\y%s \d+ Гранаты + \rFAMAS", s_Pistol)
menu_additem(i_Menu, szMenuMulti, "4", 0)


formatex(szMenuMulti, charsmax(szMenuMulti), "\y%s \d+ Гранаты + \rSCOUT", s_Pistol)
menu_additem(i_Menu, szMenuMulti, "5", 0)


menu_addblank(i_Menu, 0)

formatex(szMenuMulti, charsmax(szMenuMulti), "\yИзменить \rпистолет \yв наборе")
menu_additem(i_Menu, szMenuMulti, "6", 0)

menu_addblank(i_Menu, 0)

#if defined GOLD
formatex(szMenuMulti, charsmax(szMenuMulti), "\yЗолотое оружие")
menu_additem(i_Menu, szMenuMulti, "7", 0)
#endif

menu_setprop(i_Menu, MPROP_EXITNAME, "Выход")

return menu_display(id, i_Menu, 0)
}


public main_handler(id, menu, item)
{
if(item == MENU_EXIT)
return menu_destroy(menu)

new s_Data[6], s_Name[60], i_Access, i_Callback
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)

new i_Key = str_to_num(s_Data)
if(1 <= i_Key <= 5)
{
g_vip_allow[id] = false
g_haveGold[id] = false
}

switch(i_Key)
{
case 1: DropWeapons(id, 1, "weapon_m4a1", CSW_M4A1, 90)
case 2: DropWeapons(id, 1, "weapon_ak47", CSW_AK47, 90)
case 3: DropWeapons(id, 1, "weapon_awp", CSW_AWP, 30)
case 4: DropWeapons(id, 1, "weapon_famas", CSW_FAMAS, 90)
case 5: DropWeapons(id, 1, "weapon_scout", CSW_SCOUT, 90)
case 6:
{
set_SecCase = 6
sec_WpnMenu(id)
}
case 7: GoldMenu(id)
}

return menu_destroy(menu)
}


public sec_WpnMenu(id)
{
i_Menu = menu_create("\rПистолет для набора", "sec_WpnMenu_handler")


menu_additem(i_Menu, "\yDeagle", "1", 0)
menu_additem(i_Menu, "\yUsp", "2", 0)
menu_additem(i_Menu, "\yGlock", "3", 0)


menu_display(id, i_Menu, 0)
}


public sec_WpnMenu_handler(id, menu, item)
{
if(item == MENU_EXIT)
return PLUGIN_HANDLED


new s_Data[6], s_Name[60], i_Access, i_Callback
menu_item_getinfo(menu, item, i_Access, s_Data, charsmax(s_Data), s_Name, charsmax(s_Name), i_Callback)

new i_Key = str_to_num(s_Data)
g_SecondWeap[id] = i_Key
g_SecondHave[id] = true

menu_destroy(menu)


return Give_Second_Weapon(id, g_SecondWeap[id])
}


#if defined GOLD
public GoldMenu(id)
{
i_Menu = menu_create("\yВау!)) Золотишечко", "GoldMenu_handler")


menu_additem(i_Menu, "\yЗолотой \wМ4А1", "1", 0)
menu_additem(i_Menu, "\yЗолотой \wАК-47", "2", 0);
menu_additem(i_Menu, "\yЗолотой \wMagnum AWP", "3", 0)
menu_addblank2(i_Menu)


menu_setprop(i_Menu, MPROP_EXITNAME, "\yВыход")
menu_display(id, i_Menu, 0)
}


public GoldMenu_handler(id, menu, item)
{
if(item == MENU_EXIT)
return menu_destroy(menu)

new cmd[3], access, callback
menu_item_getinfo(menu, item, access, cmd, 2,_,_, callback)

if(item != MENU_EXIT)
{
g_vip_allow[id] = false
g_haveGold[id] = true
}

new i_Key = str_to_num(cmd)
switch (i_Key)
{
case 1: DropWeapons(id, 1, "weapon_m4a1", CSW_M4A1, 90)
case 2: DropWeapons(id, 1, "weapon_ak47", CSW_AK47, 90)
case 3: DropWeapons(id, 1, "weapon_awp", CSW_AWP, 30)
case 4: main_menu(id)
}

return menu_destroy(menu)
}


public deploy_weapon(ent)
{
static id; id = get_pdata_cbase(ent, m_pPlayer, m_linux_entity)


static wpn; wpn = pev(ent, pev_iuser1)
if(!wpn)
return


if(!user_admin(id))
{
static weap_name[32]
get_weaponname(wpn, weap_name, charsmax(weap_name))
engclient_cmd(id, "drop", weap_name)


client_print_color(id, 0, "^1[^4VIP^1] ^3Это оружие доступно только ВИП игрокам!")
return
}

switch(wpn)
{
case CSW_AK47:
{
set_pev(id, pev_viewmodel2, V_AK)
set_pev(id, pev_weaponmodel2, P_AK)
}
case CSW_M4A1:
{
set_pev(id, pev_viewmodel2, V_M4)
set_pev(id, pev_weaponmodel2, P_M4)
}
case CSW_AWP:
{
set_pev(id, pev_viewmodel2, V_AWP)
set_pev(id, pev_weaponmodel2, P_AWP)
}
}
}


public set_model(ent, model[])
{
if(!pev_valid(ent))
return

static classname[10]; pev(ent, pev_classname, classname, charsmax(classname))
if(!equal(classname, "weaponbox"))
return


static drop
for(new i = 0 ; i < MAX_ITEM_TYPES; i++)
{
drop = get_pdata_cbase(ent, m_rgpPlayerItems, m_linux_entity)
if(drop < 1)
continue
break
}

if(drop < 1)
return

static wpn; wpn = pev(drop, pev_iuser1)
if(!wpn)
return


switch(wpn)
{
case CSW_AK47: engfunc(EngFunc_SetModel, ent, W_AK)
case CSW_M4A1: engfunc(EngFunc_SetModel, ent, W_M4)
case CSW_AWP: engfunc(EngFunc_SetModel, ent, W_AWP)
}
}


public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if(!attacker || attacker > g_maxPlayers)
return HAM_IGNORED


static ent; ent = get_pdata_cbase(attacker, m_pActiveItem, linuxdiff)
static wpn; wpn = pev(ent, pev_iuser1)


if(!wpn)
return HAM_IGNORED


SetHamParamFloat(4, damage * DMG_VALUE)

return HAM_IGNORED
}
#endif


public player_killed(victim, killer, corpse)
{
if(user_admin(victim))
{
g_SecondHave[victim] = false
g_haveGold[victim] = false
return
}

if(user_admin(victim))
{
if(is_user_alive(killer))
{
static p_Health; p_Health = get_user_health(killer)
static p_Money; p_Money = cs_get_user_money(killer)
if(get_pdata_int(victim, m_LastHitGroup) == HIT_HEAD)
{
set_user_health(killer, p_Health + c_health_head)
if(p_Health > c_health_max)
set_user_health(killer, c_health_max)
cs_set_user_money(killer, p_Money + c_money_head)
}
else
{
set_user_health(killer, p_Health + c_health)
if(p_Health > c_health_max)
set_user_health(killer, c_health_max)
cs_set_user_money(killer, p_Money + c_money)
}
}
}
}


#if defined TAB_SHOW
public msgScoreAttrib(const MsgId, const MsgType, const MsgDest)
{
if(user_admin(get_msg_arg_int(1)) && !get_msg_arg_int(2))
set_msg_arg_int(2, ARG_BYTE, VIP_TAG)
}
#endif


stock bool: user_admin(const id)
{
if(!is_user_connected(id))
return false


if(get_user_flags(id) & vip_flag)
return true


return false
}


Give_Second_Weapon(id, wpnHave)
{
switch(wpnHave)
{
case 0: sec_WpnMenu(id)
case 1: DropWeapons(id, 2, "weapon_deagle", CSW_DEAGLE, 35)
case 2: DropWeapons(id, 2, "weapon_usp", CSW_USP, 100)
case 3: DropWeapons(id, 2, "weapon_glock18", CSW_GLOCK18, 120)
}

if(set_SecCase == 6)
{
set_SecCase = 0
main_menu(id)
}

return 1
}


DropWeapons(id, wpnType, wpnName[], wpnID, iAmmo)
{
#define PRIMARY_WEAPON ((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))


#define SECONDARY_WEAPON ((1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_P228)|(1<<CSW_DEAGLE))

new weapons[32], num, i
get_user_weapons(id, weapons, num)

switch(wpnType)
{
case 1: wpnType = PRIMARY_WEAPON
case 2: wpnType = SECONDARY_WEAPON
}

static weap_name[32]
for(i = 0; i < num; i++)
{
if(wpnType & (1<<weapons))
{
get_weaponname(weapons, weap_name, sizeof weap_name - 1)
if(!equali(weap_name, wpnName))
engclient_cmd(id, "drop", weap_name)
}
}

#if defined GOLD

if(g_haveGold[id])
{
static ent; ent = fm_give_item(id, wpnName)
if(!pev_valid(ent))
return

set_pev(ent, pev_iuser1, wpnID)
cs_set_user_bpammo(id, wpnID, iAmmo)
deploy_weapon(ent)
engclient_cmd(id, wpnName)


return
}
#endif

fm_give_item(id, wpnName)
cs_set_user_bpammo(id, wpnID, iAmmo)
}
1576616394893.png1576616394893.png
 

NeTvoyKenji

Пользователь
Регистрация
27 Мар 2019
Сообщения
423
Симпатии
47
Для начала добавь инклюд королчат'а
Большая часть ошибок исчезнет
 
Сверху Снизу