AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Beam do damage when attacking (https://forums.alliedmods.net/showthread.php?t=322185)

wicho 03-18-2020 22:08

Beam do damage when attacking
 
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

wicho 06-12-2020 22:50

Re: Beam do damage when attacking
 
Bump

DJEarthQuake 06-16-2020 09:35

Re: Beam do damage when attacking
 
Use the existing plugin.

Supremache 06-16-2020 13:30

Re: Beam do damage when attacking
 
Quote:

Originally Posted by wicho (Post 2705394)
Bump

What if i made ak 47 with the same laser when you shooting zombies.

wicho 06-16-2020 18:07

Re: Beam do damage when attacking
 
Could you tell me the name please? I tried several names but it was not what I wanted

wicho 02-14-2021 16:37

Re: Beam do damage when attacking
 
Bump, someone?

raizo11 02-15-2021 02:07

Re: Beam do damage when attacking
 
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...

Natsheh 02-15-2021 13:17

Re: Beam do damage when attacking
 
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?

wicho 02-15-2021 14:32

Re: Beam do damage when attacking
 
I use version zp 5.0

Natsheh 02-16-2021 13:43

Re: Beam do damage when attacking
 
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.


All times are GMT -4. The time now is 15:25.

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