Reklam gösterimini engelleyici yazılım kullandığınızı görüyoruz.
Sitemizin ayakta kalıp sizlere hizmet edebilmek için en büyük gelir kaynağı sayfamızda gösterilen reklamlardır.
Reklam gösterimde bizim sayfamıza ayrıcalık tanıyarak ayakta kalmamıza destek olmak ister misiniz ?

Silinmiş Konu   | extra weapon mermi doldurmuyor

1
354

Konu

#1
Son Düzenleme: 22-08-2018, Saat: 19:19, Düzenleyen: Groot.
Merhabalar
arkadaşlar m3 dragon silahı 8 merisi ve 32 sarjoru var 
8 defa ateş ettikten sonra mermisi bitince sarjor doldurmuyor buga giriyor bakabilirmisiniz

eklenti

PHP Kod:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <xs>
#include <cstrike>
#include <zombieplague>

// Mofiying Plugin Info Will Violate CopyRight///
#define PLUGIN "[Z47] M3 Black Dragon"       /////
#define VERSION "1.1"                      /////
#define AUTHOR "ZinoZack47"                 /////
/////////////////////////////////////////////

#define MBD_WEAPONKEY                    2346647

#define WEAP_LINUX_XTRA_OFF                4
#define PLAYER_LINUX_XTRA_OFF            5

#define m_pPlayer                         41
#define m_flNextPrimaryAttack             46
#define m_flNextSecondaryAttack         47
#define m_flTimeWeaponIdle                48
#define m_iClip                            51
#define m_fInReload                        54
#define m_fInSpecialReload                 55
#define m_flNextReload                    75

#define m_flNextAttack                    83
#define m_pActiveItem                     373

#define OFFSET_M3_AMMO                   381

#define MBD_DRAW_TIME                     1.0

#define CSW_MBD                         CSW_M3
#define weapon_mbd                        "weapon_m3"

#define  MBD_FIRE_CLASSNAME             "mbd_fire"
#define  MBD_EGG_CLASSNAME                 "mbd_egg"
#define  MBD_DRAGON_CLASSNAME             "mbd_dragon"

const i_LastHitGroup 75
const pev_life pev_fuser1

enum
{
    
MODE_NORMAL,
    
MODE_NORMAL2,
    
MODE_FIRE
}

enum
{
    
MBD_IDLE 0,
    
MBD_SHOOT,
    
MBD_SHOOT2,
    
MBD_INSERT,
    
MBD_AFTER_RELOAD,
    
MBD_BEFORE_RELOAD,
    
MBD_DRAW,
    
MBD_SECONDARY_READY,
    
MBD_SECONDARY_SHOOT,
    
MBD_SECONDARY_INSERT,
    
MBD_SECONDARY_AFTER_RELOAD,
    
MBD_SECONDARY_BEFORE_RELOAD,
    
MBD_SECONDARY_DRAW
}

new 
MBD_V_MODEL[64] = "models/v_m3dragon.mdl"
new MBD_P_MODEL[64] = "models/p_m3dragon.mdl"
new MBD_W_MODEL[64] = "models/w_m3dragon.mdl"

new const MBD_Sounds[][] = 
{
    
"weapons/m3dragon-1_1.wav",
    
"weapons/m3dragon-1_2.wav",
    
"weapons/m3dragon-2.wav",
    
"weapons/m3dragon_secondary_draw.wav",
    
"weapons/m3dragon_reload_insert.wav",
    
"weapons/m3dragon_after_reload.wav",
    
"weapons/m3dragon_fire_loop.wav",
    
"weapons/m3dragon_dragon_fx.wav",
    
"weapons/m3dragon_exp.wav"
}

new const 
MBD_Effects[][] = 
{
    
"models/ef_fireball2.mdl",
    
"models/m3dragon_effect.mdl"
}

new const 
MBD_Sprites[][] = 
{
    
"sprites/weapon_m3dragon.txt",
    
"sprites/640hud18_47.spr",
    
"sprites/640hud19.spr",
    
"sprites/640hud43.spr",
    
"sprites/m3dragon_flame.spr",
    
"sprites/m3dragon_flame2.spr"
}

new const 
GUNSHOT_DECALS[] = { 4142434445 }

new 
cvar_dmg_mbdcvar_recoil_mbdg_itemidcvar_clip_mbdcvar_mbd_ammocvar_one_round
new g_maxplayersg_orig_event_mbdg_IsInPrimaryAttackg_iClipg_clip_counter[33]
new 
Float:cl_pushangle[33][3], m_iBlood[2]
new 
bool:g_has_mbd[33], g_clip_ammo[33], g_current_mode[33], g_MBDFire[33][2]
new 
g_MsgWeaponListg_MsgCurWeapon

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)

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_message(get_user_msgid("DeathMsg"), "message_DeathMsg")

    
register_event("HLTV""Event_NewRound""a""1=0""2=0")
    
RegisterHam(Ham_Killed"player""fw_Killed")
    
RegisterHam(Ham_Item_Deployweapon_mbd"fw_Item_Deploy_Post"1)
    
RegisterHam(Ham_Weapon_PrimaryAttackweapon_mbd"fw_M3Dragon_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttackweapon_mbd"fw_M3Dragon_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Item_PostFrameweapon_mbd"fw_M3Dragon_ItemPostFrame")
    
RegisterHam(Ham_Weapon_Reloadweapon_mbd"fw_M3Dragon_Reload")
    
RegisterHam(Ham_Item_AddToPlayerweapon_mbd"fw_M3Dragon_AddToPlayer")
    
RegisterHam(Ham_Weapon_WeaponIdleweapon_mbd"fw_M3Dragon_WeaponIdle_Post"1)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
RegisterHam(Ham_TraceAttack"worldspawn""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_breakable""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_wall""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_door""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_door_rotating""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_plat""fw_TraceAttack"1)
    
