Solved Balrog Ethereal

Unpaid Requests, Public Plugins
Post Reply
raouf
Member
Member
Algeria
Posts: 34
Joined: 6 years ago
Contact:

Balrog Ethereal

#1

Post by raouf » 6 years ago

Hello :) ,

I found this plugin and i think it's amazing :lol:

can someone convert it to zombie escape please ? 8-)

Balrog Ethereal.rar
(883.52 KiB) Downloaded 592 times
Balrog Ethereal.rar
(883.52 KiB) Downloaded 592 times
I'm A muslim :)

allah akbar :D

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#2

Post by johnnysins2000 » 6 years ago

OK ,I will convert it when I come to pc

Welcome to This Forum! :)
Nobody Is That Busy If They Make Time :roll:

raouf
Member
Member
Algeria
Posts: 34
Joined: 6 years ago
Contact:

#3

Post by raouf » 6 years ago

Thank you for the welcoming ! :)
I'm A muslim :)

allah akbar :D

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#4

Post by johnnysins2000 » 6 years ago

raouf wrote: 6 years ago Thank you for the welcoming ! :)
Compile this code ... If u know how
    1. /*================================================================================
    2.  
    3.             --------------------------------
    4.             [ZE] Extra Item: Balrog Ethereal
    5.             --------------------------------
    6.  
    7.         Balrog Ethereal
    8.         Copyright (C) 2017 by Crazy + ZE DEV TEAM
    9.  
    10.         -------------------
    11.         -*- Description -*-
    12.         -------------------
    13.  
    14.         This plugin add a new weapon into your zombie plague mod with
    15.         the name of Balrog Ethereal. That weapon launch a powerfull beams!
    16.         When the laser hit any object, a explosion effect with red color appers.
    17.  
    18.         ----------------
    19.         -*- Commands -*-
    20.         ----------------
    21.  
    22.         * zp_give_balrog_ethereal <target> - Give the item to target.
    23.  
    24.         -------------
    25.         -*- Cvars -*-
    26.         -------------
    27.  
    28.         * ze_balrog_ethereal_ammo <number> - Ammo amout.
    29.         * ze_balrog_ethereal_clip <number> - Clip amout. (Max: 100)
    30.         * ze_balrog_ethereal_one_round <0/1> - Only one round.
    31.         * ze_balrog_ethereal_damage <number> - Damage multiplier.
    32.         * ze_balrog_ethereal_unlimited <0/1> - Unlimited ammunition.
    33.  
    34.         ------------------
    35.         -*- Change Log -*-
    36.         ------------------
    37.  
    38.         * v1.5: (Mar 2017)
    39.             - Updated all the code, added explosion effect, added new cvars;
    40.  
    41.         * v1.6: (Mar 2017)
    42.             - Added custom weapon hud;
    43.  
    44.         ---------------
    45.         -*- Credits -*-
    46.         ---------------
    47.  
    48.         * MeRcyLeZZ: for the nice zombie plague mod.
    49.         * Crazy: created the extra item code.
    50.         * deanamx: for the nice weapon model.
    51.         * And all zombie-mod players that use this weapon.
    52.         * ZE DEV TEAM : For converting this Item
    53.  
    54.  
    55. =================================================================================*/
    56. #include <zombie_escape>
    57. #include <cstrike>
    58. #include <cs_ham_bots_api>
    59.  
    60. /*================================================================================
    61.  [Plugin Customization]
    62. =================================================================================*/
    63.  
    64. // Item Name
    65. #define ITEM_NAME "Balrog Ethereal"
    66.  
    67.  
    68. /*================================================================================
    69.  Customization ends here! Yes, that's it. Editing anything beyond
    70.  here is not officially supported. Proceed at your own risk...
    71. =================================================================================*/
    72.  
    73. new const PLUGIN_VERSION[] = "v1.6";
    74.  
    75. new const V_BALROG_MDL[64] = "models/zombie_plague/v_balrog_ethereal.mdl";
    76. new const P_BALROG_MDL[64] = "models/zombie_plague/p_balrog_ethereal.mdl";
    77. new const W_BALROG_MDL[64] = "models/zombie_plague/w_balrog_ethereal.mdl";
    78.  
    79. new const BALROG_SOUNDS[][] = { "weapons/ethereal_shoot.wav", "weapons/ethereal_reload.wav", "weapons/ethereal_idle1.wav", "weapons/ethereal_draw.wav" };
    80.  
    81. new g_has_balrog[33], g_laser_sprite, g_balrog_exp, g_balrog, g_event_balrog, g_playername[33][32], g_maxplayers, g_primary_attack, g_balrog_reload_clip[33], cvar_balrog_clip, cvar_balrog_ammo, cvar_balrog_damage, cvar_balrog_oneround, cvar_balrog_unlimited;
    82.  
    83. const BALROG_KEY = 0982478;
    84.  
    85. const m_iClip = 51;
    86. const m_flNextAttack = 83;
    87. const m_fInReload = 54;
    88.  
    89. const OFFSET_WEAPON_OWNER = 41;
    90. const OFFSET_LINUX_WEAPONS = 4;
    91. const OFFSET_LINUX = 5;
    92. const OFFSET_ACTIVE_ITEM = 373;
    93.  
    94. const WEAPON_BITSUM = ((1<<CSW_SCOUT) | (1<<CSW_XM1014) | (1<<CSW_MAC10) | (1<<CSW_AUG) | (1<<CSW_UMP45) | (1<<CSW_SG550) | (1<<CSW_P90) | (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_GALIL));
    95.  
    96. enum
    97. {
    98.     idle = 0,
    99.     reload,
    100.     draw,
    101.     shoot1,
    102.     shoot2,
    103.     shoot3
    104. }
    105.  
    106. public plugin_init()
    107. {
    108.     /* Plugin register */
    109.     register_plugin("[ZE] Extra Item: Balrog Ethereal", PLUGIN_VERSION, "Crazy");
    110.  
    111.     /* Item register */
    112.     g_balrog = ze_register_item("Balrog Ethereal", 10);
    113.  
    114.     /* Events */
    115.     register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
    116.  
    117.     /* Messages */
    118.     register_message(get_user_msgid("CurWeapon"), "message_cur_weapon");
    119.  
    120.     /* Forwards */
    121.     register_forward(FM_UpdateClientData, "fw_UpdateData_Post", 1);
    122.     register_forward(FM_SetModel, "fw_SetModel");
    123.     register_forward(FM_PlaybackEvent, "fw_PlaybackEvent");
    124.  
    125.     /* Ham Forwards */
    126.     RegisterHam(Ham_TraceAttack, "worldspawn", "fw_TraceAttack_Post", 1);
    127.     RegisterHam(Ham_TraceAttack, "func_breakable", "fw_TraceAttack_Post", 1);
    128.     RegisterHam(Ham_TraceAttack, "func_wall", "fw_TraceAttack_Post", 1);
    129.     RegisterHam(Ham_TraceAttack, "func_door", "fw_TraceAttack_Post", 1);
    130.     RegisterHam(Ham_TraceAttack, "func_door_rotating", "fw_TraceAttack_Post", 1);
    131.     RegisterHam(Ham_TraceAttack, "func_plat", "fw_TraceAttack_Post", 1);
    132.     RegisterHam(Ham_TraceAttack, "func_rotating", "fw_TraceAttack_Post", 1);
    133.     RegisterHam(Ham_Item_Deploy, "weapon_ump45", "fw_Item_Deploy_Post", 1);
    134.     RegisterHam(Ham_Item_AddToPlayer, "weapon_ump45", "fw_Item_AddToPlayer_Post", 1);
    135.     RegisterHam(Ham_Item_PostFrame, "weapon_ump45", "fw_Item_PostFrame");
    136.     RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_ump45", "fw_PrimaryAttack");
    137.     RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_ump45", "fw_PrimaryAttack_Post", 1);
    138.     RegisterHam(Ham_Weapon_Reload, "weapon_ump45", "fw_Reload");
    139.     RegisterHam(Ham_Weapon_Reload, "weapon_ump45", "fw_Reload_Post", 1);
    140.     RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
    141.     RegisterHamBots(Ham_TakeDamage, "fw_TakeDamage");
    142.  
    143.     /* Cvars */
    144.     cvar_balrog_clip = register_cvar("ze_balrog_minigun_clip", "50");
    145.     cvar_balrog_ammo = register_cvar("ze_balrog_minigun_ammo", "200");
    146.     cvar_balrog_damage = register_cvar("ze_balrog_minigun_damage", "3.0");
    147.     cvar_balrog_oneround = register_cvar("ze_balrog_minigun_one_round", "0");
    148.     cvar_balrog_unlimited = register_cvar("ze_balrog_minigun_unlimited", "0");
    149.  
    150.     /* Max Players */
    151.     g_maxplayers = get_maxplayers()
    152. }
    153.  
    154. public plugin_precache()
    155. {
    156.     engfunc(EngFunc_PrecacheModel, V_BALROG_MDL);
    157.     engfunc(EngFunc_PrecacheModel, P_BALROG_MDL);
    158.     engfunc(EngFunc_PrecacheModel, W_BALROG_MDL);
    159.  
    160.     engfunc(EngFunc_PrecacheGeneric, "sprites/weapon_bethereal.txt");
    161.     engfunc(EngFunc_PrecacheGeneric, "sprites/640hud2_bethereal.spr");
    162.     engfunc(EngFunc_PrecacheGeneric, "sprites/640hud10_bethereal.spr");
    163.     engfunc(EngFunc_PrecacheGeneric, "sprites/640hud74_bethereal.spr");
    164.  
    165.     for (new i = 0; i < sizeof BALROG_SOUNDS; i++)
    166.     engfunc(EngFunc_PrecacheSound, BALROG_SOUNDS[i]);
    167.  
    168.     g_laser_sprite = precache_model("sprites/laserbeam.spr");
    169.     g_balrog_exp = precache_model("sprites/zombie_plague/balrog_ethereal_exp.spr");
    170.  
    171.     register_forward(FM_PrecacheEvent, "fw_PrecacheEvent_Post", 1);
    172.     register_clcmd("weapon_bethereal", "cmd_balrog_selected");
    173. }
    174.  
    175. public ze_user_infected(id)
    176. {
    177.     g_has_balrog[id] = false;
    178. }
    179.  
    180. public ze_user_humanized(id)
    181. {
    182.     g_has_balrog[id] = false;
    183. }
    184.  
    185. public client_putinserver(id)
    186. {
    187.     g_has_balrog[id] = false;
    188.  
    189.     get_user_name(id, g_playername[id], charsmax(g_playername[]));
    190. }
    191.  
    192. public event_round_start()
    193. {
    194.     for (new id = 0; id <= g_maxplayers; id++)
    195.     {
    196.         if (get_pcvar_num(cvar_balrog_oneround))
    197.         g_has_balrog[id] = false;
    198.     }
    199. }
    200.  
    201. public cmd_balrog_selected(client)
    202. {
    203.     engclient_cmd(client, "weapon_ump45");
    204.     return PLUGIN_HANDLED;
    205. }
    206.  
    207. public message_cur_weapon(msg_id, msg_dest, msg_entity)
    208. {
    209.     if (!is_user_alive(msg_entity))
    210.         return;
    211.  
    212.     if (!g_has_balrog[msg_entity])
    213.         return;
    214.  
    215.     if (get_user_weapon(msg_entity) != CSW_UMP45)
    216.         return;
    217.  
    218.     if (get_msg_arg_int(1) != 1)
    219.         return;
    220.  
    221.     if (get_pcvar_num(cvar_balrog_unlimited))
    222.     {
    223.         static ent;
    224.         ent = fm_cs_get_current_weapon_ent(msg_entity);
    225.  
    226.         if (!pev_valid(ent))
    227.             return;
    228.  
    229.         cs_set_weapon_ammo(ent, get_pcvar_num(cvar_balrog_clip));
    230.         set_msg_arg_int(3, get_msg_argtype(3), get_pcvar_num(cvar_balrog_clip));
    231.     }
    232. }
    233.  
    234. public ze_select_item_pre(id, itemid)
    235. {
    236.     // This not our item?
    237.     if (itemid != g_balrog)
    238.         return ZE_ITEM_AVAILABLE
    239.    
    240.     // Available for Humans only, So don't show it for zombies
    241.     if (ze_is_user_zombie(id))
    242.         return ZE_ITEM_DONT_SHOW
    243.    
    244.     // Finally return that it's available
    245.     return ZE_ITEM_AVAILABLE
    246. }
    247.  
    248. public ze_select_item_post(id, itemid)
    249. {
    250.     if (itemid != g_balrog)
    251.         return;
    252.  
    253.     if (g_has_balrog[id])
    254.     {
    255.         client_print(id, print_chat, "[ZE] You already have the %s.", ITEM_NAME);
    256.         return;
    257.     }
    258.  
    259.     give_balrog(id);
    260.  
    261.     client_print(id, print_chat, "[ZE] You bought the %s.", ITEM_NAME);
    262. }
    263.  
    264. public fw_UpdateData_Post(id, sendweapons, cd_handle)
    265. {
    266.     if (!is_user_alive(id))
    267.         return FMRES_IGNORED;
    268.  
    269.     if (!g_has_balrog[id])
    270.         return FMRES_IGNORED;
    271.  
    272.     if (get_user_weapon(id) != CSW_UMP45)
    273.         return FMRES_IGNORED;
    274.  
    275.     set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001);
    276.  
    277.     return FMRES_IGNORED;
    278. }
    279.  
    280. public fw_SetModel(ent, const model[])
    281. {
    282.     if (!pev_valid(ent))
    283.         return FMRES_IGNORED;
    284.  
    285.     if (!equal(model, "models/w_ump45.mdl"))
    286.         return HAM_IGNORED;
    287.  
    288.     static class_name[33];
    289.     pev(ent, pev_classname, class_name, charsmax(class_name));
    290.  
    291.     if (!equal(class_name, "weaponbox"))
    292.         return FMRES_IGNORED;
    293.  
    294.     static owner, weapon;
    295.     owner = pev(ent, pev_owner);
    296.     weapon = find_ent_by_owner(-1, "weapon_ump45", ent);
    297.  
    298.     if (!g_has_balrog[owner] || !pev_valid(weapon))
    299.         return FMRES_IGNORED;
    300.  
    301.     g_has_balrog[owner] = false;
    302.  
    303.     set_pev(weapon, pev_impulse, BALROG_KEY);
    304.  
    305.     engfunc(EngFunc_SetModel, ent, W_BALROG_MDL);
    306.  
    307.     return FMRES_SUPERCEDE;
    308. }
    309.  
    310. public fw_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
    311. {
    312.     if ((eventid != g_event_balrog) || !g_primary_attack)
    313.         return FMRES_IGNORED;
    314.  
    315.     if (!(1 <= invoker <= g_maxplayers))
    316.         return FMRES_IGNORED;
    317.  
    318.     playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2);
    319.  
    320.     return FMRES_SUPERCEDE;
    321. }
    322.  
    323. public fw_PrecacheEvent_Post(type, const name[])
    324. {
    325.     if (!equal("events/ump45.sc", name))
    326.         return HAM_IGNORED;
    327.  
    328.     g_event_balrog = get_orig_retval()
    329.  
    330.     return FMRES_HANDLED;
    331. }
    332.  
    333. public fw_Item_Deploy_Post(ent)
    334. {
    335.     if (!pev_valid(ent))
    336.         return HAM_IGNORED;
    337.  
    338.     new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
    339.  
    340.     if (!is_user_alive(id))
    341.         return HAM_IGNORED;
    342.  
    343.     if (!g_has_balrog[id])
    344.         return HAM_IGNORED;
    345.  
    346.     set_pev(id, pev_viewmodel2, V_BALROG_MDL);
    347.     set_pev(id, pev_weaponmodel2, P_BALROG_MDL);
    348.  
    349.     play_weapon_anim(id, draw);
    350.  
    351.     return HAM_IGNORED;
    352. }
    353.  
    354. public fw_Item_AddToPlayer_Post(ent, id)
    355. {
    356.     if (!pev_valid(ent))
    357.         return HAM_IGNORED;
    358.  
    359.     if (!is_user_alive(id))
    360.         return HAM_IGNORED;
    361.  
    362.     if (pev(ent, pev_impulse) == BALROG_KEY)
    363.     {
    364.         g_has_balrog[id] = true;
    365.         set_pev(ent, pev_impulse, 0);
    366.     }
    367.  
    368.     message_begin(MSG_ONE, get_user_msgid("WeaponList"), _, id)
    369.     write_string((g_has_balrog[id] ? "weapon_bethereal" : "weapon_ump45"))
    370.     write_byte(6)
    371.     write_byte(100)
    372.     write_byte(-1)
    373.     write_byte(-1)
    374.     write_byte(0)
    375.     write_byte(15)
    376.     write_byte(CSW_UMP45)
    377.     write_byte(0)
    378.     message_end()
    379.  
    380.     return HAM_IGNORED;
    381. }
    382.  
    383. public fw_Item_PostFrame(ent)
    384. {
    385.     if (!pev_valid(ent))
    386.         return HAM_IGNORED;
    387.  
    388.     new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
    389.  
    390.     if (!is_user_alive(id))
    391.         return HAM_IGNORED;
    392.  
    393.     if (!g_has_balrog[id])
    394.         return HAM_IGNORED;
    395.  
    396.     static cvar_clip; cvar_clip = get_pcvar_num(cvar_balrog_clip);
    397.  
    398.     new clip = get_pdata_int(ent, m_iClip, OFFSET_LINUX_WEAPONS);
    399.     new bpammo = cs_get_user_bpammo(id, CSW_UMP45);
    400.  
    401.     new Float:flNextAttack = get_pdata_float(id, m_flNextAttack, OFFSET_LINUX);
    402.     new fInReload = get_pdata_int(ent, m_fInReload, OFFSET_LINUX_WEAPONS);
    403.  
    404.     if (fInReload && flNextAttack <= 0.0)
    405.     {
    406.         new temp_clip = min(cvar_clip - clip, bpammo);
    407.  
    408.         set_pdata_int(ent, m_iClip, clip + temp_clip, OFFSET_LINUX_WEAPONS);
    409.  
    410.         cs_set_user_bpammo(id, CSW_UMP45, bpammo-temp_clip);
    411.  
    412.         set_pdata_int(ent, m_fInReload, 0, OFFSET_LINUX_WEAPONS);
    413.  
    414.         fInReload = 0;
    415.     }
    416.  
    417.     return HAM_IGNORED;
    418. }
    419.  
    420. public fw_PrimaryAttack(ent)
    421. {
    422.     if (!pev_valid(ent))
    423.         return HAM_IGNORED;
    424.  
    425.     new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
    426.  
    427.     if (!is_user_alive(id))
    428.         return HAM_IGNORED;
    429.  
    430.     if (!g_has_balrog[id])
    431.         return HAM_IGNORED;
    432.  
    433.     if (!cs_get_weapon_ammo(ent))
    434.         return HAM_IGNORED;
    435.  
    436.     g_primary_attack = true;
    437.  
    438.     return HAM_IGNORED;
    439. }
    440.  
    441. public fw_PrimaryAttack_Post(ent)
    442. {
    443.     if (!pev_valid(ent))
    444.         return HAM_IGNORED;
    445.  
    446.     new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
    447.  
    448.     if (!is_user_alive(id))
    449.         return HAM_IGNORED;
    450.  
    451.     if (!g_has_balrog[id])
    452.         return HAM_IGNORED;
    453.  
    454.     if (!cs_get_weapon_ammo(ent))
    455.         return HAM_IGNORED;
    456.  
    457.     g_primary_attack = false;
    458.  
    459.     play_weapon_anim(id, random_num(shoot1, shoot3));
    460.  
    461.     emit_sound(id, CHAN_WEAPON, BALROG_SOUNDS[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
    462.  
    463.     make_laser_beam(id, 7, 100, 0, 0);
    464.  
    465.     return HAM_IGNORED;
    466. }
    467.  
    468. public fw_Reload(ent)
    469. {
    470.     if (!pev_valid(ent))
    471.         return HAM_IGNORED;
    472.  
    473.     new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
    474.  
    475.     if (!is_user_alive(id))
    476.         return HAM_IGNORED;
    477.  
    478.     if (!g_has_balrog[id])
    479.         return HAM_IGNORED;
    480.  
    481.     static cvar_clip;
    482.  
    483.     if (g_has_balrog[id])
    484.         cvar_clip = get_pcvar_num(cvar_balrog_clip);
    485.  
    486.     g_balrog_reload_clip[id] = -1;
    487.  
    488.     new clip = get_pdata_int(ent, m_iClip, OFFSET_LINUX_WEAPONS);
    489.     new bpammo = cs_get_user_bpammo(id, CSW_UMP45);
    490.  
    491.     if (bpammo <= 0)
    492.         return HAM_SUPERCEDE;
    493.  
    494.     if (clip >= cvar_clip)
    495.         return HAM_SUPERCEDE;
    496.    
    497.     g_balrog_reload_clip[id] = clip;
    498.  
    499.     return HAM_IGNORED;
    500. }
    501.  
    502. public fw_Reload_Post(ent)
    503. {
    504.     if (!pev_valid(ent))
    505.         return HAM_IGNORED;
    506.  
    507.     new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
    508.  
    509.     if (!is_user_alive(id))
    510.         return HAM_IGNORED;
    511.  
    512.     if (!g_has_balrog[id])
    513.         return HAM_IGNORED;
    514.  
    515.     if (g_balrog_reload_clip[id] == -1)
    516.         return HAM_IGNORED;
    517.  
    518.     set_pdata_int(ent, m_iClip, g_balrog_reload_clip[id], OFFSET_LINUX_WEAPONS);
    519.     set_pdata_int(ent, m_fInReload, 1, OFFSET_LINUX_WEAPONS);
    520.  
    521.     play_weapon_anim(id, reload);
    522.  
    523.     return HAM_IGNORED;
    524. }
    525.  
    526. public fw_TakeDamage(victim, inflictor, attacker, Float:damage, dmg_bits)
    527. {
    528.     if (!is_user_alive(attacker))
    529.         return HAM_IGNORED;
    530.  
    531.     if (!g_has_balrog[attacker])
    532.         return HAM_IGNORED;
    533.  
    534.     if (get_user_weapon(attacker) != CSW_UMP45)
    535.         return HAM_IGNORED;
    536.  
    537.     SetHamParamFloat(OFFSET_LINUX_WEAPONS, damage * get_pcvar_float(cvar_balrog_damage));
    538.  
    539.     make_explosion_effect(attacker);
    540.  
    541.     return HAM_IGNORED;
    542. }
    543.  
    544. public fw_TraceAttack_Post(ent, attacker, Float:damage, Float:dir[3], ptr, dmg_bits)
    545. {
    546.     if (!is_user_alive(attacker))
    547.         return HAM_IGNORED;
    548.  
    549.     if (get_user_weapon(attacker) != CSW_UMP45)
    550.         return HAM_IGNORED;
    551.  
    552.     if (!g_has_balrog[attacker])
    553.         return HAM_IGNORED;
    554.  
    555.     make_explosion_effect(attacker);
    556.  
    557.     return HAM_IGNORED;
    558. }
    559.  
    560. give_balrog(id)
    561. {
    562.     drop_primary(id);
    563.  
    564.     g_has_balrog[id] = true;
    565.  
    566.     new weapon = fm_give_item(id, "weapon_ump45");
    567.  
    568.     cs_set_weapon_ammo(weapon, get_pcvar_num(cvar_balrog_clip));
    569.     cs_set_user_bpammo(id, CSW_UMP45, get_pcvar_num(cvar_balrog_ammo));
    570. }
    571.  
    572. play_weapon_anim(id, frame)
    573. {
    574.     set_pev(id, pev_weaponanim, frame);
    575.  
    576.     message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = id)
    577.     write_byte(frame)
    578.     write_byte(pev(id, pev_body))
    579.     message_end()
    580. }
    581.  
    582. make_laser_beam(id, Size, R, G, B)
    583. {
    584.     static End[3];
    585.     get_user_origin(id, End, 3);
    586.    
    587.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
    588.     write_byte (TE_BEAMENTPOINT)
    589.     write_short( id |0x1000 )
    590.     write_coord(End[0])
    591.     write_coord(End[1])
    592.     write_coord(End[2])
    593.     write_short(g_laser_sprite)
    594.     write_byte(0)
    595.     write_byte(1)
    596.     write_byte(1)
    597.     write_byte(Size)
    598.     write_byte(4)
    599.     write_byte(R)
    600.     write_byte(G)
    601.     write_byte(B)
    602.     write_byte(255)
    603.     write_byte(0)
    604.     message_end()
    605. }
    606.  
    607. make_explosion_effect(id)
    608. {
    609.     static end[3];
    610.     get_user_origin(id, end, 3);
    611.  
    612.     message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
    613.     write_byte(3)
    614.     write_coord(end[0])
    615.     write_coord(end[1])
    616.     write_coord(end[2])
    617.     write_short(g_balrog_exp)
    618.     write_byte(10)
    619.     write_byte(15)
    620.     write_byte(4)
    621.     message_end()
    622. }
    623.  
    624. drop_primary(id)
    625. {
    626.     static weapons[32], num;
    627.     get_user_weapons(id, weapons, num);
    628.  
    629.     for (new i = 0; i < num; i++)
    630.     {
    631.         if (WEAPON_BITSUM & (1<<weapons[i]))
    632.         {
    633.             static wname[32];
    634.             get_weaponname(weapons[i], wname, sizeof wname - 1);
    635.  
    636.             engclient_cmd(id, "drop", wname);
    637.         }
    638.     }
    639. }
    640.  
    641. stock fm_give_item(index, const item[])
    642. {
    643.     if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
    644.         return 0;
    645.  
    646.     new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item));
    647.     if (!pev_valid(ent))
    648.         return 0;
    649.  
    650.     new Float:origin[3];
    651.     pev(index, pev_origin, origin);
    652.     set_pev(ent, pev_origin, origin);
    653.     set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
    654.     dllfunc(DLLFunc_Spawn, ent);
    655.  
    656.     new save = pev(ent, pev_solid);
    657.     dllfunc(DLLFunc_Touch, ent, index);
    658.     if (pev(ent, pev_solid) != save)
    659.         return ent;
    660.  
    661.     engfunc(EngFunc_RemoveEntity, ent);
    662.  
    663.     return -1;
    664. }
    665.  
    666. stock fm_cs_get_current_weapon_ent(id)
    667. {
    668.     if (pev_valid(id) != 2)
    669.         return -1;
    670.    
    671.     return get_pdata_cbase(id, OFFSET_ACTIVE_ITEM, OFFSET_LINUX);
    672. }
