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

Help with bonus box for zp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dan1094x
New Member
Join Date: Sep 2019
Old 09-07-2019 , 13:40   Help with bonus box for zp
Reply With Quote #1

Hello, can anyone help me? I am trying to make the bonus box only of ammo packs without other items . Thank you!
Attached Files
File Type: txt bonus_box.txt (2.3 KB, 48 views)
File Type: sma Get Plugin or Get Source (zp_addon_bonus_box.sma - 200 views - 7.3 KB)
Dan1094x is offline
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 09-08-2019 , 07:27   Re: Help with bonus box for zp
Reply With Quote #2

PHP Code:
/*
Name: [ZP] Addon: Bonus Box
Author: PomanoB & STRELOK
Version 1.0

Based on [ZP] DM Item's by PomanoB
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <zombieplague>
#include <hamsandwich>

#define PLUGIN "[ZP] Addon: Bonus Box"
#define VERSION "1.0"
#define AUTHOR "PomanoB & Accelerator"

#define OFFSET_FLASH_AMMO 387
#define OFFSET_HE_AMMO 388
#define OFFSET_SMOKE_AMMO 389

new const item_class_name[] = "dm_item"

new g_models[][] = {"models/zombie_plague/presents.mdl"}

public 
plugin_precache()
{
    for (new 
0sizeof g_modelsi++)
        
precache_model(g_models[i])    
}

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_Touch"fwd_Touch")
    
    
register_event("HLTV""round_start""a""1=0""2=0")
    
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
    
register_dictionary("bonus_box.txt")
}

public 
fwd_Touch(touchertouched)
{
    if (!
is_user_alive(toucher) || !pev_valid(touched))
        return 
FMRES_IGNORED
    
    
new classname[32]    
    
pev(touchedpev_classnameclassname31)
    if (!
equal(classnameitem_class_name))
        return 
FMRES_IGNORED
    
    
    
    give_item
(toucher)
    
set_pev(touchedpev_effectsEF_NODRAW)
    
set_pev(touchedpev_solidSOLID_NOT)
    
    return 
FMRES_IGNORED
    
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    if (!
is_user_connected(attacker) || !is_user_connected(victim) || attacker == victim || !attacker)
        return 
HAM_IGNORED
    
    
    
new random random_num(08)
    
    if (
random == || random == || random == 6)
    {
        new 
origin[3]
        
get_user_origin(victimorigin0)
        
        
addItem(origin)
    }
    
    return 
HAM_IGNORED
}

public 
removeEntity(ent)
{
    if (
pev_valid(ent))
        
engfunc(EngFunc_RemoveEntityent)
}

public 
addItem(origin[3])
{
    new 
ent fm_create_entity("info_target")
    
set_pev(entpev_classnameitem_class_name)
    
    
engfunc(EngFunc_SetModel,entg_models[random_num(0sizeof g_models 1)])

    
set_pev(ent,pev_mins,Float:{-10.0,-10.0,0.0})
    
set_pev(ent,pev_maxs,Float:{10.0,10.0,25.0})
    
set_pev(ent,pev_size,Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
    
engfunc(EngFunc_SetSize,ent,Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})

    
set_pev(ent,pev_solid,SOLID_BBOX)
    
set_pev(ent,pev_movetype,MOVETYPE_FLY)
    
    new 
Float:fOrigin[3]
    
IVecFVec(originfOrigin)
    
set_pev(entpev_originfOrigin)
    
    
set_pev(ent,pev_renderfx,kRenderFxGlowShell)
    switch(
random_num(1,4))
    {
        case 
1set_pev(ent,pev_rendercolor,Float:{0.0,0.0,255.0})
        case 
2set_pev(ent,pev_rendercolor,Float:{0.0,255.0,0.0})
        case 
3set_pev(ent,pev_rendercolor,Float:{255.0,0.0,0.0})
        case 
4set_pev(ent,pev_rendercolor,Float:{255.0,255.0,255.0})
    }
}

public 
give_item(id)
{
    new 
zombie 
    zombie 
zp_get_user_zombie(id)
    
    new 
random_num(0, (zombie 13))
    switch (
i)
    {
        case 
0:
        {
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + random_num(15))
            
ChatColor(id"!g[ZP]!y %L"LANG_PLAYER"ITEM_DM_AMMOPACKS_UP")
        }
    }
}

public 
round_start()
{
    new 
ent FM_NULLENT
    
static string_class[] = "classname"
    
while ((ent engfunc(EngFunc_FindEntityByStringentstring_classitem_class_name))) 
        
set_pev(entpev_flagsFL_KILLME)
}

// Stock: ChatColor!
stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!team""^3"// Team Color
    
replace_all(msg190"!team2""^0"// Team2 Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

__________________
Facebook
My YouTube
Ro{Y}aL WarLanD CommuniTy
Selling Zombie CSO 4.3 Money System Mod
DON KHAN 1 is offline
Dan1094x
New Member
Join Date: Sep 2019
Old 09-09-2019 , 18:00   Re: Help with bonus box for zp
Reply With Quote #3

Thank you if it served me but how do I do that whenever the box comes out I love it, that is, when I grab a box, sometimes it gives me the ammo packs and sometimes not as I do to make 100% of boxes that come out contain ammo packs and if possible change the number of probability that the box comes out thanks
Dan1094x 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 13:07.


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