Raised This Month: $51 Target: $400
 12% 

Error Ak47 balrog for vip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Al3xandru271
Junior Member
Join Date: Jun 2020
Old 06-25-2020 , 20:28   Error Ak47 balrog for vip
Reply With Quote #1

I wanted to make this item vip and it gave me this error

Code:
//// Weapon_AK47_BE.sma
// C:\Games\Counter Strike 1.6\cstrike\addons\amxmodx\scripting\Weapon_AK47_BE.sma(91) : error 035: argument type mismatch (argument 2)
//
// 1 Error.
// Could not locate output file C:\Games\Counter Strike 1.6\cstrike\addons\amxmodx\scripting\compiled\Weapon_AK47_BE.amx (compile failed).
//
// Compilation Time: 0.23 sec
// ---------------------------------------

Press enter to exit ...
My attempt:

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <zombieplague>
#include <zmvip>

#define PLUGIN "[ZV] Weapon: AK47 [Balrog Edition]"
#define VERSION "1.0"
#define AUTHOR "[Z]KoaLa" // CODE BY DIAS PENDRAGON

#define V_MODEL "models/v_ak47be.mdl"
#define P_MODEL "models/p_ak47be.mdl"
#define W_MODEL "models/w_ak47be.mdl"

#define DAMAGE 90
#define CLIP 40
#define BPAMMO 240
#define RECOIL 0.4
#define ACTIVE_CLIP 20

#define CSW_AK47B CSW_AK47
#define weapon_ak47b "weapon_ak47"

#define WEAPON_SECRETCODE 20151
#define WEAPON_EVENT "events/ak47.sc"
#define OLD_W_MODEL "models/w_ak47.mdl"

#define EXP_SPR "sprites/balrog5stack.spr"

new const AK47B_Sounds[4][] =
{
    
"weapons/balrogak47_1.wav",
    
"weapons/balrogak47_clipin.wav",
    
"weapons/balrogak47_clipout.wav",
    
"weapons/balrogak47_draw.wav"
}

enum
{
    
ANIM_IDLE1 0,
    
ANIM_RELOAD,
    
ANIM_DRAW,
    
ANIM_SHOOT1,
    
ANIM_SHOOT2,
    
ANIM_SHOOT3,
    
ANIM_SHOOTBCS1,
    
ANIM_SHOOTBCS2
}

new 
g_Ak47b
new g_Had_Ak47b[33], g_Shoot_Special[33], g_Holding_Attack[33], g_Shoot_Count[33], g_Old_Weapon[33], g_Current_Weapon[33]
new 
g_Exp_SprIdg_Ak47b_Eventg_ShellIdg_SmokePuff_SprId

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
    
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)    
    
register_forward(FM_PlaybackEvent"fw_PlaybackEvent")    
    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_CmdStart"fw_CmdStart")        
    
    
RegisterHam(Ham_TraceAttack"worldspawn""fw_TraceAttack")
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack")    
    
RegisterHam(Ham_Weapon_PrimaryAttackweapon_ak47b"fw_Weapon_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttackweapon_ak47b"fw_Weapon_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Item_AddToPlayerweapon_ak47b"fw_Item_AddToPlayer_Post"1)
    
RegisterHam(Ham_Item_PostFrameweapon_ak47b"fw_Item_PostFrame")
    
    
register_clcmd("admin_get_ak47b""Get_Ak47b"ADMIN_BAN)
}

public 
plugin_precache()
{
    
engfunc(EngFunc_PrecacheModelV_MODEL)
    
engfunc(EngFunc_PrecacheModelP_MODEL)
    
engfunc(EngFunc_PrecacheModelW_MODEL)
    
    for(new 
0sizeof(AK47B_Sounds); i++)
        
engfunc(EngFunc_PrecacheSoundAK47B_Sounds[i])
        
    
g_Exp_SprId engfunc(EngFunc_PrecacheModelEXP_SPR)
    
g_SmokePuff_SprId engfunc(EngFunc_PrecacheModel"sprites/wall_puff1.spr")
    
g_ShellId engfunc(EngFunc_PrecacheModel"models/pshell.mdl")
    
    
register_forward(FM_PrecacheEvent"fw_PrecacheEvent_Post"1)
    
g_Ak47b zv_register_extra_item("AK47 [Balrog Edition]"35ZV_TEAM_HUMAN)
}

public 
fw_PrecacheEvent_Post(type, const name[])
{
    if(
equal(WEAPON_EVENTname))
        
g_Ak47b_Event get_orig_retval()        
}