Nobody Is That Busy If They Make Time :roll:

raouf
Member
Member
Algeria
Posts: 34
Joined: 6 years ago
Contact:

#5

Post by raouf » 6 years ago

it can't be compiled .. it says : Could not locate output file compiled/ze_balrog_ethreal.amxx(compile failed)
and : fatar error 100: cannot read from file : cs_ham_bots_api

:(
I'm A muslim :)

allah akbar :D

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#6

Post by Raheem » 6 years ago

I removed this useless include so test now:
  • Code: Select all

    /*================================================================================
     
                --------------------------------
                [ZE] Extra Item: Balrog Ethereal
                --------------------------------
     
            Balrog Ethereal
            Copyright (C) 2017 by Crazy + ZE DEV TEAM
     
            -------------------
            -*- Description -*-
            -------------------
     
            This plugin add a new weapon into your zombie plague mod with
            the name of Balrog Ethereal. That weapon launch a powerfull beams!
            When the laser hit any object, a explosion effect with red color appers.
     
            ----------------
            -*- Commands -*-
            ----------------
     
            * zp_give_balrog_ethereal <target> - Give the item to target.
     
            -------------
            -*- Cvars -*-
            -------------
     
            * ze_balrog_ethereal_ammo <number> - Ammo amout.
            * ze_balrog_ethereal_clip <number> - Clip amout. (Max: 100)
            * ze_balrog_ethereal_one_round <0/1> - Only one round.
            * ze_balrog_ethereal_damage <number> - Damage multiplier.
            * ze_balrog_ethereal_unlimited <0/1> - Unlimited ammunition.
     
            ------------------
            -*- Change Log -*-
            ------------------
     
            * v1.5: (Mar 2017)
                - Updated all the code, added explosion effect, added new cvars;
     
            * v1.6: (Mar 2017)
                - Added custom weapon hud;
     
            ---------------
            -*- Credits -*-
            ---------------
     
            * MeRcyLeZZ: for the nice zombie plague mod.
            * Crazy: created the extra item code.
            * deanamx: for the nice weapon model.
            * And all zombie-mod players that use this weapon.
            * ZE DEV TEAM : For converting this Item
     
     
    =================================================================================*/
    #include <zombie_escape>
    #include <cstrike>
     
    /*================================================================================
     [Plugin Customization]
    =================================================================================*/
     
    // Item Name
    #define ITEM_NAME "Balrog Ethereal"
     
     
    /*================================================================================
     Customization ends here! Yes, that's it. Editing anything beyond
     here is not officially supported. Proceed at your own risk...
    =================================================================================*/
     
    new const PLUGIN_VERSION[] = "v1.6";
     
    new const V_BALROG_MDL[64] = "models/zombie_plague/v_balrog_ethereal.mdl";
    new const P_BALROG_MDL[64] = "models/zombie_plague/p_balrog_ethereal.mdl";
    new const W_BALROG_MDL[64] = "models/zombie_plague/w_balrog_ethereal.mdl";
     
    new const BALROG_SOUNDS[][] = { "weapons/ethereal_shoot.wav", "weapons/ethereal_reload.wav", "weapons/ethereal_idle1.wav", "weapons/ethereal_draw.wav" };
     
    new g_has_balrog[33], g_laser_sprite, g_balrog_exp, g_balrog, g_event_balrog, g_playername[33][32], g_maxplayers, g_primary_attack, g_balrog_reload_clip[33], cvar_balrog_clip, cvar_balrog_ammo, cvar_balrog_damage, cvar_balrog_oneround, cvar_balrog_unlimited;
     
    const BALROG_KEY = 0982478;
     
    const m_iClip = 51;
    const m_flNextAttack = 83;
    const m_fInReload = 54;
     
    const OFFSET_WEAPON_OWNER = 41;
    const OFFSET_LINUX_WEAPONS = 4;
    const OFFSET_LINUX = 5;
    const OFFSET_ACTIVE_ITEM = 373;
     
    const WEAPON_BITSUM = ((1<<CSW_SCOUT) | (1<<CSW_XM1014) | (1<<CSW_MAC10) | (1<<CSW_AUG) | (1<<CSW_UMP45) | (1<<CSW_SG550) | (1<<CSW_P90) | (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_GALIL));
     
    enum
    {
        idle = 0,
        reload,
        draw,
        shoot1,
        shoot2,
        shoot3
    }
     
    public plugin_init()
    {
        /* Plugin register */
        register_plugin("[ZE] Extra Item: Balrog Ethereal", PLUGIN_VERSION, "Crazy");
     
        /* Item register */
        g_balrog = ze_register_item("Balrog Ethereal", 10);
     
        /* Events */
        register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
     
        /* Messages */
        register_message(get_user_msgid("CurWeapon"), "message_cur_weapon");
     
        /* Forwards */
        register_forward(FM_UpdateClientData, "fw_UpdateData_Post", 1);
        register_forward(FM_SetModel, "fw_SetModel");
        register_forward(FM_PlaybackEvent, "fw_PlaybackEvent");
     
        /* Ham Forwards */
        RegisterHam(Ham_TraceAttack, "worldspawn", "fw_TraceAttack_Post", 1);
        RegisterHam(Ham_TraceAttack, "func_breakable", "fw_TraceAttack_Post", 1);
        RegisterHam(Ham_TraceAttack, "func_wall", "fw_TraceAttack_Post", 1);
        RegisterHam(Ham_TraceAttack, "func_door", "fw_TraceAttack_Post", 1);
        RegisterHam(Ham_TraceAttack, "func_door_rotating", "fw_TraceAttack_Post", 1);
        RegisterHam(Ham_TraceAttack, "func_plat", "fw_TraceAttack_Post", 1);
        RegisterHam(Ham_TraceAttack, "func_rotating", "fw_TraceAttack_Post", 1);
        RegisterHam(Ham_Item_Deploy, "weapon_ump45", "fw_Item_Deploy_Post", 1);
        RegisterHam(Ham_Item_AddToPlayer, "weapon_ump45", "fw_Item_AddToPlayer_Post", 1);
        RegisterHam(Ham_Item_PostFrame, "weapon_ump45", "fw_Item_PostFrame");
        RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_ump45", "fw_PrimaryAttack");
        RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_ump45", "fw_PrimaryAttack_Post", 1);
        RegisterHam(Ham_Weapon_Reload, "weapon_ump45", "fw_Reload");
        RegisterHam(Ham_Weapon_Reload, "weapon_ump45", "fw_Reload_Post", 1);
        RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
     
        /* Cvars */
        cvar_balrog_clip = register_cvar("ze_balrog_minigun_clip", "50");
        cvar_balrog_ammo = register_cvar("ze_balrog_minigun_ammo", "200");
        cvar_balrog_damage = register_cvar("ze_balrog_minigun_damage", "3.0");
        cvar_balrog_oneround = register_cvar("ze_balrog_minigun_one_round", "0");
        cvar_balrog_unlimited = register_cvar("ze_balrog_minigun_unlimited", "0");
     
        /* Max Players */
        g_maxplayers = get_maxplayers()
    }
     
    public plugin_precache()
    {
        engfunc(EngFunc_PrecacheModel, V_BALROG_MDL);
        engfunc(EngFunc_PrecacheModel, P_BALROG_MDL);
        engfunc(EngFunc_PrecacheModel, W_BALROG_MDL);
     
        engfunc(EngFunc_PrecacheGeneric, "sprites/weapon_bethereal.txt");
        engfunc(EngFunc_PrecacheGeneric, "sprites/640hud2_bethereal.spr");
        engfunc(EngFunc_PrecacheGeneric, "sprites/640hud10_bethereal.spr");
        engfunc(EngFunc_PrecacheGeneric, "sprites/640hud74_bethereal.spr");
     
        for (new i = 0; i < sizeof BALROG_SOUNDS; i++)
        engfunc(EngFunc_PrecacheSound, BALROG_SOUNDS[i]);
     
        g_laser_sprite = precache_model("sprites/laserbeam.spr");
        g_balrog_exp = precache_model("sprites/zombie_plague/balrog_ethereal_exp.spr");
     
        register_forward(FM_PrecacheEvent, "fw_PrecacheEvent_Post", 1);
        register_clcmd("weapon_bethereal", "cmd_balrog_selected");
    }
     
    public ze_user_infected(id)
    {
        g_has_balrog[id] = false;
    }
     
    public ze_user_humanized(id)
    {
        g_has_balrog[id] = false;
    }
     
    public client_putinserver(id)
    {
        g_has_balrog[id] = false;
     
        get_user_name(id, g_playername[id], charsmax(g_playername[]));
    }
     
    public event_round_start()
    {
        for (new id = 0; id <= g_maxplayers; id++)
        {
            if (get_pcvar_num(cvar_balrog_oneround))
            g_has_balrog[id] = false;
        }
    }
     
    public cmd_balrog_selected(client)
    {
        engclient_cmd(client, "weapon_ump45");
        return PLUGIN_HANDLED;
    }
     
    public message_cur_weapon(msg_id, msg_dest, msg_entity)
    {
        if (!is_user_alive(msg_entity))
            return;
     
        if (!g_has_balrog[msg_entity])
            return;
     
        if (get_user_weapon(msg_entity) != CSW_UMP45)
            return;
     
        if (get_msg_arg_int(1) != 1)
            return;
     
        if (get_pcvar_num(cvar_balrog_unlimited))
        {
            static ent;
            ent = fm_cs_get_current_weapon_ent(msg_entity);
     
            if (!pev_valid(ent))
                return;
     
            cs_set_weapon_ammo(ent, get_pcvar_num(cvar_balrog_clip));
            set_msg_arg_int(3, get_msg_argtype(3), get_pcvar_num(cvar_balrog_clip));
        }
    }
     
    public ze_select_item_pre(id, itemid)
    {
        // This not our item?
        if (itemid != g_balrog)
            return ZE_ITEM_AVAILABLE
       
        // Available for Humans only, So don't show it for zombies
        if (ze_is_user_zombie(id))
            return ZE_ITEM_DONT_SHOW
       
        // Finally return that it's available
        return ZE_ITEM_AVAILABLE
    }
     
    public ze_select_item_post(id, itemid)
    {
        if (itemid != g_balrog)
            return;
     
        if (g_has_balrog[id])
        {
            client_print(id, print_chat, "[ZE] You already have the %s.", ITEM_NAME);
            return;
        }
     
        give_balrog(id);
     
        client_print(id, print_chat, "[ZE] You bought the %s.", ITEM_NAME);
    }
     
    public fw_UpdateData_Post(id, sendweapons, cd_handle)
    {
        if (!is_user_alive(id))
            return FMRES_IGNORED;
     
        if (!g_has_balrog[id])
            return FMRES_IGNORED;
     
        if (get_user_weapon(id) != CSW_UMP45)
            return FMRES_IGNORED;
     
        set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001);
     
        return FMRES_IGNORED;
    }
     
    public fw_SetModel(ent, const model[])
    {
        if (!pev_valid(ent))
            return FMRES_IGNORED;
     
        if (!equal(model, "models/w_ump45.mdl"))
            return HAM_IGNORED;
     
        static class_name[33];
        pev(ent, pev_classname, class_name, charsmax(class_name));
     
        if (!equal(class_name, "weaponbox"))
            return FMRES_IGNORED;
     
        static owner, weapon;
        owner = pev(ent, pev_owner);
        weapon = find_ent_by_owner(-1, "weapon_ump45", ent);
     
        if (!g_has_balrog[owner] || !pev_valid(weapon))
            return FMRES_IGNORED;
     
        g_has_balrog[owner] = false;
     
        set_pev(weapon, pev_impulse, BALROG_KEY);
     
        engfunc(EngFunc_SetModel, ent, W_BALROG_MDL);
     
        return FMRES_SUPERCEDE;
    }
     
    public fw_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
    {
        if ((eventid != g_event_balrog) || !g_primary_attack)
            return FMRES_IGNORED;
     
        if (!(1 <= invoker <= g_maxplayers))
            return FMRES_IGNORED;
     
        playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2);
     
        return FMRES_SUPERCEDE;
    }
     
    public fw_PrecacheEvent_Post(type, const name[])
    {
        if (!equal("events/ump45.sc", name))
            return HAM_IGNORED;
     
        g_event_balrog = get_orig_retval()
     
        return FMRES_HANDLED;
    }
     
    public fw_Item_Deploy_Post(ent)
    {
        if (!pev_valid(ent))
            return HAM_IGNORED;
     
        new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
     
        if (!is_user_alive(id))
            return HAM_IGNORED;
     
        if (!g_has_balrog[id])
            return HAM_IGNORED;
     
        set_pev(id, pev_viewmodel2, V_BALROG_MDL);
        set_pev(id, pev_weaponmodel2, P_BALROG_MDL);
     
        play_weapon_anim(id, draw);
     
        return HAM_IGNORED;
    }
     
    public fw_Item_AddToPlayer_Post(ent, id)
    {
        if (!pev_valid(ent))
            return HAM_IGNORED;
     
        if (!is_user_alive(id))
            return HAM_IGNORED;
     
        if (pev(ent, pev_impulse) == BALROG_KEY)
        {
            g_has_balrog[id] = true;
            set_pev(ent, pev_impulse, 0);
        }
     
        message_begin(MSG_ONE, get_user_msgid("WeaponList"), _, id)
        write_string((g_has_balrog[id] ? "weapon_bethereal" : "weapon_ump45"))
        write_byte(6)
        write_byte(100)
        write_byte(-1)
        write_byte(-1)
        write_byte(0)
        write_byte(15)
        write_byte(CSW_UMP45)
        write_byte(0)
        message_end()
     
        return HAM_IGNORED;
    }
     
    public fw_Item_PostFrame(ent)
    {
        if (!pev_valid(ent))
            return HAM_IGNORED;
     
        new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
     
        if (!is_user_alive(id))
            return HAM_IGNORED;
     
        if (!g_has_balrog[id])
            return HAM_IGNORED;
     
        static cvar_clip; cvar_clip = get_pcvar_num(cvar_balrog_clip);
     
        new clip = get_pdata_int(ent, m_iClip, OFFSET_LINUX_WEAPONS);
        new bpammo = cs_get_user_bpammo(id, CSW_UMP45);
     
        new Float:flNextAttack = get_pdata_float(id, m_flNextAttack, OFFSET_LINUX);
        new fInReload = get_pdata_int(ent, m_fInReload, OFFSET_LINUX_WEAPONS);
     
        if (fInReload && flNextAttack <= 0.0)
        {
            new temp_clip = min(cvar_clip - clip, bpammo);
     
            set_pdata_int(ent, m_iClip, clip + temp_clip, OFFSET_LINUX_WEAPONS);
     
            cs_set_user_bpammo(id, CSW_UMP45, bpammo-temp_clip);
     
            set_pdata_int(ent, m_fInReload, 0, OFFSET_LINUX_WEAPONS);
     
            fInReload = 0;
        }
     
        return HAM_IGNORED;
    }
     
    public fw_PrimaryAttack(ent)
    {
        if (!pev_valid(ent))
            return HAM_IGNORED;
     
        new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
     
        if (!is_user_alive(id))
            return HAM_IGNORED;
     
        if (!g_has_balrog[id])
            return HAM_IGNORED;
     
        if (!cs_get_weapon_ammo(ent))
            return HAM_IGNORED;
     
        g_primary_attack = true;
     
        return HAM_IGNORED;
    }
     
    public fw_PrimaryAttack_Post(ent)
    {
        if (!pev_valid(ent))
            return HAM_IGNORED;
     
        new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
     
        if (!is_user_alive(id))
            return HAM_IGNORED;
     
        if (!g_has_balrog[id])
            return HAM_IGNORED;
     
        if (!cs_get_weapon_ammo(ent))
            return HAM_IGNORED;
     
        g_primary_attack = false;
     
        play_weapon_anim(id, random_num(shoot1, shoot3));
     
        emit_sound(id, CHAN_WEAPON, BALROG_SOUNDS[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
     
        make_laser_beam(id, 7, 100, 0, 0);
     
        return HAM_IGNORED;
    }
     
    public fw_Reload(ent)
    {
        if (!pev_valid(ent))
            return HAM_IGNORED;
     
        new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
     
        if (!is_user_alive(id))
            return HAM_IGNORED;
     
        if (!g_has_balrog[id])
            return HAM_IGNORED;
     
        static cvar_clip;
     
        if (g_has_balrog[id])
            cvar_clip = get_pcvar_num(cvar_balrog_clip);
     
        g_balrog_reload_clip[id] = -1;
     
        new clip = get_pdata_int(ent, m_iClip, OFFSET_LINUX_WEAPONS);
        new bpammo = cs_get_user_bpammo(id, CSW_UMP45);
     
        if (bpammo <= 0)
            return HAM_SUPERCEDE;
     
        if (clip >= cvar_clip)
            return HAM_SUPERCEDE;
       
        g_balrog_reload_clip[id] = clip;
     
        return HAM_IGNORED;
    }
     
    public fw_Reload_Post(ent)
    {
        if (!pev_valid(ent))
            return HAM_IGNORED;
     
        new id = get_pdata_cbase(ent, OFFSET_WEAPON_OWNER, OFFSET_LINUX_WEAPONS);
     
        if (!is_user_alive(id))
            return HAM_IGNORED;
     
        if (!g_has_balrog[id])
            return HAM_IGNORED;
     
        if (g_balrog_reload_clip[id] == -1)
            return HAM_IGNORED;
     
        set_pdata_int(ent, m_iClip, g_balrog_reload_clip[id], OFFSET_LINUX_WEAPONS);
        set_pdata_int(ent, m_fInReload, 1, OFFSET_LINUX_WEAPONS);
     
        play_weapon_anim(id, reload);
     
        return HAM_IGNORED;
    }
     
    public fw_TakeDamage(victim, inflictor, attacker, Float:damage, dmg_bits)
    {
        if (!is_user_alive(attacker))
            return HAM_IGNORED;
     
        if (!g_has_balrog[attacker])
            return HAM_IGNORED;
     
        if (get_user_weapon(attacker) != CSW_UMP45)
            return HAM_IGNORED;
     
        SetHamParamFloat(OFFSET_LINUX_WEAPONS, damage * get_pcvar_float(cvar_balrog_damage));
     
        make_explosion_effect(attacker);
     
        return HAM_IGNORED;
    }
     
    public fw_TraceAttack_Post(ent, attacker, Float:damage, Float:dir[3], ptr, dmg_bits)
    {
        if (!is_user_alive(attacker))
            return HAM_IGNORED;
     
        if (get_user_weapon(attacker) != CSW_UMP45)
            return HAM_IGNORED;
     
        if (!g_has_balrog[attacker])
            return HAM_IGNORED;
     
        make_explosion_effect(attacker);
     
        return HAM_IGNORED;
    }
     
    give_balrog(id)
    {
        drop_primary(id);
     
        g_has_balrog[id] = true;
     
        new weapon = fm_give_item(id, "weapon_ump45");
     
        cs_set_weapon_ammo(weapon, get_pcvar_num(cvar_balrog_clip));
        cs_set_user_bpammo(id, CSW_UMP45, get_pcvar_num(cvar_balrog_ammo));
    }
     
    play_weapon_anim(id, frame)
    {
        set_pev(id, pev_weaponanim, frame);
     
        message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = id)
        write_byte(frame)
        write_byte(pev(id, pev_body))
        message_end()
    }
     
    make_laser_beam(id, Size, R, G, B)
    {
        static End[3];
        get_user_origin(id, End, 3);
       
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte (TE_BEAMENTPOINT)
        write_short( id |0x1000 )
        write_coord(End[0])
        write_coord(End[1])
        write_coord(End[2])
        write_short(g_laser_sprite)
        write_byte(0)
        write_byte(1)
        write_byte(1)
        write_byte(Size)
        write_byte(4)
        write_byte(R)
        write_byte(G)
        write_byte(B)
        write_byte(255)
        write_byte(0)
        message_end()
    }
     
    make_explosion_effect(id)
    {
        static end[3];
        get_user_origin(id, end, 3);
     
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(3)
        write_coord(end[0])
        write_coord(end[1])
        write_coord(end[2])
        write_short(g_balrog_exp)
        write_byte(10)
        write_byte(15)
        write_byte(4)
        message_end()
    }
     
    drop_primary(id)
    {
        static weapons[32], num;
        get_user_weapons(id, weapons, num);
     
        for (new i = 0; i < num; i++)
        {
            if (WEAPON_BITSUM & (1<<weapons[i]))
            {
                static wname[32];
                get_weaponname(weapons[i], wname, sizeof wname - 1);
     
                engclient_cmd(id, "drop", wname);
            }
        }
    }
     
    stock fm_give_item(index, const item[])
    {
        if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
            return 0;
     
        new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item));
        if (!pev_valid(ent))
            return 0;
     
        new Float:origin[3];
        pev(index, pev_origin, origin);
        set_pev(ent, pev_origin, origin);
        set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
        dllfunc(DLLFunc_Spawn, ent);
     
        new save = pev(ent, pev_solid);
        dllfunc(DLLFunc_Touch, ent, index);
        if (pev(ent, pev_solid) != save)
            return ent;
     
        engfunc(EngFunc_RemoveEntity, ent);
     
        return -1;
    }
     
    stock fm_cs_get_current_weapon_ent(id)
    {
        if (pev_valid(id) != 2)
            return -1;
       
        return get_pdata_cbase(id, OFFSET_ACTIVE_ITEM, OFFSET_LINUX);
    }
Use our official compiler: http://escapers-zone.xyz/viewtopic.php?f=6&t=221
He who fails to plan is planning to fail

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#7

Post by johnnysins2000 » 6 years ago

raouf wrote: 6 years ago it can't be compiled .. it says : Could not locate output file compiled/ze_balrog_ethreal.amxx(compile failed)
and : fatar error 100: cannot read from file : cs_ham_bots_api

:(

Aa sorry I forgot to remove This Useless include Try Raheem's code
Nobody Is That Busy If They Make Time :roll:

raouf
Member
Member
Algeria
Posts: 34
Joined: 6 years ago
Contact:

#8

Post by raouf » 6 years ago

i compile it . and it works !!!

thank you for the help

only a question : can i post this plugin in Extra-Items forum ?
I'm A muslim :)

allah akbar :D

johnnysins2000
Veteran Member
Veteran Member
Paraguay
Posts: 678
Joined: 7 years ago
Location: Paraguay
Contact:

#9

Post by johnnysins2000 » 6 years ago

:(
raouf wrote: 6 years ago i compile it . and it works !!!

thank you for the help

only a question : can i post this plugin in Extra-Items forum ?
Yes Post it But Make Sure That U try to post it with the style Raheem Does !
Nobody Is That Busy If They Make Time :roll:

User avatar
Night Fury
Mod Developer
Mod Developer
Posts: 677
Joined: 7 years ago
Contact:

#10

Post by Night Fury » 6 years ago

raouf wrote: 6 years ago i compile it . and it works !!!

thank you for the help

only a question : can i post this plugin in Extra-Items forum ?
You're able to share any extra item whether you converted or made..Just make sure to post with good style, optimized code (as you can).
If you're gonna share extra item which you requested to convert then you should refer this thread as the solution with the extra item's thread.
Want your own mod edition? PM me.
Accepting private projects.
Discord: Fury#7469
Image

raouf
Member
Member
Algeria
Posts: 34
Joined: 6 years ago
Contact:

#11

Post by raouf » 6 years ago

Jack GamePlay wrote: 6 years ago
raouf wrote: 6 years ago i compile it . and it works !!!

thank you for the help

only a question : can i post this plugin in Extra-Items forum ?
You're able to share any extra item whether you converted or made..Just make sure to post with good style, optimized code (as you can).
If you're gonna share extra item which you requested to convert then you should refer this thread as the solution with the extra item's thread.
That means i can't post it or i can ?
I'm A muslim :)

allah akbar :D

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#12

Post by Raheem » 6 years ago

Yeah post it.
He who fails to plan is planning to fail

raouf
Member
Member
Algeria
Posts: 34
Joined: 6 years ago
Contact:

#13

Post by raouf » 6 years ago

Ok , Thank you :)
I'm A muslim :)

allah akbar :D

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest