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

Shooting star


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FonixPro20
Member
Join Date: Mar 2018
Old 09-21-2023 , 23:58   Shooting star
Reply With Quote #1

Hello,
He is a scripting code of Dias' old version. I had an issue when you shot and switched to weapons. It will show up as a weapon kill msg or whatever you are holding becaouse it should be deagle kill , and if you already have damage for that holding weapon the damage will be multiple

cvar_damage = register_cvar("damage_mult", "2.4")

For example, if a shooting star was 450 damage then i switched to a weapon and the holding weapon was get_pcvar_float(cvar_damage) the damage will be 1350 or maybe more...

Thanks in advance


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

#define PLUGIN "CSO Shooting Star" 
#define VERSION "1.0" 
#define AUTHOR "Dias" 

#define DAMAGE 70 
#define RADIUS 150 
#define AMMO 5 

#define V_MODEL "models/v_firecracker.mdl" 
#define P_MODEL "models/p_firecracker.mdl" 
#define W_MODEL "models/w_firecracker.mdl" 
#define S_MODEL "models/shell_firecracker.mdl" 

new const WeaponSounds[8][] = 

    
"weapons/firecracker-1.wav"
    
"weapons/firecracker-2.wav"
    
"weapons/firecracker_draw.wav"
    
"weapons/firecracker_bounce1.wav"
    
"weapons/firecracker_bounce2.wav"
    
"weapons/firecracker_bounce3.wav"
    
"weapons/firecracker-wick.wav"
    
"weapons/firecracker_explode.wav" 


new const 
WeaponResources[7][] = 

    
"sprites/spark1.spr"
    
"sprites/mooncake.spr"
    
"sprites/muzzleflash18.spr"
    
"sprites/scope_vip_grenade.spr"
    
"sprites/weapon_firecracker.txt"
    
"sprites/640hud7_2.spr"
    
"sprites/640hud72_2.spr" 


enum 

    
FC_ANIM_IDLE 0
    
FC_ANIM_SHOOT1
    
FC_ANIM_SHOOT2
    
FC_ANIM_DRAW 


#define CSW_FIRECRACKER CSW_DEAGLE 
#define weapon_firecracker "weapon_deagle" 

#define OLD_W_MODEL "models/w_deagle.mdl" 
#define WEAPON_EVENT "events/deagle.sc" 
#define WEAPON_SECRETCODE 21321 

new g_Had_Firecracker[33], g_SpecialShoot[33], g_Old_Weapon[33], Float:g_LastShoot[33
new 
g_firecracker_eventg_ham_botg_Exp_SprIdg_Exp2_SprIdg_MF_SprIdg_Trail_SprId 

public plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
     
    
register_event("CurWeapon""Event_CurWeapon""be""1=1"
    
register_event("DeathMsg""Event_DeathMsg""a"
     
    
register_think("grenade2""fw_Grenade_Think"
    
register_touch("grenade2""*""fw_Grenade_Touch"
     
    
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_firecracker"fw_Item_PrimaryAttack"
    
RegisterHam(Ham_Weapon_Reloadweapon_firecracker"fw_Weapon_Reload"
    
RegisterHam(Ham_Item_AddToPlayerweapon_firecracker"fw_Item_AddToPlayer_Post"1
     
    
register_clcmd("admin_get_firecracker""Get_Firecracker"ADMIN_BAN
    
register_clcmd("weapon_firecracker""Hook_Weapon"


public 
plugin_precache() 

    
engfunc(EngFunc_PrecacheModelV_MODEL
    
engfunc(EngFunc_PrecacheModelP_MODEL
    
engfunc(EngFunc_PrecacheModelW_MODEL
    
engfunc(EngFunc_PrecacheModelS_MODEL
     
    new 

    
for(0sizeof(WeaponSounds); i++) 
        
engfunc(EngFunc_PrecacheSoundWeaponSounds[i]) 
    for(
0sizeof(WeaponResources); i++) 
    { 
        if(
== 0g_Exp_SprId engfunc(EngFunc_PrecacheModelWeaponResources[i]) 
        else if(
== 1g_Exp2_SprId engfunc(EngFunc_PrecacheModelWeaponResources[i]) 
        else if(
== 2g_MF_SprId engfunc(EngFunc_PrecacheModelWeaponResources[i]) 
        else if(
== 4engfunc(EngFunc_PrecacheGenericWeaponResources[i]) 
        else 
engfunc(EngFunc_PrecacheModelWeaponResources[i]) 
    } 
     
    
g_Trail_SprId engfunc(EngFunc_PrecacheModel"sprites/laserbeam.spr"
     
    
register_forward(FM_PrecacheEvent"fw_PrecacheEvent_Post"1


public 
fw_PrecacheEvent_Post(type, const name[]) 

    if(
equal(WEAPON_EVENTname)) 
        
g_firecracker_event get_orig_retval()         


public 
client_putinserver(id

    if(!
g_ham_bot && is_user_bot(id)) 
    { 
        
g_ham_bot 
        set_task
(0.1"Do_Register_HamBot"id
    } 


public 
Do_Register_HamBot(id

    
RegisterHamFromEntity(Ham_TraceAttackid"fw_TraceAttack"


public 
Hook_Weapon(id

    
engclient_cmd(idweapon_firecracker
    return 
PLUGIN_HANDLED 


public 
Get_Firecracker(id

    if(!
is_user_alive(id)) 
        return 
         
    
g_Had_Firecracker[id] = 
    g_SpecialShoot
[id] = 
     
    fm_give_item
(idweapon_firecracker
     
    static 
EntEnt fm_get_user_weapon_entity(idCSW_FIRECRACKER
    if(
pev_valid(Ent)) cs_set_weapon_ammo(Ent0
     
    
// Update Ammo 
    
cs_set_user_bpammo(idCSW_FIRECRACKERAMMO
     
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("AmmoX"), _id
    
write_byte(1
    
write_byte(AMMO
    
message_end() 


public 
Remove_Firecracker(id

    if(!
is_user_connected(id)) 
        return 
         
    
g_Had_Firecracker[id] = 
    g_SpecialShoot
[id] = 


public 
Event_CurWeapon(id

    if(!
is_user_alive(id)) 
        return 
         
    static 
CSWIDCSWID read_data(2)     
     
    if((
CSWID == CSW_FIRECRACKER) && g_Had_Firecracker[id]) 
    { 
        if(
g_Old_Weapon[id] != CSW_FIRECRACKER// DRAW 
        

            
set_pev(idpev_viewmodel2V_MODEL
            
set_pev(idpev_weaponmodel2P_MODEL
             
            
set_weapon_anim(idFC_ANIM_DRAW
        } 
         
        
engfunc(EngFunc_MessageBeginMSG_ONE_UNRELIABLEget_user_msgid("CurWeapon"), {000}, id
        
write_byte(1
        
write_byte(CSW_FIRECRACKER
        
write_byte(-1
        
message_end() 
         
        static 
EntEnt fm_get_user_weapon_entity(idCSW_FIRECRACKER
        if(
pev_valid(Ent) && !cs_get_weapon_ammo(Ent)) cs_set_weapon_ammo(Ent0
    } 
     
    
g_Old_Weapon[id] = CSWID 


public 
Event_DeathMsg() 

    static 
VictimVictim read_data(2
    
Remove_Firecracker(Victim


public 
fw_UpdateClientData_Post(idsendweaponscd_handle

    if(!
is_user_alive(id) || !is_user_connected(id)) 
        return 
FMRES_IGNORED     
    
if(get_user_weapon(id) == CSW_FIRECRACKER && g_Had_Firecracker[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_FIRECRACKER || !g_Had_Firecracker[invoker]) 
        return 
FMRES_IGNORED 
    
if(eventid != g_firecracker_event
        return 
FMRES_IGNORED 
     
    engfunc
(EngFunc_PlaybackEventflags FEV_HOSTONLYinvokereventiddelayoriginanglesfparam1fparam2iParam1iParam2bParam1bParam2
     
    
Handle_Shoot(invoker
         
    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_firecrackerentity
         
        if(!
pev_valid(weapon)) 
            return 
FMRES_IGNORED
         
        if(
g_Had_Firecracker[iOwner]) 
        { 
            
Remove_Firecracker(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(
get_user_weapon(id) != CSW_FIRECRACKER || !g_Had_Firecracker[id]) 
        return 
     
    static 
CurButtonCurButton get_uc(uc_handleUC_Buttons
    if((
CurButton IN_ATTACK) && !(pev(idpev_oldbuttons) & IN_ATTACK)) 
    { 
        
CurButton &= ~IN_ATTACK 
        set_uc
(uc_handleUC_ButtonsCurButton
         
        if(
get_pdata_float(id835) > 0.0
            return 
        if(
cs_get_user_bpammo(idCSW_FIRECRACKER) <= 0
            return     
             
        
g_SpecialShoot[id] = 
        Handle_Shoot
(id
    } 
    if((
CurButton IN_ATTACK2) && !(pev(idpev_oldbuttons) & IN_ATTACK2)) 
    { 
        if(
get_pdata_float(id835) > 0.0
            return 
        if(
cs_get_user_bpammo(idCSW_FIRECRACKER) <= 0
            return 
             
        static 
EntEnt fm_get_user_weapon_entity(idCSW_FIRECRACKER
        if(
pev_valid(Ent))  
        { 
            
g_SpecialShoot[id] = 
            Handle_Shoot
(id
            
g_SpecialShoot[id] = 
        

    } 
    if(
CurButton IN_RELOAD
    { 
        
CurButton &= ~IN_RELOAD 
        set_uc
(uc_handleUC_ButtonsCurButton
    } 


public 
fw_TraceAttack(VictimAttackerFloat:DamageFloat:Direction[3], PtrDamageBits

    if(!
is_user_alive(Attacker)) 
        return 
HAM_IGNORED     
    
if(get_user_weapon(Attacker) != CSW_FIRECRACKER || !g_Had_Firecracker[Attacker]) 
        return 
HAM_IGNORED 
         
    
return HAM_SUPERCEDE 


public 
fw_Item_PrimaryAttack(ent

    if(!
pev_valid(ent)) 
        return 
HAM_IGNORED 
         
    
static idid pev(entpev_owner
    if(!
is_user_alive(id) || !g_Had_Firecracker[id]) 
        return 
HAM_IGNORED 

    
static Float:PunchAngles[3
     
    
PunchAngles[0] = PunchAngles[1] = PunchAngles[2] = 0.0 
    set_pev
(idpev_punchanglePunchAngles
         
    return 
HAM_HANDLED 


public 
fw_Weapon_Reload(ent

    static 
idid pev(entpev_owner
     
    if(
is_user_alive(id) && g_Had_Firecracker[id]) 
        return 
HAM_SUPERCEDE 

    
return HAM_IGNORED


public 
fw_Item_AddToPlayer_Post(entid

    if(!
pev_valid(ent)) 
        return 
HAM_IGNORED 
         
    
if(pev(entpev_impulse) == WEAPON_SECRETCODE
    { 
        
g_Had_Firecracker[id] = 
        set_pev
(entpev_impulse0
    }         
     
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("WeaponList"), .player id
    
write_string(g_Had_Firecracker[id] == "weapon_firecracker" "weapon_m4a1"
    
write_byte(8// PrimaryAmmoID 
    
write_byte(35// PrimaryAmmoMaxAmount 
    
write_byte(-1// SecondaryAmmoID 
    
write_byte(-1// SecondaryAmmoMaxAmount 
    
write_byte(1// SlotID (0...N) 
    
write_byte(1// NumberInSlot (1...N) 
    
write_byte(g_Had_Firecracker[id] == CSW_FIRECRACKER CSW_M4A1// WeaponID 
    
write_byte(0// Flags 
    
message_end() 

    return 
HAM_HANDLED     


public 
fw_Grenade_Think(Ent

    if(!
pev_valid(Ent)) 
        return 
         
    static 
Float:Origin[3
    
pev(Entpev_originOrigin
     
    
message_begin(MSG_ALLSVC_TEMPENTITY
    
write_byte(TE_SPARKS
    
engfunc(EngFunc_WriteCoordOrigin[0]) 
    
engfunc(EngFunc_WriteCoordOrigin[1]) 
    
engfunc(EngFunc_WriteCoordOrigin[2]) 
    
message_end() 
     
    if(
get_gametime() - 0.75 pev(Entpev_fuser1)) 
    { 
        
emit_sound(EntCHAN_BODYWeaponSounds[6], VOL_NORMATTN_NORM0PITCH_NORM
        
set_pev(Entpev_fuser1get_gametime()) 
    } 
     
    if(
get_gametime() - pev(Entpev_fuser2) >= 2.0
    { 
        
Grenade_Explosion(Ent
        return 
    } 
         
    
set_pev(Entpev_nextthinkget_gametime() + 0.1


public 
fw_Grenade_Touch(EntId

    if(!
pev_valid(Ent)) 
        return 
         
    static 
BounceBounce pev(Entpev_iuser1
    if(
Bounce
    { 
        
/* 
        static Float:Velocity[3] 
        pev(Ent, pev_velocity, Velocity) 
         
        xs_vec_mul_scalar(Velocity, 0.9, Velocity) 
        set_pev(Ent, pev_velocity, Velocity)*/ 
         
        
emit_sound(EntCHAN_BODYWeaponSounds[random_num(35)], VOL_NORMATTN_NORM0PITCH_NORM
    } else { 
        
Grenade_Explosion(Ent
    } 


public 
Grenade_Explosion(Ent

    static 
Float:Origin[3], TE_FLAG 
    pev
(Entpev_originOrigin
     
    
TE_FLAG |= TE_EXPLFLAG_NODLIGHTS 
    TE_FLAG 
|= TE_EXPLFLAG_NOSOUND 
    TE_FLAG 
|= TE_EXPLFLAG_NOPARTICLES 
     
    engfunc
(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYOrigin
    
write_byte(TE_EXPLOSION
    
engfunc(EngFunc_WriteCoordOrigin[0]) 
    
engfunc(EngFunc_WriteCoordOrigin[1]) 
    
engfunc(EngFunc_WriteCoordOrigin[2] + 36.0
    
write_short(g_Exp_SprId
    
write_byte(10
    
write_byte(30
    
write_byte(TE_FLAG
    
message_end()     
     
    
engfunc(EngFunc_MessageBeginMSG_PASSVC_TEMPENTITYOrigin
    
write_byte(TE_EXPLOSION
    
engfunc(EngFunc_WriteCoordOrigin[0]) 
    
engfunc(EngFunc_WriteCoordOrigin[1]) 
    
engfunc(EngFunc_WriteCoordOrigin[2] + 36.0
    
write_short(g_Exp2_SprId
    
write_byte(10
    
write_byte(30
    
write_byte(TE_FLAG
    
message_end()         
     
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY
    
write_byte(TE_WORLDDECAL
    
engfunc(EngFunc_WriteCoordOrigin[0]) 
    
engfunc(EngFunc_WriteCoordOrigin[1]) 
    
engfunc(EngFunc_WriteCoordOrigin[2]) 
    
write_byte(random_num(4648)) 
    
message_end()         
     
    
emit_sound(EntCHAN_BODYWeaponSounds[7], VOL_NORMATTN_NORM0PITCH_NORM
    
Check_RadiusDamage(Entpev(Entpev_owner)) 
     
    
engfunc(EngFunc_RemoveEntityEnt


public 
Handle_Shoot(id

    if(
get_gametime() - 2.5 g_LastShoot[id]) 
    { 
        
g_LastShoot[id] = get_gametime() 
         
        static 
EntEnt fm_get_user_weapon_entity(idCSW_FIRECRACKER
        if(!
pev_valid(Ent)) return 
         
        static 
AmmoAmmo cs_get_user_bpammo(idCSW_FIRECRACKER
        if(
Ammo <= 0) return 
         
        
Ammo-- 
        
cs_set_user_bpammo(idCSW_FIRECRACKERAmmo
         
        if(
Ammo <= 0)  
        { 
            
set_weapon_anim(idFC_ANIM_SHOOT2
            
emit_sound(idCHAN_WEAPONWeaponSounds[1], VOL_NORMATTN_NORM0PITCH_NORM
        } else { 
            
set_weapon_anim(idFC_ANIM_SHOOT1
            
emit_sound(idCHAN_WEAPONWeaponSounds[0], VOL_NORMATTN_NORM0PITCH_NORM
        } 
         
        
Make_Muzzleflash(id
        
Make_PunchAngles(id
     
        
set_weapons_timeidle(id2.5
        
set_player_nextattack(id2.5
         
        
Make_Grenade(idg_SpecialShoot[id]) 
    } 


public 
Make_Muzzleflash(id

    static 
Float:Origin[3], TE_FLAG 
    get_position
(id80.020.0, -10.0Origin
     
    
TE_FLAG |= TE_EXPLFLAG_NODLIGHTS 
    TE_FLAG 
|= TE_EXPLFLAG_NOSOUND 
    TE_FLAG 
|= TE_EXPLFLAG_NOPARTICLES 
     
    engfunc
(EngFunc_MessageBeginMSG_ONE_UNRELIABLESVC_TEMPENTITYOriginid
    
write_byte(TE_EXPLOSION
    
engfunc(EngFunc_WriteCoordOrigin[0]) 
    
engfunc(EngFunc_WriteCoordOrigin[1]) 
    
engfunc(EngFunc_WriteCoordOrigin[2]) 
    
write_short(g_MF_SprId
    
write_byte(3
    
write_byte(20
    
write_byte(TE_FLAG
    
message_end() 


public 
Make_PunchAngles(id

    static 
Float:PunchAngles[3
     
    
PunchAngles[0] = random_float(-2.00.0
    
PunchAngles[1] = random_float(-1.01.0
     
    
set_pev(idpev_punchanglePunchAngles


public 
Make_Grenade(idBounce

    static 
EntEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 
    if(!
pev_valid(Ent)) return 
     
    static 
Float:Origin[3], Float:Angles[3
     
    
get_position(id50.010.00.0Origin
    
pev(idpev_anglesAngles
     
    
set_pev(Entpev_movetypeMOVETYPE_BOUNCE
    
set_pev(Entpev_solidSOLID_BBOX
    
set_pev(Entpev_nextthinkget_gametime() + 0.1
     
    
set_pev(Entpev_classname"grenade2"
    
engfunc(EngFunc_SetModelEntS_MODEL
    
set_pev(Entpev_originOrigin
    
set_pev(Entpev_anglesAngles
    
set_pev(Entpev_ownerid
     
    
set_pev(Entpev_iuser1Bounce
    
set_pev(Entpev_fuser2get_gametime()) 
     
    
// Create Velocity 
    
static Float:Velocity[3], Float:TargetOrigin[3
     
    
fm_get_aim_origin(idTargetOrigin
    
get_speed_vector(OriginTargetOrigin700.0Velocity
     
    
set_pev(Entpev_velocityVelocity
     
    
// Make a Beam 
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY
    
write_byte(TE_BEAMFOLLOW
    
write_short(Ent// entity 
    
write_short(g_Trail_SprId// sprite 
    
write_byte(10)  // life 
    
write_byte(3)  // width 
    
write_byte(255// r 
    
write_byte(170)  // g 
    
write_byte(212)  // b 
    
write_byte(200// brightness 
    
message_end()     


public 
Check_RadiusDamage(EntId

    new 
iTeamiAttackerTeam;

    static 
Attacker 

    
if(is_user_connected(Id))
    {
        
Attacker Id
        iAttackerTeam 
get_user_team(Attacker)
    }
    else  
        
Attacker 0

    
for(new 0get_maxplayers(); i++) 
    { 
        if(!
is_user_alive(i)) 
            continue 

        if(
== Attacker
            continue 

        if(
entity_range(Enti) > float(RADIUS)) 
            continue

        
iTeam get_user_team(i);

        if (
iTeam == iAttackerTeam)
            continue;

        
ExecuteHamB(Ham_TakeDamageiAttackerAttackerfloat(DAMAGE), DMG_GENERIC
    } 


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:numnum 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 get_position(id,Float:forwFloat:rightFloat:upFloat:vStart[]) 

    static 
Float:vOrigin[3], Float:vAngle[3], Float:vForward[3], Float:vRight[3], Float:vUp[3
     
    
pev(idpev_originvOrigin
    
pev(idpev_view_ofsvUp//for player 
    
xs_vec_add(vOriginvUpvOrigin
    
pev(idpev_v_anglevAngle// if normal entity ,use pev_angles 
     
    
angle_vector(vAngle,ANGLEVECTOR_FORWARDvForward//or use EngFunc_AngleVectors 
    
angle_vector(vAngle,ANGLEVECTOR_RIGHTvRight
    
angle_vector(vAngle,ANGLEVECTOR_UPvUp
     
    
vStart[0] = vOrigin[0] + vForward[0] * forw vRight[0] * right vUp[0] * up 
    vStart
[1] = vOrigin[1] + vForward[1] * forw vRight[1] * right vUp[1] * up 
    vStart
[2] = vOrigin[2] + vForward[2] * forw vRight[2] * right vUp[2] * up 


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() 


stock set_weapons_timeidle(idFloat:TimeIdle

    if(!
is_user_alive(id)) 
        return 
         
    static 
EntEnt fm_get_user_weapon_entity(idCSW_FIRECRACKER
    if(!
pev_valid(Ent))  
        return 
     
    
set_pdata_float(Ent46TimeIdle4
    
set_pdata_float(Ent47TimeIdle4
    
set_pdata_float(Ent48TimeIdle 1.04


stock set_player_nextattack(idFloat:nexttime

    if(!
is_user_alive(id)) 
        return 
         
    
set_pdata_float(id83nexttime5

FonixPro20 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 09-22-2023 , 11:33   Re: Shooting star
Reply With Quote #2

May help:

1. Set the WEAPON_SECRETCODE to the entity when you shoot it.
2. Change

PHP Code:
ExecuteHamB(Ham_TakeDamageiAttackerAttackerfloat(DAMAGE), DMG_GENERIC
to

PHP Code:
// Replaceed Attacker with Ent in the third parameter. So it will pass the iInflictor (entity) to the Ham_TakeDamage forward.
ExecuteHamB(Ham_TakeDamageiEntAttackerfloat(DAMAGE), DMG_GENERIC
3. Inside the TakeDamage, check if the iInflictor (now, the entity), has the Shooting Star WEAPON_SECRETCODE before multiplying.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
FonixPro20
Member
Join Date: Mar 2018
Old 09-22-2023 , 20:09   Re: Shooting star
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
May help:

1. Set the WEAPON_SECRETCODE to the entity when you shoot it.
2. Change

PHP Code:
ExecuteHamB(Ham_TakeDamageiAttackerAttackerfloat(DAMAGE), DMG_GENERIC
to

PHP Code:
// Replaceed Attacker with Ent in the third parameter. So it will pass the iInflictor (entity) to the Ham_TakeDamage forward.
ExecuteHamB(Ham_TakeDamageiEntAttackerfloat(DAMAGE), DMG_GENERIC
3. Inside the TakeDamage, check if the iInflictor (now, the entity), has the Shooting Star WEAPON_SECRETCODE before multiplying.
I tried to check iInflictor inside TakeDamage but didn't work with me!
How do I Set the WEAPON_SECRETCODE to the entity and check iInflictor?

Last edited by FonixPro20; 09-22-2023 at 20:18.
FonixPro20 is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 09-23-2023 , 00:42   Re: Shooting star
Reply With Quote #4

Many ways. You can use any of pev_iuser*
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 09-23-2023 , 17:50   Re: Shooting star
Reply With Quote #5

u can set the damage in the curweapon event aswell, every time that u change the weapon, the damage will change.

Last edited by MrPickles; 09-23-2023 at 17:50.
MrPickles is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 09-23-2023 , 17:57   Re: Shooting star
Reply With Quote #6

Quote:
Originally Posted by MrPickles View Post
u can set the damage in the curweapon event aswell, every time that u change the weapon, the damage will change.
No. Curweapon should only be used if really necessary. Effx provided a good example, OP has all he needs to accomplish his needs. You should ignore everything you read on zombie sub-plugins. They are poorly coded.
__________________
Jhob94 is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 10-02-2023 , 18:13   Re: Shooting star
Reply With Quote #7

Quote:
Originally Posted by Jhob94 View Post
No. Curweapon should only be used if really necessary. Effx provided a good example, OP has all he needs to accomplish his needs. You should ignore everything you read on zombie sub-plugins. They are poorly coded.
My mistake, sorry, I read wrong, I thought he wanted the damage to change depending on the weapon he has, and in that case he would have to use cur weapon, because you will be changing its value depending on what weapon you are scrolling but oh well.

The error was that the name of the death message made by his entity was whatever name of the weapon he was holding, but that is easy to fix, you just have to set the classname with the death message to the entity when creating it

and then place the ExecuteDamage like this:

PHP Code:

ExecuteHamB
(Ham_TakeDamageiEntAttackerfloat(DAMAGE), DMG_GENERIC
MrPickles 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 09:20.


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