public 
zv_extra_item_selected(iditemid)
{
    if(
itemid == g_Ak47bGet_Ak47b(id)
}

public 
zp_user_infected_post(idRemove_Ak47b(id)
public 
zp_user_humanized_post(idRemove_Ak47b(id)

public 
Get_Ak47b(id)
{
    if(!
is_user_alive(id))
        return
        
    
g_Had_Ak47b[id] = 1
    g_Shoot_Special
[id] = 0
    g_Holding_Attack
[id] = 0
    g_Shoot_Count
[id] = 0
    
    fm_give_item
(idweapon_ak47b)
    
    static 
EntEnt fm_get_user_weapon_entity(idCSW_AK47B)
    if(!
pev_valid(Ent)) return
    
    
cs_set_weapon_ammo(EntCLIP)
    
    
cs_set_user_bpammo(idCSW_AK47BBPAMMO)
}

public 
Remove_Ak47b(id)
{
    if(!
is_user_connected(id))
        return
        
    
g_Had_Ak47b[id] = 0
    g_Shoot_Special
[id] = 0    
}

public 
Event_CurWeapon(id)
{
    if(!
is_user_alive(id))
        return
    
    if(
get_user_weapon(id) != g_Current_Weapon[id]) g_Current_Weapon[id] = get_user_weapon(id)
    
    if(
get_user_weapon(id) == CSW_AK47B && g_Had_Ak47b[id])
    {
        if(
g_Old_Weapon[id] != CSW_AK47B)
        {
            
set_pev(idpev_viewmodel2V_MODEL)
            
set_pev(idpev_weaponmodel2P_MODEL)
        }
    }
    
    
g_Old_Weapon[id] = get_user_weapon(id)
}

public 
fw_UpdateClientData_Post(idsendweaponscd_handle)
{
    if(!
is_user_alive(id) || !is_user_connected(id))
        return 
FMRES_IGNORED    
    
if(get_user_weapon(id) == CSW_AK47B && g_Had_Ak47b[id])
        
set_cd(cd_handleCD_flNextAttackget_gametime() + 0.001
    
    return 
FMRES_HANDLED
}

public 
fw_PlaybackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:angles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if (!
is_user_connected(invoker))
        return 
FMRES_IGNORED    
    
if(get_user_weapon(invoker) != CSW_AK47B || !g_Had_Ak47b[invoker])
        return 
FMRES_IGNORED
    
if(eventid != g_Ak47b_Event)
        return 
FMRES_IGNORED
    
    engfunc
(EngFunc_PlaybackEventflags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    
    if(!
g_Shoot_Special[invoker] && cs_get_user_bpammo(invokerCSW_AK47B) > 0)
    {
        
g_Shoot_Count[invoker]++
        if(
g_Shoot_Count[invoker] >= ACTIVE_CLIP)
        {
            
g_Shoot_Special[invoker] = 1
            
            
static EntEnt fm_get_user_weapon_entity(invokerCSW_AK47B)
            if(
pev_valid(Ent)) g_Shoot_Count[invoker] = cs_get_weapon_ammo(Ent)
        }
    } else if(
g_Shoot_Special[invoker]) {
        
cs_set_user_bpammo(invokerCSW_AK47Bcs_get_user_bpammo(invokerCSW_AK47B) - 1)
        
        if(
cs_get_user_bpammo(invokerCSW_AK47B) <= 0)
        {
            
g_Shoot_Special[invoker] = 0
            g_Shoot_Count
[invoker] = 0
        
}
    }
    
    
set_weapon_anim(invokerg_Shoot_Special[invoker] == ANIM_SHOOTBCS2 ANIM_SHOOTBCS1)
    
emit_sound(invokerCHAN_WEAPONg_Shoot_Special[invoker] == AK47B_Sounds[1] : AK47B_Sounds[0], VOL_NORMATTN_NORM0PITCH_NORM)
    
    
Eject_Shell(invokerg_ShellId0.0)
        
    return 
FMRES_SUPERCEDE
}

public 
fw_SetModel(entitymodel[])
{
    if(!
pev_valid(entity))
        return 
FMRES_IGNORED
    
    
static Classname[32]
    
pev(entitypev_classnameClassnamesizeof(Classname))
    
    if(!
equal(Classname"weaponbox"))
        return 
FMRES_IGNORED
    
    
static iOwner
    iOwner 
pev(entitypev_owner)
    
    if(
equal(modelOLD_W_MODEL))
    {
        static 
weaponweapon fm_find_ent_by_owner(-1weapon_ak47bentity)
        
        if(!
pev_valid(weapon))
            return 
FMRES_IGNORED;
        
        if(
g_Had_Ak47b[iOwner])
        {
            
Remove_Ak47b(iOwner)
            
            
set_pev(weaponpev_impulseWEAPON_SECRETCODE)
            
engfunc(EngFunc_SetModelentityW_MODEL)
            
            return 
FMRES_SUPERCEDE
        
}
    }

    return 
FMRES_IGNORED;
}

public 
fw_CmdStart(iduc_handleseed)
{
    if(!
is_user_alive(id))
        return
    if(
g_Current_Weapon[id] != CSW_AK47B || !g_Had_Ak47b[id])
        return
        
    static 
NewButtonNewButton get_uc(uc_handleUC_Buttons)
    static 
OldButtonOldButton pev(idpev_oldbuttons)
    
    if(
NewButton IN_ATTACK)
    {
        if(!
g_Holding_Attack[id]) g_Holding_Attack[id] = 1
    
} else if((NewButton IN_ATTACK2) && !(OldButton IN_ATTACK2)) {
        if(
cs_get_user_zoom(id) == 1cs_set_user_zoom(idCS_SET_AUGSG552_ZOOM1)
        else 
cs_set_user_zoom(idCS_SET_NO_ZOOM1)
    } else {
        if(
OldButton IN_ATTACK)
        {
            if(
g_Holding_Attack[id]) 
            {
                
g_Holding_Attack[id] = 0
                g_Shoot_Count
[id] = 0
                g_Shoot_Special
[id] = 0
            
}
        }
    }
}

public 
fw_TraceAttack(VictimAttackerFloat:DamageFloat:Direction[3], PtrDamageBits)
{
    if(!
is_user_alive(Attacker))
        return 
HAM_IGNORED    
    
if(get_user_weapon(Attacker) != CSW_AK47B || !g_Had_Ak47b[Attacker])
        return 
HAM_IGNORED
        
    
static Float:flEnd[3], Float:vecPlane[3]
    
    
get_tr2(PtrTR_vecEndPosflEnd)
    
get_tr2(PtrTR_vecPlaneNormalvecPlane)        
        
    if(!
is_user_alive(Victim))
    {
        
Make_BulletHole(AttackerflEndDamage)
        
Make_BulletSmoke(AttackerPtr)
    }
    
    if(
g_Shoot_Special[Attacker])
    {
        
Make_BalrogEffect(AttackerPtr)
        
radius_damage(AttackerflEndfloat(DAMAGE), 96.0)
    }
    
    
SetHamParamFloat(3float(DAMAGE))
    
    return 
HAM_IGNORED
}

public 
fw_Weapon_PrimaryAttack(Ent)
{
    if(!
pev_valid(Ent))
        return
    static 
IdId pev(Entpev_owner)
    if(!
g_Had_Ak47b[Id])
        return
    
    if(
g_Shoot_Special[Id]) set_pdata_float(Ent620.44)
    else 
set_pdata_float(Ent620.24)
}

public 
fw_Weapon_PrimaryAttack_Post(Ent)
{
    if(!
pev_valid(Ent))
        return
    static 
IdId pev(Entpev_owner)
    if(!
g_Had_Ak47b[Id])
        return

    static 
Float:push[3]; pev(Idpev_punchanglepush)
    
    
xs_vec_mul_scalar(pushRECOILpush)

    
set_pev(Idpev_punchanglepush)    
    
    if(
g_Shoot_Special[Id] && cs_get_weapon_ammo(Ent) > 0
    {
        
cs_set_weapon_ammo(Entg_Shoot_Count[Id])
        
set_pdata_float(Ent46get_pdata_float(Ent464) * 0.754)    
    }
}

public 
fw_Item_AddToPlayer_Post(entid)
{
    if(!
pev_valid(ent))
        return 
HAM_IGNORED
        
    
if(pev(entpev_impulse) == WEAPON_SECRETCODE)
    {
        
g_Had_Ak47b[id] = 1
        set_pev
(entpev_impulse0)
    }        

    return 
HAM_HANDLED    
}

public 
fw_Item_PostFrame(Ent)
{
    if(!
pev_valid(Ent))
        return
        
    static 
IdId pev(Entpev_owner)
    if(!
g_Had_Ak47b[Id])
        return
    
    static 
Float:flNextAttackflNextAttack get_pdata_float(Id835)
    static 
bpammobpammo cs_get_user_bpammo(IdCSW_AK47B)
    static 
iClipiClip get_pdata_int(Ent514)

    if(
get_pdata_int(Ent544) && flNextAttack <= 0.0)
    {
        static 
temp1temp1 min(CLIP iClipbpammo)

        
set_pdata_int(Ent51iClip temp14)
        
cs_set_user_bpammo(IdCSW_AK47Bbpammo temp1)        
        
        
set_pdata_int(Ent5404)
    }        
}

stock Make_BulletHole(idFloat:Origin[3], Float:Damage)
{
    
// Find target
    
static DecalDecal random_num(4145)
    static 
LoopTime
    
    if(
Damage 100.0LoopTime 2
    
else LoopTime 1
    
    
for(new 0LoopTimei++)
    {
        
// Put decal on "world" (a wall)
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_WORLDDECAL)
        
engfunc(EngFunc_WriteCoordOrigin[0])
        
engfunc(EngFunc_WriteCoordOrigin[1])
        
engfunc(EngFunc_WriteCoordOrigin[2])
        
write_byte(Decal)
        
message_end()
        
        
// Show sparcles
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_GUNSHOTDECAL)
        
engfunc(EngFunc_WriteCoordOrigin[0])
        
engfunc(EngFunc_WriteCoordOrigin[1])
        
engfunc(EngFunc_WriteCoordOrigin[2])
        
write_short(id)
        
write_byte(Decal)
        
message_end()
    }
}

public 
Make_BulletSmoke(idTrResult)
{
    static 
Float:vecSrc[3], Float:vecEnd[3], TE_FLAG
    
    get_weapon_attachment
(idvecSrc)
    
global_get(glb_v_forwardvecEnd)
    
    
xs_vec_mul_scalar(vecEnd8192.0vecEnd)
    
xs_vec_add(vecSrcvecEndvecEnd)

    
get_tr2(TrResultTR_vecEndPosvecSrc)
    
get_tr2(TrResultTR_vecPlaneNormalvecEnd)
    
    
xs_vec_mul_scalar(vecEnd2.5vecEnd)
    
xs_vec_add(vecSrcvecEndvecEnd)
    
    
TE_FLAG |= TE_EXPLFLAG_NODLIGHTS
    TE_FLAG 
|= TE_EXPLFLAG_NOSOUND
    TE_FLAG 
|= TE_EXPLFLAG_NOPARTICLES
    
    engfunc
(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYvecEnd0)
    
write_byte(TE_EXPLOSION)
    
engfunc(EngFunc_WriteCoordvecEnd[0])
    
engfunc(EngFunc_WriteCoordvecEnd[1])
    
engfunc(EngFunc_WriteCoordvecEnd[2] - 10.0)
    
write_short(g_SmokePuff_SprId)
    
write_byte(2)
    
write_byte(50)
    
write_byte(TE_FLAG)
    
message_end()
}

public 
Make_BalrogEffect(idTrResult)
{
    static 
Float:vecSrc[3], Float:vecEnd[3], TE_FLAG
    
    get_weapon_attachment
(idvecSrc)
    
global_get(glb_v_forwardvecEnd)
    
    
xs_vec_mul_scalar(vecEnd8192.0vecEnd)
    
xs_vec_add(vecSrcvecEndvecEnd)

    
get_tr2(TrResultTR_vecEndPosvecSrc)
    
get_tr2(TrResultTR_vecPlaneNormalvecEnd)
    
    
xs_vec_mul_scalar(vecEnd5.0vecEnd)
    
xs_vec_add(vecSrcvecEndvecEnd)
    
    
TE_FLAG |= TE_EXPLFLAG_NODLIGHTS
    TE_FLAG 
|= TE_EXPLFLAG_NOSOUND
    TE_FLAG 
|= TE_EXPLFLAG_NOPARTICLES
    
    engfunc
(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYvecEnd0)
    
write_byte(TE_EXPLOSION)
    
engfunc(EngFunc_WriteCoordvecEnd[0])
    
engfunc(EngFunc_WriteCoordvecEnd[1])
    
engfunc(EngFunc_WriteCoordvecEnd[2])
    
write_short(g_Exp_SprId)
    
write_byte(5)
    
write_byte(30)
    
write_byte(TE_FLAG)
    
message_end()
}

stock get_weapon_attachment(idFloat:output[3], Float:fDis 40.0)

    new 
Float:vfEnd[3], viEnd[3
    
get_user_origin(idviEnd3)  
    
IVecFVec(viEndvfEnd
    
    new 
Float:fOrigin[3], Float:fAngle[3]
    
    
pev(idpev_originfOrigin
    
pev(idpev_view_ofsfAngle)
    
    
xs_vec_add(fOriginfAnglefOrigin
    
    new 
Float:fAttack[3]
    
    
xs_vec_sub(vfEndfOriginfAttack)
    
xs_vec_sub(vfEndfOriginfAttack
    
    new 
Float:fRate
    
    fRate 
fDis vector_length(fAttack)
    
xs_vec_mul_scalar(fAttackfRatefAttack)
    
    
xs_vec_add(fOriginfAttackoutput)
}

stock radius_damage(idFloat:Origin[3], Float:DamageFloat:Radius)
{
    static 
VictimVictim = -1

    
while((Victim engfunc(EngFunc_FindEntityInSphereVictimOriginRadius)) != 0)
    {
        if(!
is_user_alive(Victim) || id == Victim
            continue
        if(!
zp_get_user_zombie(Victim))
            continue

        
ExecuteHamB(Ham_TakeDamageVictimfm_get_user_weapon_entity(idget_user_weapon(id)), idDamageDMG_BULLET)
    }
}

stock Eject_Shell(idShell_ModelIndexFloat:Time// By Dias
{
    static 
EntEnt get_pdata_cbase(id3735)
    if(!
pev_valid(Ent))
        return

        
set_pdata_int(Ent57Shell_ModelIndex4)
        
set_pdata_float(id111get_gametime() + Time)
}

stock set_weapon_anim(idanim)
{
    if(!
is_user_alive(id))
        return
    
    
set_pev(idpev_weaponanimanim)
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, {000}, id)
    
write_byte(anim)
    
write_byte(pev(idpev_body))
    
message_end()
}



[
B]Original sma:[/B]

#include <amxmodx>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <zombieplague>

#define PLUGIN "[ZP] Weapon: AK47 [Balrog Edition]"
#define VERSION "1.0"
#define AUTHOR "[Z]KoaLa" // CODE BY DIAS PENDRAGON

#define V_MODEL "models/v_ak47be.mdl"
#define P_MODEL "models/p_ak47be.mdl"
#define W_MODEL "models/w_ak47be.mdl"

#define DAMAGE 90
#define CLIP 40
#define BPAMMO 240
#define RECOIL 0.4
#define ACTIVE_CLIP 20

#define CSW_AK47B CSW_AK47
#define weapon_ak47b "weapon_ak47"

#define WEAPON_SECRETCODE 20151
#define WEAPON_EVENT "events/ak47.sc"
#define OLD_W_MODEL "models/w_ak47.mdl"

#define EXP_SPR "sprites/balrog5stack.spr"

new const AK47B_Sounds[4][] =
{
    
"weapons/balrogak47_1.wav",
    
"weapons/balrogak47_clipin.wav",
    
"weapons/balrogak47_clipout.wav",
    
"weapons/balrogak47_draw.wav"
}

enum
{
    
ANIM_IDLE1 0,
    
ANIM_RELOAD,
    
ANIM_DRAW,
    
ANIM_SHOOT1,
    
ANIM_SHOOT2,
    
ANIM_SHOOT3,
    
ANIM_SHOOTBCS1,
    
ANIM_SHOOTBCS2
}

new 
g_Ak47b
new g_Had_Ak47b[33], g_Shoot_Special[33], g_Holding_Attack[33], g_Shoot_Count[33], g_Old_Weapon[33], g_Current_Weapon[33]
new 
g_Exp_SprIdg_Ak47b_Eventg_ShellIdg_SmokePuff_SprId

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
    
    
register_forward(FM_UpdateClientData"fw_UpdateClientData_Post"1)    
    
register_forward(FM_PlaybackEvent"fw_PlaybackEvent")    
    
register_forward(FM_SetModel"fw_SetModel")
    
register_forward(FM_CmdStart"fw_CmdStart")        
    
    
RegisterHam(Ham_TraceAttack"worldspawn""fw_TraceAttack")
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack")    
    
RegisterHam(Ham_Weapon_PrimaryAttackweapon_ak47b"fw_Weapon_PrimaryAttack")
    
RegisterHam(Ham_Weapon_PrimaryAttackweapon_ak47b"fw_Weapon_PrimaryAttack_Post"1)
    
RegisterHam(Ham_Item_AddToPlayerweapon_ak47b"fw_Item_AddToPlayer_Post"1)
    
RegisterHam(Ham_Item_PostFrameweapon_ak47b"fw_Item_PostFrame")
    
    
register_clcmd("admin_get_ak47b""Get_Ak47b"ADMIN_BAN)
}

public 
plugin_precache()
{
    
engfunc(EngFunc_PrecacheModelV_MODEL)
    
engfunc(EngFunc_PrecacheModelP_MODEL)
    
engfunc(EngFunc_PrecacheModelW_MODEL)
    
    for(new 
0sizeof(AK47B_Sounds); i++)
        
engfunc(EngFunc_PrecacheSoundAK47B_Sounds[i])
        
    
g_Exp_SprId engfunc(EngFunc_PrecacheModelEXP_SPR)
    
g_SmokePuff_SprId engfunc(EngFunc_PrecacheModel"sprites/wall_puff1.spr")
    
g_ShellId engfunc(EngFunc_PrecacheModel"models/pshell.mdl")
    
    
register_forward(FM_PrecacheEvent"fw_PrecacheEvent_Post"1)
    
g_Ak47b zp_register_extra_item("AK47 [Balrog Edition]"35ZP_TEAM_HUMAN)
}

public 
fw_PrecacheEvent_Post(type, const name[])
{
    if(
equal(WEAPON_EVENTname))
        
g_Ak47b_Event get_orig_retval()        
}

public 
zp_extra_item_selected(iditemid)
{
    if(
itemid == g_Ak47bGet_Ak47b(id)
}

public 
zp_user_infected_post(idRemove_Ak47b(id)
public 
zp_user_humanized_post(idRemove_Ak47b(id)

public 
Get_Ak47b(id)
{
    if(!
is_user_alive(id))
        return
        
    
g_Had_Ak47b[id] = 1
    g_Shoot_Special
[id] = 0
    g_Holding_Attack
[id] = 0
    g_Shoot_Count
[id] = 0
    
    fm_give_item
(idweapon_ak47b)
    
    static 
EntEnt fm_get_user_weapon_entity(idCSW_AK47B)
    if(!
pev_valid(Ent)) return
    
    
cs_set_weapon_ammo(EntCLIP)
    
    
cs_set_user_bpammo(idCSW_AK47BBPAMMO)
}

public 
Remove_Ak47b(id)
{
    if(!
is_user_connected(id))
        return
        
    
g_Had_Ak47b[id] = 0
    g_Shoot_Special
[id] = 0    
}

public 
Event_CurWeapon(id)
{
    if(!
is_user_alive(id))
        return
    
    if(
get_user_weapon(id) != g_Current_Weapon[id]) g_Current_Weapon[id] = get_user_weapon(id)
    
    if(
get_user_weapon(id) == CSW_AK47B && g_Had_Ak47b[id])
    {
        if(
g_Old_Weapon[id] != CSW_AK47B)
        {
            
set_pev(idpev_viewmodel2V_MODEL)
            
set_pev(idpev_weaponmodel2P_MODEL)
        }
    }
    
    
g_Old_Weapon[id] = get_user_weapon(id)
}

public 
fw_UpdateClientData_Post(idsendweaponscd_handle)
{
    if(!
is_user_alive(id) || !is_user_connected(id))
        return 
FMRES_IGNORED    
    
if(get_user_weapon(id) == CSW_AK47B && g_Had_Ak47b[id])
        
set_cd(cd_handleCD_flNextAttackget_gametime() + 0.001
    
    return 
FMRES_HANDLED
}

public 
fw_PlaybackEvent(flagsinvokereventidFloat:delayFloat:origin[3], Float:angles[3], Float:fparam1Float:fparam2iParam1iParam2bParam1bParam2)
{
    if (!
is_user_connected(invoker))
        return 
FMRES_IGNORED    
    
if(get_user_weapon(invoker) != CSW_AK47B || !g_Had_Ak47b[invoker])
        return 
FMRES_IGNORED
    
if(eventid != g_Ak47b_Event)
        return 
FMRES_IGNORED
    
    engfunc
(EngFunc_PlaybackEventflags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2)
    
    if(!
g_Shoot_Special[invoker] && cs_get_user_bpammo(invokerCSW_AK47B) > 0)
    {
        
g_Shoot_Count[invoker]++
        if(
g_Shoot_Count[invoker] >= ACTIVE_CLIP)
        {
            
g_Shoot_Special[invoker] = 1
            
            
static EntEnt fm_get_user_weapon_entity(invokerCSW_AK47B)
            if(
pev_valid(Ent)) g_Shoot_Count[invoker] = cs_get_weapon_ammo(Ent)
        }
    } else if(
g_Shoot_Special[invoker]) {
        
cs_set_user_bpammo(invokerCSW_AK47Bcs_get_user_bpammo(invokerCSW_AK47B) - 1)
        
        if(
cs_get_user_bpammo(invokerCSW_AK47B) <= 0)
        {
            
g_Shoot_Special[invoker] = 0
            g_Shoot_Count
[invoker] = 0
        
}
    }
    
    
set_weapon_anim(invokerg_Shoot_Special[invoker] == ANIM_SHOOTBCS2 ANIM_SHOOTBCS1)
    
emit_sound(invokerCHAN_WEAPONg_Shoot_Special[invoker] == AK47B_Sounds[1] : AK47B_Sounds[0], VOL_NORMATTN_NORM0PITCH_NORM)
    
    
Eject_Shell(invokerg_ShellId0.0)
        
    return 
FMRES_SUPERCEDE
}

public 
fw_SetModel(entitymodel[])
{
    if(!
pev_valid(entity))
        return 
FMRES_IGNORED
    
    
static Classname[32]
    
pev(entitypev_classnameClassnamesizeof(Classname))
    
    if(!
equal(Classname"weaponbox"))
        return 
FMRES_IGNORED
    
    
static iOwner
    iOwner 
pev(entitypev_owner)
    
    if(
equal(modelOLD_W_MODEL))
    {
        static 
weaponweapon fm_find_ent_by_owner(-1weapon_ak47bentity)
        
        if(!
pev_valid(weapon))
            return 
FMRES_IGNORED;
        
        if(
g_Had_Ak47b[iOwner])
        {
            
Remove_Ak47b(iOwner)
            
            
set_pev(weaponpev_impulseWEAPON_SECRETCODE)
            
engfunc(EngFunc_SetModelentityW_MODEL)
            
            return 
FMRES_SUPERCEDE
        
}
    }

    return 
FMRES_IGNORED;
}

public 
fw_CmdStart(iduc_handleseed)
{
    if(!
is_user_alive(id))
        return
    if(
g_Current_Weapon[id] != CSW_AK47B || !g_Had_Ak47b[id])
        return
        
    static 
NewButtonNewButton get_uc(uc_handleUC_Buttons)
    static 
OldButtonOldButton pev(idpev_oldbuttons)
    
    if(
NewButton IN_ATTACK)
    {
        if(!
g_Holding_Attack[id]) g_Holding_Attack[id] = 1
    
} else if((NewButton IN_ATTACK2) && !(OldButton IN_ATTACK2)) {
        if(
cs_get_user_zoom(id) == 1cs_set_user_zoom(idCS_SET_AUGSG552_ZOOM1)
        else 
cs_set_user_zoom(idCS_SET_NO_ZOOM1)
    } else {
        if(
OldButton IN_ATTACK)
        {
            if(
g_Holding_Attack[id]) 
            {
                
g_Holding_Attack[id] = 0
                g_Shoot_Count
[id] = 0
                g_Shoot_Special
[id] = 0
            
}
        }
    }
}

public 
fw_TraceAttack(VictimAttackerFloat:DamageFloat:Direction[3], PtrDamageBits)
{
    if(!
is_user_alive(Attacker))
        return 
HAM_IGNORED    
    
if(get_user_weapon(Attacker) != CSW_AK47B || !g_Had_Ak47b[Attacker])
        return 
HAM_IGNORED
        
    
static Float:flEnd[3], Float:vecPlane[3]
    
    
get_tr2(PtrTR_vecEndPosflEnd)
    
get_tr2(PtrTR_vecPlaneNormalvecPlane)        
        
    if(!
is_user_alive(Victim))
    {
        
Make_BulletHole(AttackerflEndDamage)
        
Make_BulletSmoke(AttackerPtr)
    }
    
    if(
g_Shoot_Special[Attacker])
    {
        
Make_BalrogEffect(AttackerPtr)
        
radius_damage(AttackerflEndfloat(DAMAGE), 96.0)
    }
    
    
SetHamParamFloat(3float(DAMAGE))
    
    return 
HAM_IGNORED
}

public 
fw_Weapon_PrimaryAttack(Ent)
{
    if(!
pev_valid(Ent))
        return
    static 
IdId pev(Entpev_owner)
    if(!
g_Had_Ak47b[Id])
        return
    
    if(
g_Shoot_Special[Id]) set_pdata_float(Ent620.44)
    else 
set_pdata_float(Ent620.24)
}

public 
fw_Weapon_PrimaryAttack_Post(Ent)
{
    if(!
pev_valid(Ent))
        return
    static 
IdId pev(Entpev_owner)
    if(!
g_Had_Ak47b[Id])
        return

    static 
Float:push[3]; pev(Idpev_punchanglepush)
    
    
xs_vec_mul_scalar(pushRECOILpush)

    
set_pev(Idpev_punchanglepush)    
    
    if(
g_Shoot_Special[Id] && cs_get_weapon_ammo(Ent) > 0
    {
        
cs_set_weapon_ammo(Entg_Shoot_Count[Id])
        
set_pdata_float(Ent46get_pdata_float(Ent464) * 0.754)    
    }
}

public 
fw_Item_AddToPlayer_Post(entid)
{
    if(!
pev_valid(ent))
        return 
HAM_IGNORED
        
    
if(pev(entpev_impulse) == WEAPON_SECRETCODE)
    {
        
g_Had_Ak47b[id] = 1
        set_pev
(entpev_impulse0)
    }        

    return 
HAM_HANDLED    
}

public 
fw_Item_PostFrame(Ent)
{
    if(!
pev_valid(Ent))
        return
        
    static 
IdId pev(Entpev_owner)
    if(!
g_Had_Ak47b[Id])
        return
    
    static 
Float:flNextAttackflNextAttack get_pdata_float(Id835)
    static 
bpammobpammo cs_get_user_bpammo(IdCSW_AK47B)
    static 
iClipiClip get_pdata_int(Ent514)

    if(
get_pdata_int(Ent544) && flNextAttack <= 0.0)
    {
        static 
temp1temp1 min(CLIP iClipbpammo)

        
set_pdata_int(Ent51iClip temp14)
        
cs_set_user_bpammo(IdCSW_AK47Bbpammo temp1)        
        
        
set_pdata_int(Ent5404)
    }        
}

stock Make_BulletHole(idFloat:Origin[3], Float:Damage)
{
    
// Find target
    
static DecalDecal random_num(4145)
    static 
LoopTime
    
    if(
Damage 100.0LoopTime 2
    
else LoopTime 1
    
    
for(new 0LoopTimei++)
    {
        
// Put decal on "world" (a wall)
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_WORLDDECAL)
        
engfunc(EngFunc_WriteCoordOrigin[0])
        
engfunc(EngFunc_WriteCoordOrigin[1])
        
engfunc(EngFunc_WriteCoordOrigin[2])
        
write_byte(Decal)
        
message_end()
        
        
// Show sparcles
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_GUNSHOTDECAL)
        
engfunc(EngFunc_WriteCoordOrigin[0])
        
engfunc(EngFunc_WriteCoordOrigin[1])
        
engfunc(EngFunc_WriteCoordOrigin[2])
        
write_short(id)
        
write_byte(Decal)
        
message_end()
    }
}

public 
Make_BulletSmoke(idTrResult)
{
    static 
Float:vecSrc[3], Float:vecEnd[3], TE_FLAG
    
    get_weapon_attachment
(idvecSrc)
    
global_get(glb_v_forwardvecEnd)
    
    
xs_vec_mul_scalar(vecEnd8192.0vecEnd)
    
xs_vec_add(vecSrcvecEndvecEnd)

    
get_tr2(TrResultTR_vecEndPosvecSrc)
    
get_tr2(TrResultTR_vecPlaneNormalvecEnd)
    
    
xs_vec_mul_scalar(vecEnd2.5vecEnd)
    
xs_vec_add(vecSrcvecEndvecEnd)
    
    
TE_FLAG |= TE_EXPLFLAG_NODLIGHTS
    TE_FLAG 
|= TE_EXPLFLAG_NOSOUND
    TE_FLAG 
|= TE_EXPLFLAG_NOPARTICLES
    
    engfunc
(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYvecEnd0)
    
write_byte(TE_EXPLOSION)
    
engfunc(EngFunc_WriteCoordvecEnd[0])
    
engfunc(EngFunc_WriteCoordvecEnd[1])
    
engfunc(EngFunc_WriteCoordvecEnd[2] - 10.0)
    
write_short(g_SmokePuff_SprId)
    
write_byte(2)
    
write_byte(50)
    
write_byte(TE_FLAG)
    
message_end()
}

public 
Make_BalrogEffect(idTrResult)
{
    static 
Float:vecSrc[3], Float:vecEnd[3], TE_FLAG
    
    get_weapon_attachment
(idvecSrc)
    
global_get(glb_v_forwardvecEnd)
    
    
xs_vec_mul_scalar(vecEnd8192.0vecEnd)
    
xs_vec_add(vecSrcvecEndvecEnd)

    
get_tr2(TrResultTR_vecEndPosvecSrc)
    
get_tr2(TrResultTR_vecPlaneNormalvecEnd)
    
    
xs_vec_mul_scalar(vecEnd5.0vecEnd)
    
xs_vec_add(vecSrcvecEndvecEnd)
    
    
TE_FLAG |= TE_EXPLFLAG_NODLIGHTS
    TE_FLAG 
|= TE_EXPLFLAG_NOSOUND
    TE_FLAG 
|= TE_EXPLFLAG_NOPARTICLES
    
    engfunc
(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYvecEnd0)
    
write_byte(TE_EXPLOSION)
    
engfunc(EngFunc_WriteCoordvecEnd[0])
    
engfunc(EngFunc_WriteCoordvecEnd[1])
    
engfunc(EngFunc_WriteCoordvecEnd[2])
    
write_short(g_Exp_SprId)
    
write_byte(5)
    
write_byte(30)
    
write_byte(TE_FLAG)
    
message_end()
}

stock get_weapon_attachment(idFloat:output[3], Float:fDis 40.0)

    new 
Float:vfEnd[3], viEnd[3
    
get_user_origin(idviEnd3)  
    
IVecFVec(viEndvfEnd
    
    new 
Float:fOrigin[3], Float:fAngle[3]
    
    
pev(idpev_originfOrigin
    
pev(idpev_view_ofsfAngle)
    
    
xs_vec_add(fOriginfAnglefOrigin
    
    new 
Float:fAttack[3]
    
    
xs_vec_sub(vfEndfOriginfAttack)
    
xs_vec_sub(vfEndfOriginfAttack
    
    new 
Float:fRate
    
    fRate 
fDis vector_length(fAttack)
    
xs_vec_mul_scalar(fAttackfRatefAttack)
    
    
xs_vec_add(fOriginfAttackoutput)
}

stock radius_damage(idFloat:Origin[3], Float:DamageFloat:Radius)
{
    static 
VictimVictim = -1

    
while((Victim engfunc(EngFunc_FindEntityInSphereVictimOriginRadius)) != 0)
    {
        if(!
is_user_alive(Victim) || id == Victim
            continue
        if(!
zp_get_user_zombie(Victim))
            continue

        
ExecuteHamB(Ham_TakeDamageVictimfm_get_user_weapon_entity(idget_user_weapon(id)), idDamageDMG_BULLET)
    }
}

stock Eject_Shell(idShell_ModelIndexFloat:Time// By Dias
{
    static 
EntEnt get_pdata_cbase(id3735)
    if(!
pev_valid(Ent))
        return

        
set_pdata_int(Ent57Shell_ModelIndex4)
        
set_pdata_float(id111get_gametime() + Time)
}

stock set_weapon_anim(idanim)
{
    if(!
is_user_alive(id))
        return
    
    
set_pev(idpev_weaponanimanim)
    
    
message_begin(MSG_ONE_UNRELIABLESVC_WEAPONANIM, {000}, id)
    
write_byte(anim)
    
write_byte(pev(idpev_body))
    
message_end()


Last edited by asherkin; 06-26-2020 at 21:33. Reason: Add code tags
Al3xandru271 is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 06-25-2020 , 21:18   Re: Error Ak47 balrog for vip
Reply With Quote #2

use php tags
ZaX is offline
Al3xandru271
Junior Member
Join Date: Jun 2020
Old 06-25-2020 , 21:55   Re: Error Ak47 balrog for vip
Reply With Quote #3

that`s it?
Attached Files
File Type: sma Get Plugin or Get Source (Weapon_AK47_BE.sma - 96 views - 13.1 KB)
File Type: sma Get Plugin or Get Source (zm_vip_extra_weapon_AK47_BE.sma - 86 views - 13.2 KB)
Al3xandru271 is offline
Al3xandru271
Junior Member
Join Date: Jun 2020
Old 06-25-2020 , 21:59   Re: Error Ak47 balrog for vip
Reply With Quote #4

And if you can help me make golden ak47 for vip ...
Al3xandru271 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-26-2020 , 02:48   Re: Error Ak47 balrog for vip
Reply With Quote #5

Quote:
Originally Posted by Al3xandru271 View Post
And if you can help me make golden ak47 for vip ...
If you want to edit any zp extra items plugin for vip extra items you have to change one thing "zp to zv"

Example: Change this
PHP Code:
g_Ak47b zp_register_extra_item("AK47 [Balrog Edition]"40ZP_TEAM_HUMAN )

public 
zp_extra_item_selected(iditemid)
{
    if(
itemid == g_Ak47bGet_Ak47b(id)

To this

PHP Code:
#include <zmvip>

g_Ak47b zv_register_extra_item("AK47 [Balrog Edition]"40ZP_TEAM_HUMAN )

public 
zv_extra_item_selected(iditemid)
{
    if(
itemid == g_Ak47bGet_Ak47b(id)


Last edited by Supremache; 06-26-2020 at 02:50.
Supremache is offline
Al3xandru27
Member
Join Date: Oct 2019
Old 06-26-2020 , 06:11   Re: Error Ak47 balrog for vip
Reply With Quote #6

that's what I did and it gives me a compilation error
Al3xandru27 is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 06-26-2020 , 08:21   Re: Error Ak47 balrog for vip
Reply With Quote #7

Quote:
Originally Posted by Supremache View Post
If you want to edit any zp extra items plugin for vip extra items you have to change one thing "zp to zv"

Example: Change this
PHP Code:
g_Ak47b zp_register_extra_item("AK47 [Balrog Edition]"40ZP_TEAM_HUMAN )

public 
zp_extra_item_selected(iditemid)
{
    if(
itemid == g_Ak47bGet_Ak47b(id)

To this

PHP Code:
#include <zmvip>

g_Ak47b zv_register_extra_item("AK47 [Balrog Edition]"40ZP_TEAM_HUMAN )

public 
zv_extra_item_selected(iditemid)
{
    if(
itemid == g_Ak47bGet_Ak47b(id)

Omg man, you do the same wrong thing, you guys forgot that description, i think that the zv thing should look like that:
PHP Code:
g_Ak47b zv_register_extra_item("AK47 [Balrog Edition]"40,""ZP_TEAM_HUMAN 
that "" is that description i was talking about, idk if i wrote good or bad but forgot how it was and i don't have the zm_vip.inc right next to me to see, but you missed a param and that's the problem. In that description you can put anything , like "[Chocolate]" and im the vip menu will show that thing, make "" if you want to don't show anything

Last edited by asherkin; 06-26-2020 at 21:36. Reason: Removed insult
AnimalMonster is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 06-26-2020 , 08:24   Re: Error Ak47 balrog for vip
Reply With Quote #8

I had the same problem so i know that this should work
AnimalMonster is offline
Old 06-26-2020, 08:39
supertrio17
This message has been deleted by asherkin. Reason: Report, don't reply.
Old 06-26-2020, 08:42
Supremache
This message has been deleted by asherkin.
Old 06-26-2020, 08:44
Supremache
This message has been deleted by asherkin.
Old 06-26-2020, 08:47
supertrio17
This message has been deleted by asherkin.
Old 06-26-2020, 09:22
AnimalMonster
This message has been deleted by asherkin.
Al3xandru271
Junior Member
Join Date: Jun 2020
Old 06-26-2020 , 10:15   Re: Error Ak47 balrog for vip
Reply With Quote #9

I did what you said

PHP Code:
#include <zmvip>

g_Ak47b zv_register_extra_item("AK47 [Balrog Edition]"40, &#8222;”, ZP_TEAM_HUMAN ) 

public zv_extra_item_selected(iditemid

I'm getting this error:

PHP Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// zm_vip_extra_weapon_AK47_BE.sma
// C:\Games\Counter Strike 1.6\cstrike\addons\amxmodx\scripting\zm_vip_extra_weapon_AK47_BE.sma(91) : error 035: argument type mismatch (argument 2)
// C:\Games\Counter Strike 1.6\cstrike\addons\amxmodx\scripting\zm_vip_extra_weapon_AK47_BE.sma(91) : error 029: invalid expression, assumed zero
// C:\Games\Counter Strike 1.6\cstrike\addons\amxmodx\scripting\zm_vip_extra_weapon_AK47_BE.sma(91) : error 029: invalid expression, assumed zero
// C:\Games\Counter Strike 1.6\cstrike\addons\amxmodx\scripting\zm_vip_extra_weapon_AK47_BE.sma(91) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 4 Errors.
// Could not locate output file C:\Games\Counter Strike 1.6\cstrike\addons\amxmodx\scripting\compiled\zm_vip_extra_weapon_AK47_BE.amx (compile failed).
//
// Compilation Time: 0.42 sec
// ----------------------------------------

Press enter to exit ... 

Last edited by asherkin; 06-26-2020 at 21:36. Reason: Add code tags
Al3xandru271 is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 06-26-2020 , 23:26   Re: Error Ak47 balrog for vip
Reply With Quote #10

PHP Code:
g_Ak47b zv_register_extra_item("AK47 [Balrog Edition]","LALA”, 40, ZV_TEAM_HUMAN ) 
forget it ,this is the correct one ^

Last edited by AnimalMonster; 06-26-2020 at 23:35.
AnimalMonster is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode