Raised This Month: $7 Target: $400
 1% 

ZP Kill bomb for humans


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ssand
Member
Join Date: Jan 2017
Old 06-07-2021 , 12:35   ZP Kill bomb for humans
Reply With Quote #1

Hello everyone, i found this plugin (kill bomb for humans) and when I wanted to test how it works, I found it's just a light bomb, it's not a kill bomb.
can anyone fix it to me please or any help
thanks.

MOD ZP 4.4

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <zombieplague>

#define PLUGIN "ZP Extra KillBomb NewWay"
#define VERSION "1.0.0"
#define AUTHOR "yokomo"

const Float:NADE_EXPLOSION_RADIUS 240.0
const PEV_NADE_TYPE pev_flTimeStepSound
const NADE_TYPE_KILLBOMB 6669

const COLOR_R 237
const COLOR_G 60
const COLOR_B 202

const BUY_LIMIT 10

new const ITEM_NAME[] = "Kill Bomb"
new const ITEM_COST 55

new const MODEL_P[] = "models/zombie_plague/p_kill_bomb_humans.mdl"
new const MODEL_V[] = "models/zombie_plague/v_kill_bomb_humans.mdl"
new const MODEL_W[] = "models/zombie_plague/w_kill_bomb_humans.mdl"

new const SPRITES_TRAIL[] = "sprites/laserbeam.spr"
new const SPRITES_EXPLODE[] = "sprites/blue.spr"

new const SOUND_BUY[] = "zombie_plague/killbomb_buy.wav"
new const SOUND_EXPLODE[] = "zombie_plague/killbomb_exp.wav"

new g_itemid_killbombg_killbomb_spr_trailg_killbomb_spr_expg_maxplayersg_roundendg_killbombbuycount
new g_haskillbomb[33], g_killedbykillbomb[33]
new 
cvar_bonushpcvar_nemfree

public plugin_precache()
{
    
precache_model(MODEL_P)
    
precache_model(MODEL_V)
    
precache_model(MODEL_W)
    
    
g_killbomb_spr_trail precache_model(SPRITES_TRAIL)
    
g_killbomb_spr_exp precache_model(SPRITES_EXPLODE)
    
    
precache_sound(SOUND_BUY)
    
precache_sound(SOUND_EXPLODE)
}

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""EventHLTV""a""1=0""2=0")
    
register_event("DeathMsg""EventDeathMsg""a")
    
register_event("CurWeapon""EventCurWeapon""be""1=1")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
register_message(get_user_msgid("DeathMsg"), "MessageDeathMsg")
    
    
register_forward(FM_SetModel"fw_SetModel")
    
RegisterHam(Ham_Think"grenade""fw_ThinkGrenade")
    
    
cvar_bonushp register_cvar("zp_killbomb_hp","10000")
    
cvar_nemfree register_cvar("zp_killbomb_nem","1")
    
    
g_maxplayers get_maxplayers()
    
g_itemid_killbomb zp_register_extra_item(ITEM_NAMEITEM_COSTZP_TEAM_HUMAN)
}

public 
client_putinserver(idg_haskillbomb[id] = 0

public client_disconnect(idg_haskillbomb[id] = 0

public EventHLTV()
{
    
g_killbombbuycount 0
    
    
for(new id 1id <= g_maxplayersid++)
    {
        if(
is_user_connected(id)) g_haskillbomb[id] = 0
    
}    
}

public 
EventDeathMsg()
{
    new 
id read_data(2)
    if(
is_user_connected(id)) g_haskillbomb[id] = 0
}

public 
EventCurWeapon(id)
{
    if(
g_haskillbomb[id])
    {
        if(
get_user_weapon(id) == CSW_SMOKEGRENADE)
        {
            
set_pev(idpev_viewmodel2MODEL_V)
            
set_pev(idpev_weaponmodel2MODEL_P)
        }
    }
}

public 
MessageDeathMsg(msg_idmsg_destid)
{
    static 
attackervictim
    attacker 
get_msg_arg_int(1)
    
victim get_msg_arg_int(2)
    
    if(!
is_user_connected(attacker) || attacker == victim) return PLUGIN_CONTINUE
    
    
if(g_killedbykillbomb[victim]) set_msg_arg_string(4"grenade")
    
    return 
PLUGIN_CONTINUE
}

public 
logevent_round_end() g_roundend 1

public zp_round_started() g_roundend 0

public zp_extra_item_selected(iditem)
{
    if(
item == g_itemid_killbomb)
    {
        if(
g_roundend)
        {
            
client_print(idprint_chat"[ZP] Item not available at this time.")
            return 
ZP_PLUGIN_HANDLED
        
}
        if(
g_killbombbuycount >= BUY_LIMIT)
        {
            
client_print(idprint_chat"[ZP] Maximum usage has been reach (max: %i)."BUY_LIMIT)
            return 
ZP_PLUGIN_HANDLED
        
}
        if(
user_has_weapon(idCSW_SMOKEGRENADE))
        {
            
client_print(idprint_chat"[ZP] Current grenade slot is full (SmokeGrenade).")
            return 
ZP_PLUGIN_HANDLED
        
}
        if(
g_haskillbomb[id])
        {
            
client_print(idprint_chat"[ZP] You already have a %s."ITEM_NAME)
            return 
ZP_PLUGIN_HANDLED
        
}
        
        
g_killbombbuycount += 1
        g_haskillbomb
[id] = 1
        give_item
(id"weapon_smokegrenade")
        
client_print(idprint_chat"[ZP] You have bought a %s."ITEM_NAME)
        
emit_sound(idCHAN_VOICESOUND_BUY1.0ATTN_NORM0PITCH_NORM)
    }
    
    return 
PLUGIN_CONTINUE
}

public 
zp_user_infected_post(id)
{
    if(
zp_get_user_nemesis(id) && get_pcvar_num(cvar_nemfree))
    {
        
g_haskillbomb[id] = 1
        give_item
(id"weapon_smokegrenade")
        
client_print(idprint_center"*** You got a %s, enjoy killing humans ***"ITEM_NAME)
    }
}

public 
zp_user_humanized_post(idg_haskillbomb[id] = 0

public fw_SetModel(entity, const model[])
{
    if(!
pev_valid(entity)) return FMRES_IGNORED
    
    
static Float:dmgtime
    pev
(entitypev_dmgtimedmgtime)
    
    if(
dmgtime == 0.0) return FMRES_IGNORED
    
    
static ownerowner pev(entitypev_owner)
    if(
g_haskillbomb[owner] && equal(model[7], "w_sm"4))
    {
        
set_rendering(entitykRenderFxGlowShellCOLOR_RCOLOR_GCOLOR_BkRenderNormal0)
            
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
        
write_byte(TE_BEAMFOLLOW)
        
write_short(entity)
        
write_short(g_killbomb_spr_trail)
        
write_byte(10)
        
write_byte(3)
        
write_byte(COLOR_R)
        
write_byte(COLOR_G)
        
write_byte(COLOR_B)
        
write_byte(192)
        
message_end()
        
        
set_pev(entityPEV_NADE_TYPENADE_TYPE_KILLBOMB)
        
engfunc(EngFunc_SetModelentityMODEL_W)
        
g_haskillbomb[owner] = 0
        
        
return FMRES_SUPERCEDE
    
}
    
    return 
FMRES_IGNORED
}

public 
fw_ThinkGrenade(entity)
{
    if(!
pev_valid(entity)) return HAM_IGNORED
    
    
static Float:dmgtimeFloat:current_time
    pev
(entitypev_dmgtimedmgtime)
    
current_time get_gametime()
    
    if(
dmgtime current_time) return HAM_IGNORED
    
    
if(pev(entityPEV_NADE_TYPE) == NADE_TYPE_KILLBOMB)
    {
        
KillBombExplode(entity)
        return 
HAM_SUPERCEDE
    
}
    
    return 
HAM_IGNORED
}

KillBombExplode(ent)
{
    if (
g_roundend) return
    
    static 
Float:originF[3]
    
pev(entpev_originoriginF)
    
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(TE_EXPLOSION)
    
write_coord(floatround(originF[0]))
    
write_coord(floatround(originF[1]))
    
write_coord(floatround(originF[2]))
    
write_short(g_killbomb_spr_exp)
    
write_byte(40)
    
write_byte(30)
    
write_byte(14)
    
message_end()
    
    
emit_sound(entCHAN_WEAPONSOUND_EXPLODE1.0ATTN_NORM0PITCH_NORM)
    
    static 
attacker
    attacker 
pev(entpev_owner)
    if (!
is_user_connected(attacker))
    {
        
engfunc(EngFunc_RemoveEntityent)
        return
    }
    
    static 
victim
    victim 
= -1
    
    
while((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFNADE_EXPLOSION_RADIUS)) != 0)
    {
        if(!
is_user_alive(victim) || !zp_get_user_zombie(victim) || zp_get_user_nemesis(victim))
            continue
        
        
g_killedbykillbomb[victim] = 1
        ExecuteHamB
(Ham_Killedvictimattacker0)
        
g_killedbykillbomb[victim] = 0
        
        
static healthhealth get_user_health(attacker)
        
set_user_health(attackerhealth+get_pcvar_num(cvar_bonushp))
    }
    
    
engfunc(EngFunc_RemoveEntityent)


Last edited by Ssand; 06-07-2021 at 12:42.
Ssand is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-07-2021 , 19:13   Re: ZP Kill bomb for humans
Reply With Quote #2

That's probably happening because zombie mod is also replacing the smoke grenade. Try to enable the kill bomb plugin before the zombie one.
__________________








CrazY. is offline
Ssand
Member
Join Date: Jan 2017
Old 06-08-2021 , 05:30   Re: ZP Kill bomb for humans
Reply With Quote #3

Quote:
Originally Posted by CrazY. View Post
That's probably happening because zombie mod is also replacing the smoke grenade. Try to enable the kill bomb plugin before the zombie one.
What do u mean about enable the kill bomb plugin ?
can u explain more please.
Ssand is offline
Ssand
Member
Join Date: Jan 2017
Old 06-08-2021 , 05:44   Re: ZP Kill bomb for humans
Reply With Quote #4

Quote:
Originally Posted by CrazY. View Post
That's probably happening because zombie mod is also replacing the smoke grenade. Try to enable the kill bomb plugin before the zombie one.
it's a little weird because it worked once and when it killed zombies i got 10k health and that is bug
idk what how to fix it.
Ssand is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 06-08-2021 , 06:16   Re: ZP Kill bomb for humans
Reply With Quote #5

Quote:
Originally Posted by Ssand View Post
it's a little weird because it worked once and when it killed zombies i got 10k health and that is bug
idk what how to fix it.
It is not a bug. That is how it work
What the plugin does is the nade will kill 1 random Zombie in range and give the killer 10000 HP (HP Cvar: zp_killbomb_hp)

If you still have the default Flare Nade plugin of ZP running, disable it
Both use Smoke Grenade so it got overlap.

PHP Code:
    while((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFNADE_EXPLOSION_RADIUS)) != 0)
    {
        if(!
is_user_alive(victim) || !zp_get_user_zombie(victim) || zp_get_user_nemesis(victim))
            continue
        
        
g_killedbykillbomb[victim] = 1
        ExecuteHamB
(Ham_Killedvictimattacker0)
        
g_killedbykillbomb[victim] = 0
        
        
static healthhealth get_user_health(attacker)
        
set_user_health(attackerhealth+get_pcvar_num(cvar_bonushp))
    } 
__________________
My plugin:

Last edited by Celena Luna; 06-08-2021 at 06:35.
Celena Luna is offline
Ssand
Member
Join Date: Jan 2017
Old 06-08-2021 , 10:26   Re: ZP Kill bomb for humans
Reply With Quote #6

Yes guys is true, thanks Crazy and Celena, but how do I make them both work?
and without give hp when kill zombies.
Ssand is offline
Ssand
Member
Join Date: Jan 2017
Old 06-08-2021 , 10:44   Re: ZP Kill bomb for humans
Reply With Quote #7

Quote:
Originally Posted by Celena Luna View Post
It is not a bug. That is how it work
What the plugin does is the nade will kill 1 random Zombie in range and give the killer 10000 HP (HP Cvar: zp_killbomb_hp)

If you still have the default Flare Nade plugin of ZP running, disable it
Both use Smoke Grenade so it got overlap.

PHP Code:
    while((victim engfunc(EngFunc_FindEntityInSpherevictimoriginFNADE_EXPLOSION_RADIUS)) != 0)
    {
        if(!
is_user_alive(victim) || !zp_get_user_zombie(victim) || zp_get_user_nemesis(victim))
            continue
        
        
g_killedbykillbomb[victim] = 1
        ExecuteHamB
(Ham_Killedvictimattacker0)
        
g_killedbykillbomb[victim] = 0
        
        
static healthhealth get_user_health(attacker)
        
set_user_health(attackerhealth+get_pcvar_num(cvar_bonushp))
    } 
i got a problem, it works in two rounds or one and then it comes back as a light, but it doesn't turn on even though Flare Nade is disabled.
Ssand is offline
Ssand
Member
Join Date: Jan 2017
Old 06-09-2021 , 04:06   Re: ZP Kill bomb for humans
Reply With Quote #8

how can I make them both work?
Kill bomb and Flare Nade because i dont want disable Flare Nade.
Ssand is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 06-14-2021 , 00:53   Re: ZP Kill bomb for humans
Reply With Quote #9

Quote:
Originally Posted by Ssand View Post
how can I make them both work?
Kill bomb and Flare Nade because i dont want disable Flare Nade.
You have to sacrificed Flame, Frost or Flare for this Kill bomb to work
__________________
My plugin:
Celena Luna is offline
Ssand
Member
Join Date: Jan 2017
Old 06-14-2021 , 04:22   Re: ZP Kill bomb for humans
Reply With Quote #10

Quote:
Originally Posted by Celena Luna View Post
You have to sacrificed Flame, Frost or Flare for this Kill bomb to work
but there is no other way for everything to work or if there is another kill bomb plugin works fine without sacrificed.
Ssand is offline
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 06:43.


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