Raised This Month: $32 Target: $400
 8% 

Beam do damage when attacking


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 03-18-2020 , 22:08   Beam do damage when attacking
Reply With Quote #1

Hi everyone, could someone make a plugin of a beam that does damage as seen in the video? https://www.youtube.com/watch?v=PMl9YIN_nSM It is a beam that a player can buy with ammo packs (you can do it with normal money, then I adapt it to buy with ammo packs).

the plugin consists of:

-It is a white beam/blue (like video)
-Only CT can buy.
-The white beam appears when a player shoots at the enemy.
-The beam can attack multiple players (if it is attacking it, like video).
-The beam does 10 hp damage every second. (the damage can be changed by a cvar)
-If the player stops attacking, it gradually disappears. (like in the video)
-The beam appears in a certain radius, I mean, it does not appear if the victim is very far away. (the radius can be changed by a cvar)

Could someone help me create this plugin please or could you give me an example to guide me please ... thanks in advance

Last edited by wicho; 06-12-2020 at 22:53.
wicho is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 06-12-2020 , 22:50   Re: Beam do damage when attacking
Reply With Quote #2

Bump
wicho is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 06-16-2020 , 09:35   Re: Beam do damage when attacking
Reply With Quote #3

Use the existing plugin.
__________________
DJEarthQuake is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 06-16-2020 , 13:30   Re: Beam do damage when attacking
Reply With Quote #4

Quote:
Originally Posted by wicho View Post
Bump
What if i made ak 47 with the same laser when you shooting zombies.
Supremache is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 06-16-2020 , 18:07   Re: Beam do damage when attacking
Reply With Quote #5

Could you tell me the name please? I tried several names but it was not what I wanted
wicho is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 02-14-2021 , 16:37   Re: Beam do damage when attacking
Reply With Quote #6

Bump, someone?
wicho is offline
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 02-15-2021 , 02:07   Re: Beam do damage when attacking
Reply With Quote #7

just stay calm becouse cs1.6 is not suported any more...if want something oxicrom or netsash will suported you....becouse this guis only amxx know nothing else...

Last edited by raizo11; 02-15-2021 at 02:11.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-15-2021 , 13:17   Re: Beam do damage when attacking
Reply With Quote #8

what ? lmao ? raizo11 can you even spell a proper word!

Also as he didn't disobey the rules and didn't bump his thread after a short time of his request therefore for his patiency ill fulfil his request.

but first i would like to know which zombie mod are you using?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-15-2021 at 13:18.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 02-15-2021 , 14:32   Re: Beam do damage when attacking
Reply With Quote #9

I use version zp 5.0
wicho is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-16-2021 , 13:43   Re: Beam do damage when attacking
Reply With Quote #10

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <zp50_core>
#include <zp50_items>

#define PLUGIN "[ZP] Item: Protective beam"
#define VERSION "1.0"
#define AUTHOR "Natsheh"

#define ITEM_NAME "Beam protection"
#define ITEM_COST 25

#define player_flag(%1)            (1<<(%1 & 31))
#define set_flag(%1,%2)            (%1 |= player_flag(%2))
#define remove_flag(%1,%2)        (%1 &= ~player_flag(%2))
#define check_flag(%1,%2)        (%1 & player_flag(%2))

// SUPPORT AMXX 182
#if !defined write_coord_f
#define write_coord_f(%1) engfunc(EngFunc_WriteCoord, %1)
#endif

#if AMXX_VERSION_NUM > 182
#define client_disconnect client_disconnected
#endif

static g_ItemIDg_beam_sprite;
static 
g_fwid;
static 
g_max_clients;
static 
Float:g_fDelay33 ];

static const 
g_guns_events[][] = {
        
"events/awp.sc",
        
"events/g3sg1.sc",
        
"events/ak47.sc",
        
"events/scout.sc",
        
"events/m249.sc",
        
"events/m4a1.sc",
        
"events/sg552.sc",
        
"events/aug.sc",
        
"events/sg550.sc",
        
"events/m3.sc",
        
"events/xm1014.sc",
        
"events/usp.sc",
        
"events/mac10.sc",
        
"events/ump45.sc",
        
"events/fiveseven.sc",
        
"events/p90.sc",
        
"events/deagle.sc",
        
"events/p228.sc",
        
"events/glock18.sc",
        
"events/mp5n.sc",
        
"events/tmp.sc",
        
"events/elite_left.sc",
        
"events/elite_right.sc",
        
"events/galil.sc",
        
"events/famas.sc"
}

static 
g_guns_eventids_bitsumg_user_has_item;
static 
g_cvar_oneg_cvar_twog_cvar_three;

public 
plugin_precache()
{
    
g_beam_sprite precache_model("sprites/laserbeam.spr");
    
g_fwid register_forward(FM_PrecacheEvent"fwPrecacheEvent"1)
}

public 
fwPrecacheEvent(type, const name[]) {
    for (new 
0sizeof g_guns_events; ++i) {
        if (
equal(g_guns_events[i], name)) {
            
g_guns_eventids_bitsum |= (1<<get_orig_retval())
            return 
FMRES_HANDLED
        
}
    }

        return 
FMRES_IGNORED
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_ItemID zp_items_register(ITEM_NAMEITEM_COST)
    
    
unregister_forward(FM_PrecacheEventg_fwid1)
    
    
register_forward(FM_PlaybackEvent"fwPlaybackEvent")
    
    
g_max_clients global_get(glb_maxClients);
    
    
g_cvar_one register_cvar("zp_protective_beam_range""300");
    
g_cvar_two register_cvar("zp_protective_beam_dmg""50");
    
g_cvar_three register_cvar("zp_protective_beam_cooldown""1");
}

public 
zp_fw_items_select_pre(iditemidignorecost)
{
    
// This is not our item
    
if (itemid != g_ItemID)
    {
        return 
ZP_ITEM_AVAILABLE;
    }
    
    
// item only available to humans
    
if (zp_core_is_zombie(id))
    {
        return 
ZP_ITEM_DONT_SHOW;
    }
    
    if (
check_flag(g_user_has_item,id))
    {
        return 
ZP_ITEM_NOT_AVAILABLE;
    }
    
    return 
ZP_ITEM_AVAILABLE;
}

public 
zp_fw_items_select_post(iditemidignorecost)
{
    
// This is not our item
    
if (itemid != g_ItemID)
        return;
    
    
set_flag(g_user_has_item,id);
}

public 
client_disconnect(id)
{
    
remove_flag(g_user_has_item,id);
}

public 
zp_fw_core_infect_post(id)
{
    
remove_flag(g_user_has_item,id);
}

public 
fwPlaybackEvent(flagsinvokereventid) {
    if (!(
g_guns_eventids_bitsum & (1<<eventid)) || !(<= invoker <= g_max_clients) || !check_flag(g_user_has_item,invoker))
        return 
FMRES_IGNORED
    
    beam_action
(invoker);
    return 
FMRES_HANDLED
}

beam_action(id)
{
    static 
Float:fGametimeentfGametime get_gametime();
    
    if(
fGametime g_fDelayid ]) return;
    
    static 
Float:fOrigin[3], Float:fTOrigin[3], Float:fRadiusFloat:flDamagefRadius get_pcvar_float(g_cvar_one);
    
pev(idpev_originfOrigin);
    
flDamage get_pcvar_float(g_cvar_two);
    
    
ent = -1;
    while((
ent=find_ent_in_sphere(entfOriginfRadius)))
    {
        if( !(
<= ent <= g_max_clients) ) continue;
        
pev(entpev_originfTOrigin);
        if(
zp_core_is_zombie(ent) && is_in_viewcone(idfTOrigin1))
        {
            
create_beam(fOriginfTOrigin, { 225225225 }, 5510225);
            
ExecuteHamB(Ham_TakeDamageentididflDamageDMG_ENERGYBEAM);
        }
    }
    
    
g_fDelayid ] = get_pcvar_float(g_cvar_three) + fGametime;
}

create_beam(Float:fStart[3], Float:fEnd[3], iColors[3], iFramerateiWidthiLifeiBrightness)
{
    
enum _:(+=1) { 0G};
    
enum _:(+=1) { 0Y};
    
    
message_begin(MSG_ALLSVC_TEMPENTITY_0);
    
write_byte(TE_BEAMPOINTS);
    
write_coord_f(Float:fStart]);
    
write_coord_f(Float:fStart]);
    
write_coord_f(Float:fStart]);
    
write_coord_f(Float:fEnd]);
    
write_coord_f(Float:fEnd]);
    
write_coord_f(Float:fEnd]);
    
write_short(g_beam_sprite);
    
write_byte(0);
    
write_byte(iFramerate);
    
write_byte(iLife);
    
write_byte(iWidth);
    
write_byte);
    
write_byte(iColors]);
    
write_byte(iColors]);
    
write_byte(iColors]);
    
write_byte(iBrightness);
    
write_byte);
    
message_end();

give this a try and tell me the result.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-16-2021 at 13:57.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Reply


Thread Tools
Display Modes

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 00:35.


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