RegisterHam(Ham_TraceAttack"func_rotating""fw_TraceAttack"1)

    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")
    
register_forward(FM_Think"fw_Think")
    
register_forward(FM_Touch"fw_Touch")
    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)
    
register_forward(FM_PlaybackEvent"fw_PlaybackEvent")

    
cvar_clip_mbd register_cvar("zp_m3blackdragon_clip""8")
    
cvar_mbd_ammo register_cvar("zp_m3blackdragon_ammo""12")
    
cvar_dmg_mbd register_cvar("zp_m3blackdragon_dmg""500")
    
cvar_recoil_mbd register_cvar("zp_m3blackdragon_recoil""0.6")
    
cvar_one_round register_cvar("zp_m3blackdragon_one_round""0")

    
g_MsgWeaponList get_user_msgid("WeaponList")
    
g_MsgCurWeapon get_user_msgid("CurWeapon")

    
g_itemid zp_register_extra_item("M3 Black Dragon"10ZP_TEAM_HUMAN)

    
register_clcmd("weapon_m3dragon""select_m3dragon")
    
g_maxplayers get_maxplayers()
}

public 
plugin_precache()
{
    
precache_model(MBD_V_MODEL)
    
precache_model(MBD_P_MODEL)
    
precache_model(MBD_W_MODEL)

    for(new 
0sizeof(MBD_Sounds); i++)
        
precache_sound(MBD_Sounds[i])    
    
    for(new 
0sizeof(MBD_Sprites); i++)
        
<= <= precache_generic(MBD_Sprites[i]) : precache_model(MBD_Sprites[i])

    for(new 
0sizeof(MBD_Effects); i++)
        
precache_model(MBD_Effects[i])

    
m_iBlood[0] = precache_model("sprites/blood.spr")
    
m_iBlood[1] = precache_model("sprites/bloodspray.spr")
    
    
register_forward(FM_PrecacheEvent"fw_PrecacheEvent_Post"1)

}

public 
plugin_natives ()
    
register_native("give_weapon_mbd""native_give_weapon_add"1)

public 
native_give_weapon_add(id)
    
give_m3dragon(id)

public 
select_m3dragon(id)
{
 
   engclient_cmd(idweapon_mbd)
 
   return PLUGIN_HANDLED
}

public 
fw_PrecacheEvent_Post(type, const name[])
{
    new 
weapon[32], event_mbd[64]
    
    
copy(weaponcharsmax(weapon), weapon_mbd)
    
replace(weaponcharsmax(weapon), "weapon_""")

    
formatex(event_mbdcharsmax(event_mbd), "events/%s.sc"weapon)

    if (
equal(event_mbdname))
    {
        
g_orig_event_mbd get_orig_retval()
        return 
FMRES_HANDLED
    
}

    return 
FMRES_IGNORED
}

public 
Event_NewRound()
{
    for(new 
id 0id <= g_maxplayersid++)
    {
        if(!
g_has_mbd[id])

        if(
get_pcvar_num(cvar_one_round))
            
remove_m3dragon(id)
    }
}

public 
fw_Killed(id)
    
remove_m3dragon(id)

public 
zp_user_humanized_post(id)
    
remove_m3dragon(id)

public 
client_disconnect(id)
    
remove_m3dragon(id)

public 
zp_user_infected_post(id)
    
remove_m3dragon(id)


public 
fw_SetModel(entitymodel[])
{
    if(!
pev_valid(entity))
        return 
FMRES_IGNORED

    
static weapon[32], old_mbd[64]

    if(!
fm_is_ent_classname(entity"weaponbox"))
        return 
FMRES_IGNORED

    copy
(weaponcharsmax(weapon), weapon_mbd)
    
replace(weaponcharsmax(weapon), "weapon_""")

    
formatex(old_mbdcharsmax(old_mbd), "models/w_%s.mdl"weapon)

    static 
owner
    owner 
pev(entitypev_owner)

    if(
equal(modelold_mbd))
    {
        static 
StoredWepID
        
        StoredWepID 
fm_find_ent_by_owner(-1weapon_mbdentity)
    
        if(!
pev_valid(StoredWepID))
            return 
FMRES_IGNORED
    
        
if(g_has_mbd[owner])
        {
            
set_pev(StoredWepIDpev_impulseMBD_WEAPONKEY)

            
remove_m3dragon(owner)

            
engfunc(EngFunc_SetModelentityMBD_W_MODEL)
                        
            return 
FMRES_SUPERCEDE
        
}
    }
    return 
FMRES_IGNORED
}

public 
give_m3dragon(id)
{
    
drop_weapons(id1)

    
g_has_mbd[id] = true
    g_current_mode
[id] = MODE_NORMAL

    fm_give_item
(idweapon_mbd)
    
    static 
weaponweapon fm_get_user_weapon_entity(idCSW_MBD)

    if(
pev_valid(weapon)) cs_set_weapon_ammo(weaponget_pcvar_num(cvar_clip_mbd))    

    
message_begin(MSG_ONE_UNRELIABLEg_MsgWeaponList, .player id)
    
write_string("weapon_m3dragon")
    
write_byte(5)
    
write_byte(32)
    
write_byte(-1)
    
write_byte(-1)
    
write_byte(0
    
write_byte(5)
    
write_byte(CSW_MBD)
    
write_byte(0)
    
message_end()
    
    
message_begin(MSG_ONE_UNRELIABLEg_MsgCurWeapon, .player id)
    
write_byte(1)
    
write_byte(CSW_MBD)
    
write_byte(get_pcvar_num(cvar_clip_mbd))
    
message_end()

    
cs_set_user_bpammo(idCSW_MBDget_pcvar_num(cvar_mbd_ammo))

    
make_fire(id)
}

public 
remove_m3dragon(id)
{
    
g_has_mbd[id] = false
    g_current_mode
[id] = MODE_NORMAL
    g_clip_counter
[id] = 0
    
    
if (pev_valid(g_MBDFire[id][0]) && pev_valid(g_MBDFire[id][1]))
    {
        
engfunc(EngFunc_RemoveEntityg_MBDFire[id][0])
        
g_MBDFire[id][0] = 0
        engfunc
(EngFunc_RemoveEntityg_MBDFire[id][1])
        
g_MBDFire[id][1] = 0
    
}

}

public 
fw_TraceAttack(iEntiAttackerFloat:flDamageFloat:fDir[3], ptriDamageType)
{
    if(!
is_user_alive(iAttacker))
        return 
HAM_IGNORED

    
new g_currentweapon get_user_weapon(iAttacker)

    if(
g_currentweapon != CSW_MBD || !g_has_mbd[iAttacker])
        return 
HAM_IGNORED

    
static Float:flEnd[3]
    
get_tr2(ptrTR_vecEndPosflEnd)

    if(
iEnt)
    {
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_DECAL)
        
engfunc(EngFunc_WriteCoordflEnd[0])
        
engfunc(EngFunc_WriteCoordflEnd[1])
        
engfunc(EngFunc_WriteCoordflEnd[2])
        
write_byte(GUNSHOT_DECALS[random_num (0sizeof GUNSHOT_DECALS -1)])
        
write_short(iEnt)
        
message_end()
    }
    else
    {
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_WORLDDECAL)
        
engfunc(EngFunc_WriteCoordflEnd[0])
        
engfunc(EngFunc_WriteCoordflEnd[1])
        
engfunc(EngFunc_WriteCoordflEnd[2])
        
write_byte(GUNSHOT_DECALS[random_num (0sizeof GUNSHOT_DECALS -1)])
        
message_end()
    }

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_GUNSHOTDECAL)
    
engfunc(EngFunc_WriteCoordflEnd[0])
    
engfunc(EngFunc_WriteCoordflEnd[1])
    
engfunc(EngFunc_WriteCoordflEnd[2])
    
write_short(iAttacker)
    
write_byte(GUNSHOT_DECALS[random_num (0sizeof GUNSHOT_DECALS -1)])
    
message_end()

    return 
HAM_IGNORED
}

public 
zp_extra_item_selected(iditemid)
{
    if(
itemid != g_itemid)
        return

    
give_m3dragon(id)
}

public 
fw_M3Dragon_AddToPlayer(itemid)
{
    if(!
pev_valid(item))
        return 
HAM_IGNORED

    
switch(pev(itempev_impulse))
    {
        case 
0:
        {
            
message_begin(MSG_ONEg_MsgWeaponList, .player id)
            
write_string(weapon_mbd)
            
write_byte(5)
            
write_byte(32)
            
write_byte(-1)
            
write_byte(-1)
            
write_byte(0
            
write_byte(5)
            
write_byte(CSW_MBD)
            
write_byte(0)
            
message_end()
            
            return 
HAM_IGNORED
        
}
        case 
MBD_WEAPONKEY:
        {
            
g_has_mbd[id] = true
            
            message_begin
(MSG_ONEg_MsgWeaponList, .player id)
            
write_string("weapon_m3dragon")
            
write_byte(5)
            
write_byte(32)
            
write_byte(-1)
            
write_byte(-1)
            
write_byte(0
            
write_byte(5)
            
write_byte(CSW_MBD)
            
write_byte(0)
            
message_end()

            
set_pev(itempev_impulse0)
            
            return 
HAM_HANDLED
        
}
    }

    return 
HAM_IGNORED
}

public 
fw_Item_Deploy_Post(weapon_ent)
{
    if(
pev_valid(weapon_ent) != 2)
        return

    static 
id
    id 
fm_cs_get_weapon_ent_owner(weapon_ent)
    
    if(
fm_cs_get_current_weapon_ent(id) != weapon_ent)
        return

    if(!
g_has_mbd[id])
        return

    
set_pev(idpev_viewmodel2MBD_V_MODEL)
    
set_pev(idpev_weaponmodel2MBD_P_MODEL)

    switch(
g_current_mode[id])
    {
        case 
MODE_NORMALMODE_NORMAL2fm_play_weapon_animation(idMBD_DRAW)
        case 
MODE_FIREfm_play_weapon_animation(idMBD_SECONDARY_DRAW)
    }

    
fm_set_weapon_idle_time(idweapon_mbdMBD_DRAW_TIME)
}

public 
fw_M3Dragon_WeaponIdle_Post(iEnt)
{
    if(
pev_valid(iEnt) != 2)
        return 
HAM_IGNORED

    
new id fm_cs_get_weapon_ent_owner(iEnt)

    if(
fm_cs_get_current_weapon_ent(id) != iEnt)
        return 
HAM_IGNORED

    
if (!g_has_mbd[id])
        return 
HAM_IGNORED;

    if(
get_pdata_float(iEntm_flTimeWeaponIdleWEAP_LINUX_XTRA_OFF) > 0.0 )
        return 
HAM_IGNORED
    
    
new iClip get_pdata_int(iEntm_iClipWEAP_LINUX_XTRA_OFF)
    new 
iMaxClip get_pcvar_num(cvar_clip_mbd)
    new 
fInSpecialReload get_pdata_int(iEntm_fInSpecialReloadWEAP_LINUX_XTRA_OFF)

    if(!
iClip && !fInSpecialReload)
        return 
HAM_IGNORED

    
if(fInSpecialReload)
    {
        static 
iBpAmmoiBpAmmo get_pdata_int(idOFFSET_M3_AMMOPLAYER_LINUX_XTRA_OFF)

        if(
iClip iMaxClip && iClip == && iBpAmmo)
            
Shotgun_Reload(iEntiMaxClipiClipiBpAmmoid)

        else if(
iClip == iMaxClip && iClip != 8)
        {
            
fm_play_weapon_animation(idg_current_mode[id] == MODE_FIRE MBD_SECONDARY_AFTER_RELOAD MBD_AFTER_RELOAD)
            
            
set_pdata_int(iEntm_fInSpecialReload0WEAP_LINUX_XTRA_OFF)
            
set_pdata_float(iEntm_flTimeWeaponIdle1.5WEAP_LINUX_XTRA_OFF)
        }

    }
    else
    {
        switch(
g_current_mode[id])
        {
            case 
MODE_NORMALMODE_NORMAL2fm_play_weapon_animation(idMBD_IDLE)
            case 
MODE_FIREfm_play_weapon_animation(idMBD_SECONDARY_READY)
        }
    }
    return 
HAM_IGNORED
}

public 
fw_UpdateClientData_Post(idSendWeaponsCD_Handle)
{
    if(!
is_user_alive(id) || get_user_weapon(id) != CSW_MBD || !g_has_mbd[id])
        return 
FMRES_IGNORED
    
    set_cd
(CD_HandleCD_flNextAttackget_gametime() + 0.001)
    return 
FMRES_HANDLED
}

public 
fw_M3Dragon_PrimaryAttack(Weapon)
{
    new 
id fm_cs_get_weapon_ent_owner(Weapon)
    
    if (!
g_has_mbd[id])
        return 
HAM_IGNORED

    g_IsInPrimaryAttack 
1
    pev
(idpev_punchanglecl_pushangle[id])

    
g_clip_ammo[id] = cs_get_weapon_ammo(Weapon)
    
g_iClip cs_get_weapon_ammo(Weapon)

    return 
HAM_IGNORED
}

public 
fw_PlaybackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:angles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if (
eventid != g_orig_event_mbd || !g_IsInPrimaryAttack)
        return 
FMRES_IGNORED
    
    
if (!(<= invoker <= g_maxplayers))
 
       return FMRES_IGNORED

    engfunc
(EngFunc_PlaybackEventflags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    return 
FMRES_SUPERCEDE
}

public 
fw_M3Dragon_PrimaryAttack_Post(Weapon)
{
    
g_IsInPrimaryAttack 0
    
new id fm_cs_get_weapon_ent_owner(Weapon)
    
    if(!
is_user_alive(id))
        return 
HAM_IGNORED

    
new szClipszAmmo
    get_user_weapon
(idszClipszAmmo)

    if(
g_iClip <= cs_get_weapon_ammo(Weapon))
        return 
HAM_IGNORED

    
if(g_has_mbd[id])
    {
        if (!
g_clip_ammo[id])
            return 
HAM_IGNORED

        
new Float:push[3]

        
pev(id,pev_punchangle,push)
        
xs_vec_sub(push,cl_pushangle[id],push)

        
xs_vec_mul_scalar(pushget_pcvar_float(cvar_recoil_mbd), push)
        
xs_vec_add(pushcl_pushangle[id], push)
        
set_pev(id,pev_punchanglepush)

        switch(
g_current_mode[id])
        {
            case 
MODE_NORMAL:
            {
                
fm_play_weapon_animation(idMBD_SHOOT)
                
emit_sound(idCHAN_WEAPONMBD_Sounds[MODE_NORMAL], VOL_NORMATTN_NORM0PITCH_NORM)
            }
            case 
MODE_NORMAL2:
            {
                
fm_play_weapon_animation(idMBD_SHOOT2)
                
emit_sound(idCHAN_WEAPONMBD_Sounds[MODE_NORMAL2], VOL_NORMATTN_NORM0PITCH_NORM)
            }
            case 
MODE_FIRE
            {
                
fm_play_weapon_animation(idMBD_SECONDARY_SHOOT)
                
emit_sound(idCHAN_WEAPONMBD_Sounds[MODE_FIRE], VOL_NORMATTN_NORM0PITCH_NORM)
            }
        }
        
    }

    return 
HAM_IGNORED
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamagetype)
{
    if (
victim != attacker && is_user_connected(attacker))
    {
        if(
get_user_weapon(attacker) == CSW_MBD)
        {
            if(
g_has_mbd[attacker])
            {
                new 
g_HitGroup get_pdata_int(victimi_LastHitGroup)
                switch(
g_HitGroup)
                {
                    case 
HIT_HEADdamage get_pcvar_num(cvar_dmg_mbd) * 2.0
                    
case HIT_LEFTARM .. HIT_RIGHTLEGdamage get_pcvar_num(cvar_dmg_mbd) * 0.75
                    
case HIT_CHESTHIT_STOMACHdamage float(get_pcvar_num(cvar_dmg_mbd))
                }
                if(~
damagetype DMG_SLASH)
                    
Check_Counter(attacker)
                
                
SetHamParamFloat(4damage)        
            }
        }
    }
}

public 
message_DeathMsg(msg_idmsg_destid)
{
    static 
TruncatedWeapon[33], iAttackeriVictimweapon[32]
    
    
copy(weaponcharsmax(weapon), weapon_mbd)
    
replace(weaponcharsmax(weapon), "weapon_""")

    
get_msg_arg_string(4TruncatedWeaponcharsmax(TruncatedWeapon))

    
iAttacker get_msg_arg_int(1)
    
iVictim get_msg_arg_int(2)

    if(!
is_user_connected(iAttacker) || iAttacker == iVictim)
        return 
PLUGIN_CONTINUE

    
if(equal(TruncatedWeaponweapon) && get_user_weapon(iAttacker) == CSW_MBD && g_has_mbd[iAttacker])
            
set_msg_arg_string(4"m3dragon")

    return 
PLUGIN_CONTINUE
}

public 
fw_M3Dragon_ItemPostFrame(weapon_entity
{
    if(!
pev_valid(weapon_entity))
        return 
HAM_IGNORED
        
    
new id fm_cs_get_weapon_ent_owner(weapon_entity)

    if (!
is_user_connected(id))
        return 
HAM_IGNORED

    
if (!g_has_mbd[id])
        return 
HAM_IGNORED

    
new iClipExtra get_pcvar_num(cvar_clip_mbd)
    new 
Float:flNextAttack get_pdata_float(idm_flNextAttackPLAYER_LINUX_XTRA_OFF)

    new 
iBpAmmo cs_get_user_bpammo(idCSW_MBD)
    new 
iClip get_pdata_int(weapon_entitym_iClipWEAP_LINUX_XTRA_OFF)
    new 
iButton pev(idpev_button)
    new 
fInReload get_pdata_int(weapon_entitym_fInReloadWEAP_LINUX_XTRA_OFF

    if(
fInReload && flNextAttack <= 0.0)
    {
        new 
min(iClipExtra iClipiBpAmmo)
        
set_pdata_int(weapon_entitym_iClipiClip jWEAP_LINUX_XTRA_OFF)
        
set_pdata_int(idOFFSET_M3_AMMOiBpAmmo-jPLAYER_LINUX_XTRA_OFF)
        
set_pdata_int(weapon_entitym_fInReload0WEAP_LINUX_XTRA_OFF)

        
cs_set_weapon_ammo(weapon_entityget_pcvar_num(cvar_clip_mbd))
    }

    
M3Dragon_Dance(idweapon_entityiButton)

    return 
HAM_IGNORED
}

public 
fw_PlayerPreThink(id)
{
    if(
get_user_weapon(id) != CSW_MBD || !g_has_mbd[id])
        return 
FMRES_IGNORED

    
if(g_current_mode[id] == MODE_FIRE)
    {
        if (
pev_valid(g_MBDFire[id][0]) && pev_valid(g_MBDFire[id][1]))
        {
            
fm_set_entity_visibility(g_MBDFire[id][0])
            
fm_set_entity_visibility(g_MBDFire[id][1])
        }
    }
    else
    {
        if (
pev_valid(g_MBDFire[id][0]) && pev_valid(g_MBDFire[id][1]))
        {
            
fm_set_entity_visibility(g_MBDFire[id][0], false)
            
fm_set_entity_visibility(g_MBDFire[id][1], false)
        }
    }

    return 
FMRES_IGNORED
}

public 
M3Dragon_Dance(idweapon_entityiButton)
{
    if(
get_pdata_float(idm_flNextAttack) > 0.0)
        return

    if(
get_pdata_float(weapon_entitym_flNextSecondaryAttackWEAP_LINUX_XTRA_OFF) <= 0.0 && iButton IN_ATTACK2 && iButton & ~IN_ATTACK)
    {
        switch(
g_current_mode[id])
        {
            case 
MODE_NORMAL:
            {
                if(
g_clip_ammo[id])
                {
                    
g_current_mode[id] = MODE_NORMAL2
                    ExecuteHamB
(Ham_Weapon_PrimaryAttackweapon_entity)
                    if(
g_current_mode[id] != MODE_FIREg_current_mode[id] = MODE_NORMAL
                
}
            }
            case 
MODE_FIRE:
            {
                
shoot_ball(id)
                
g_current_mode[id] = MODE_NORMAL
            
}
        }
    }
}

public 
shoot_ball(id)
{
    new 
mbd_egg engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
    
    if(!
pev_valid(mbd_egg))
        return
    
    
set_pev(mbd_eggpev_classnameMBD_EGG_CLASSNAME)
    
engfunc(EngFunc_SetModelmbd_eggMBD_Effects[0])

    
set_pev(mbd_eggpev_movetypeMOVETYPE_PUSHSTEP)
    
set_pev(mbd_eggpev_solidSOLID_BBOX)

    static 
Float:Origin[3], Float:Angles[3]
    
    
engfunc(EngFunc_GetAttachmentid2OriginAngles)
    
pev(idpev_anglesAngles)
    
    
set_pev(mbd_eggpev_originOrigin)
    
set_pev(mbd_eggpev_anglesAngles)
    
set_pev(mbd_eggpev_ownerid)

    static 
Float:Velocity[3], Float:TargetOrigin[3]
    
    
fm_get_aim_origin(idTargetOrigin)
    
get_speed_vector(OriginTargetOrigin1800.0Velocity)
    
    
set_pev(mbd_eggpev_velocityVelocity)
}

public 
make_fire(id)
{
    
g_MBDFire[id][0] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_sprite"))
    
    if(
pev_valid(g_MBDFire[id][0]))
    {
        
engfunc(EngFunc_SetModelg_MBDFire[id][0], MBD_Sprites[4])
        
set_pev(g_MBDFire[id][0], pev_classnameMBD_FIRE_CLASSNAME)
        
set_pev(g_MBDFire[id][0], pev_bodyMODE_FIRE 1)
        
set_pev(g_MBDFire[id][0], pev_aimentid)
        
set_pev(g_MBDFire[id][0], pev_movetypeMOVETYPE_FOLLOW)
        
set_pev(g_MBDFire[id][0], pev_rendermodekRenderTransAdd)
        
set_pev(g_MBDFire[id][0], pev_renderamt200.00)
        
set_pev(g_MBDFire[id][0], pev_scale0.1)
        
set_pev(g_MBDFire[id][0], pev_framerandom_num(02))
        
set_pev(g_MBDFire[id][0], pev_framerate30.00)
        
set_pev(g_MBDFire[id][0], pev_nextthinkget_gametime() + 0.05)
        
dllfunc(DLLFunc_Spawng_MBDFire[id][0])
    }

    
g_MBDFire[id][1] = engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_sprite"))
    
    if(
pev_valid(g_MBDFire[id][1]))
    {
        
engfunc(EngFunc_SetModelg_MBDFire[id][1], MBD_Sprites[5])
        
set_pev(g_MBDFire[id][1], pev_classnameMBD_FIRE_CLASSNAME)
        
set_pev(g_MBDFire[id][1], pev_bodyMODE_FIRE 2)
        
set_pev(g_MBDFire[id][1], pev_aimentid)
        
set_pev(g_MBDFire[id][1], pev_movetypeMOVETYPE_FOLLOW)
        
set_pev(g_MBDFire[id][1], pev_rendermodekRenderTransAdd)
        
set_pev(g_MBDFire[id][1], pev_renderamt200.00)
        
set_pev(g_MBDFire[id][1], pev_scale0.1)
        
set_pev(g_MBDFire[id][1], pev_framerandom_num(02))
        
set_pev(g_MBDFire[id][1], pev_framerate30.00)
        
set_pev(g_MBDFire[id][1], pev_nextthinkget_gametime() + 0.05)
        
dllfunc(DLLFunc_Spawng_MBDFire[id][1])
    }
}

public 
fw_Touch(iEntiTouchedEnt)
{
    if (!
pev_valid(iEnt))
        return 
FMRES_IGNORED

    
if(fm_is_ent_classname(iEntMBD_EGG_CLASSNAME))
    {
        
summon_dragon(iEnt)
        
engfunc(EngFunc_RemoveEntityiEnt)
    }

    return 
FMRES_IGNORED
}

public 
summon_dragon(mbd_egg)
{
    if(!
pev_valid(mbd_egg))
        return

    new 
id pev(mbd_eggpev_owner)

    static 
Float:flOrigin[3]
    
pev(mbd_eggpev_originflOrigin)

    new 
mbd_dragon engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 

    if(!
pev_valid(mbd_dragon))
        return

    
set_pev(mbd_dragonpev_classnameMBD_DRAGON_CLASSNAME)
    
    
engfunc(EngFunc_SetModelmbd_dragonMBD_Effects[1])

    
set_pev(mbd_dragonpev_rendermodekRenderTransAdd)

    
set_pev(mbd_dragonpev_renderamt255.0)

    
engfunc(EngFunc_SetOriginmbd_dragonflOrigin)

    
engfunc(EngFunc_DropToFloormbd_dragon)
    
    
set_pev(mbd_dragonpev_solidSOLID_NOT)

    
set_pev(mbd_dragonpev_scale0.1)

    
set_pev(mbd_dragonpev_animtimeget_gametime())

    
set_pev(mbd_dragonpev_framerate1.0)
    
    
set_pev(mbd_dragonpev_sequence1)

    
set_pev(mbd_dragonpev_ownerid)

    
set_pev(mbd_dragonpev_lifeget_gametime() + 4.5)

    
set_pev(mbd_dragonpev_nextthinkget_gametime() + 0.1)

    
emit_sound(idCHAN_STATICMBD_Sounds[7], VOL_NORMATTN_NORM0PITCH_NORM)

    
set_task(0.2"dragon_vortex"mbd_dragon MBD_WEAPONKEY, .flags "b")
}

public 
dragon_vortex(mbd_dragon)
{
    
mbd_dragon -= MBD_WEAPONKEY

    
new id pev(mbd_dragonpev_owner)
    static 
Float:flOrigin[3]
    
pev(mbd_dragonpev_originflOrigin)

    for(new 
victim 0victim <= g_maxplayersvictim++)
    {
        if(!
is_user_connected(victim))
            continue

        if(!
is_user_alive(victim) || !zp_get_user_zombie(victim))
            continue

        if(
fm_entity_range(mbd_dragonvictim) >= 400.0)
            continue

        
Make_Vortex(victimflOrigin300)
        
        new 
Float:damage float(get_pcvar_num(cvar_dmg_mbd)) / 2

        ExecuteHamB
(Ham_TakeDamagevictim ididdamageDMG_SLASH)        
        
make_blood(victimdamage)
    }
}

public 
fw_Think(iEnt)
{
    if(!
pev_valid(iEnt))
        return 
FMRES_HANDLED

    
if(fm_is_ent_classname(iEntMBD_FIRE_CLASSNAME))
    {
        new 
id pev(iEntpev_aiment)
        
        if(
get_user_weapon(id) != CSW_MBD || g_current_mode[id] != MODE_FIRE)
        {
            if (
pev_valid(g_MBDFire[id][0]) && pev_valid(g_MBDFire[id][1]))
            {
                
fm_set_entity_visibility(g_MBDFire[id][0], 0)
                
fm_set_entity_visibility(g_MBDFire[id][1], 0)
            }
        }

        static 
Float:flRenderAmt
        pev
(iEntpev_renderamtflRenderAmt)
        
flRenderAmt flRenderAmt 20.00
        
        
if(flRenderAmt 200.00)
            
flRenderAmt 200.00

        set_pev
(iEntpev_renderamtflRenderAmt)
    }
    else if(
fm_is_ent_classname(iEntMBD_DRAGON_CLASSNAME))
    {
        if(
pev(iEntpev_life) - get_gametime() <= 0)
        {
            new 
id pev(iEntpev_owner)
            
set_pev(iEntpev_flagsFL_KILLME)
            
g_clip_counter[id] = 0
            remove_task
(iEnt+MBD_WEAPONKEY)
            
engfunc(EngFunc_RemoveEntityiEnt)
            return 
FMRES_IGNORED
        
}
    }

    
set_pev(iEntpev_nextthinkget_gametime() + 0.05)

    return 
FMRES_IGNORED
}

public 
fw_M3Dragon_Reload(mbd)
{
    if(
pev_valid(mbd) != 2)
        return 
HAM_IGNORED

    
new id fm_cs_get_weapon_ent_owner(mbd)

    if(
fm_cs_get_current_weapon_ent(id) != mbd)
        return 
HAM_IGNORED

    
if(!g_has_mbd[id])
        return 
HAM_IGNORED

    
new iBpAmmo get_pdata_int(idOFFSET_M3_AMMOPLAYER_LINUX_XTRA_OFF
    new 
iClip get_pdata_int(mbdm_iClipWEAP_LINUX_XTRA_OFF
    new 
iMaxClip get_pcvar_num(cvar_clip_mbd)

    
Shotgun_Reload(mbdiMaxClipiClipiBpAmmoid)

    return 
HAM_SUPERCEDE 
}

stock Shotgun_Reload(iEntiMaxClipiClipiBpAmmoid

    if(
iBpAmmo <= || iClip == iMaxClip
        return 

    if(
get_pdata_int(iEntm_flNextPrimaryAttackWEAP_LINUX_XTRA_OFF) > 0.0
        return

    switch(
get_pdata_int(iEntm_fInSpecialReloadWEAP_LINUX_XTRA_OFF)) 
    { 
        case 
0
        { 
            
fm_play_weapon_animation(idg_current_mode[id] == MODE_FIRE MBD_SECONDARY_BEFORE_RELOAD MBD_BEFORE_RELOAD
            
set_pdata_int(iEntm_fInSpecialReload1
            
set_pdata_float(idm_flNextAttack0.2)
            
fm_set_weapon_idle_time(idweapon_mbd0.2)
        } 
        case 
1:
        {    
            if(
get_pdata_float(iEntm_flTimeWeaponIdle) > 0.0
                return 

            
fm_play_weapon_animation(idg_current_mode[id] == MODE_FIRE MBD_SECONDARY_INSERT MBD_INSERT)
            
set_pdata_int(iEntm_fInSpecialReload2)
            
set_pdata_float(iEntm_flNextReload0.2)
            
set_pdata_float(iEntm_flTimeWeaponIdle0.5
        } 
        case 
2
        {
            
set_pdata_int(iEntm_iClipiClip+1
            
set_pdata_int(idOFFSET_M3_AMMOiBpAmmo-1
            
set_pdata_int(iEntm_fInSpecialReload1
        } 
    }
 

stock Make_Vortex
(idFloat:flOrigin[3], offset)
{
    new 
Float:flPlayer[3], Float:flTarget[3], Float:flVelocity[3], Float:flDistance
    
    pev
(idpev_originflPlayer)
    
    
flPlayer[2] = 0.0
    
    flTarget
[0] = flOrigin[0]
    
flTarget[1] = flOrigin[1]
    
flTarget[2] = 0.0

    flDistance 
vector_distance(flPlayerflTarget)
    
    
flVelocity[0] = (flTarget[0] -  flPlayer[0]) / flDistance    
    flVelocity
[1] = (flTarget[1] -  flPlayer[1]) / flDistance

    flTarget
[0] += flVelocity[1] * offset
    flTarget
[1] -= flVelocity[0] * offset
    
    flDistance 
vector_distance(flPlayerflTarget)
    
    
flVelocity[0] = (flTarget[0] -  flPlayer[0]) / flDistance    
    flVelocity
[1] = (flTarget[1] -  flPlayer[1]) / flDistance
    
    flVelocity
[0] = flVelocity[0] * 1500
    flVelocity
[1] = flVelocity[1] * 1500
    flVelocity
[2] = 0.4 1500
    
    set_pev
(idpev_velocityflVelocity)
}

stock make_blood(idFloat:Damage)
{
    new 
bloodColor ExecuteHam(Ham_BloodColorid)
    new 
Float:origin[3]
    
pev(idpev_originorigin)

    if (
bloodColor == -1)
        return

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BLOODSPRITE)
    
write_coord(floatround(origin[0]))
    
write_coord(floatround(origin[1]))
    
write_coord(floatround(origin[2]))
    
write_short(m_iBlood[1])
    
write_short(m_iBlood[0])
    
write_byte(bloodColor)
    
write_byte(min(max(3floatround(Damage)/5), 16))
    
message_end()
}

stock fm_get_aim_origin(indexFloat:origin[3])
{
    new 
Float:start[3], Float:view_ofs[3];
    
pev(indexpev_originstart);
    
pev(indexpev_view_ofsview_ofs);
    
xs_vec_add(startview_ofsstart);

    new 
Float:dest[3];
    
pev(indexpev_v_angledest);
    
engfunc(EngFunc_MakeVectorsdest);
    
global_get(glb_v_forwarddest);
    
xs_vec_mul_scalar(dest9999.0dest);
    
xs_vec_add(startdestdest);

    
engfunc(EngFunc_TraceLinestartdest0index0);
    
get_tr2(0TR_vecEndPosorigin);

    return 
1;
}

stock fm_cs_get_current_weapon_ent(id)
    return 
get_pdata_cbase(idm_pActiveItemPLAYER_LINUX_XTRA_OFF)

stock fm_cs_get_weapon_ent_owner(ent)
    return 
get_pdata_cbase(entm_pPlayerWEAP_LINUX_XTRA_OFF)

stock fm_set_weapon_idle_time(id, const class[], Float:IdleTime)
{
    static 
weapon_ent
    weapon_ent 
fm_find_ent_by_owner(-1, class, id)

    if(!
pev_valid(weapon_ent))
        return

    
set_pdata_float(weapon_entm_flNextPrimaryAttackIdleTimeWEAP_LINUX_XTRA_OFF)
    
set_pdata_float(weapon_entm_flNextSecondaryAttackIdleTimeWEAP_LINUX_XTRA_OFF)
    
set_pdata_float(weapon_entm_flTimeWeaponIdleIdleTime 0.50WEAP_LINUX_XTRA_OFF)
}

stock fm_play_weapon_animation(const id, const Sequence)
{
    
set_pev(idpev_weaponanimSequence)
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, .player id)
    
write_byte(Sequence)
    
write_byte(pev(idpev_body))
    
message_end()
}

stock fm_find_ent_by_owner(index, const classname[], ownerjghgtype 0)
{
    new 
strtype[11] = "classname"ent index;

    switch (
jghgtype)
    {
        case 
1strtype "target";
        case 
2strtype "targetname";
    }

    while ((
ent engfunc(EngFunc_FindEntityByStringentstrtypeclassname)) && pev(entpev_owner) != owner) {}

    return 
ent;
}

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_CreateNamedEntityengfunc(EngFunc_AllocStringitem));
    
    if (!
pev_valid(ent))
        return 
0;

    new 
Float:origin[3];
    
pev(indexpev_originorigin);
    
set_pev(entpev_originorigin);
    
set_pev(entpev_spawnflagspev(entpev_spawnflags) | SF_NORESPAWN);
    
dllfunc(DLLFunc_Spawnent);

    new 
save pev(entpev_solid);
    
dllfunc(DLLFunc_Touchentindex);
    if (
pev(entpev_solid) != save)
        return 
ent;

    
engfunc(EngFunc_RemoveEntityent);

    return -
1;
}

stock Check_Counter(id)
{
    if(
get_user_weapon(id) != CSW_MBD || !g_has_mbd[id])
        return

    if(
g_current_mode[id] == MODE_FIRE)
        return

    if(
g_clip_counter[id] >= 7)
    {
        
g_current_mode[id] = MODE_FIRE
        g_clip_counter
[id] = 0
        make_fire
(id)
        return
    }

    
g_clip_counter[id]++
}

stock get_speed_vector(const Float:origin1[3],const Float:origin2[3],Float:speedFloat:new_velocity[3])
{
    
new_velocity[0] = origin2[0] - origin1[0]
    
new_velocity[1] = origin2[1] - origin1[1]
    
new_velocity[2] = origin2[2] - origin1[2]

    new 
Float:num floatsqroot(speed speed / (new_velocity[0] * new_velocity[0] + new_velocity[1] * new_velocity[1] + new_velocity[2] * new_velocity[2]))
    
    
new_velocity[0] *= num
    new_velocity
[1] *= num
    new_velocity
[2] *= num
    
    
return 1;
}

stock fm_get_user_weapon_entity(idwid 0)
{
    new 
weap widclipammo;
    if (!
weap && !(weap get_user_weapon(idclipammo)))
        return 
0;

    if(!
pev_valid(weap))
        return 
0

    
new class[32];
    
get_weaponname(weap, class, sizeof class - 1);

    return 
fm_find_ent_by_owner(-1, class, id);
}

stock Float:fm_entity_range(ent1ent2)
{
    new 
Float:origin1[3], Float:origin2[3]
    
    
pev(ent1pev_originorigin1)
    
pev(ent2pev_originorigin2)

    return 
get_distance_f(origin1origin2)
}

stock bool:fm_is_ent_classname(index, const classname[])
{
    if (!
pev_valid(index))
        return 
false;

    new class[
32];
    
pev(indexpev_classname, class, sizeof class - 1);

    if (
equal(class, classname))
        return 
true;

    return 
false;
}

stock fm_set_entity_visibility(indexvisible true)
{
    
set_pev(indexpev_effectsvisible pev(indexpev_effects) & ~EF_NODRAW pev(indexpev_effects) | EF_NODRAW);
    return 
1;
}

stock drop_weapons(iddropwhat)
{
 
    static weapons[32], numiweaponid
     num 
0
     get_user_weapons
(idweaponsnum)
 
    
     
for (0numi++)
 
    {
 
         weaponid weapons[i]
 
         
          if 
(dropwhat == && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
 
         {
 
              static wname[32]
 
              get_weaponname(weaponidwnamesizeof wname 1)
 
              engclient_cmd(id"drop"wname)
 
         }
 
    }




#2
Son Düzenleme: 23-08-2018, Saat: 22:37, Düzenleyen: PawNod'.
Konuyu 24 saatir güncellemediğiniz için çöpe taşıyorum

Forum kurallarına aykırı olduğun için konunuz silinmiştir .


Bir Hata Söz Konusu Olursa Bizlere Ulaşarak Düzeltebilirsiniz.






Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
Silinmiş Konu   | Mermi izlerini Yok etme/kaldırma XaRex 2 302 20-10-2019, Saat: 00:35
Son Yorum: By.KinG
Silinmiş Konu   | mermi reload bar server çöküyor fourgething 6 426 24-07-2019, Saat: 01:39
Son Yorum: ITenGriTR
Silinmiş Konu   | mermi reload bar fourgething 1 306 22-07-2019, Saat: 20:16
Son Yorum: Aconyonn
Silinmiş Konu   | Cs 1.6 Sınırsız mermi fakat şarjör kısmı sınırsız olan Yasin albayrak 1 373 03-07-2019, Saat: 22:22
Son Yorum: ` ripeNess
Silinmiş Konu   | Zombie Escape Extra İtems WX''Timer 1 293 19-06-2019, Saat: 14:44
Son Yorum: MawiLarq

Task