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

ZP Kill bomb for humans


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 


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 22:29.


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