Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP 5.0.7] Hazmat class+ extra: flame bullets


Post New Thread Reply   
 
Thread Tools Display Modes
styler
Senior Member
Join Date: Oct 2011
Location: Oslo, Norway
Old 11-23-2011 , 03:51   Re: [ZP 5.0.7] Hazmat class+ extra: flame bullets
Reply With Quote #31

Quote:
Originally Posted by H.RED.ZONE View Post
Do you localy compile plugin and do you have the latest version?
Yes & yes.


@Snaker

How can i change the price of bullets?

EDIT: Never mind, the extraitems.ini in 5.0.7 isnt retarded like in 4.0.3

Last edited by styler; 11-23-2011 at 04:00.
styler is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 11-23-2011 , 05:36   Re: [ZP 5.0.7] Hazmat class+ extra: flame bullets
Reply With Quote #32

So you known now?
__________________
Snaker beatter is offline
styler
Senior Member
Join Date: Oct 2011
Location: Oslo, Norway
Old 11-23-2011 , 05:40   Re: [ZP 5.0.7] Hazmat class+ extra: flame bullets
Reply With Quote #33

Yeah i can fix the price without compiling but i still get compile errors.. i hope someone can help me find out what the problem is sometime :/

Anyways.. Great plugin!
styler is offline
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 02-14-2012 , 17:57   Re: [ZP 5.0.7] Hazmat class+ extra: flame bullets
Reply With Quote #34

i got this error in zp 5.0 stable
Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Number of arguments does not match definition on line 186
Error: Number of arguments does not match definition on line 247

2 Errors.
Could not locate output file C:\Documents and Settings\Administrator\My Documents\zp50_l4d2_hazmat_fire_wep.amx (compile failed).
line 186
Quote:
zp_grenade_fire_set(id, 0)
line 247
Quote:
zp_grenade_fire_set(id, 1)

Last edited by naSTR; 02-14-2012 at 17:58.
naSTR is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 02-15-2012 , 03:43   Re: [ZP 5.0.7] Hazmat class+ extra: flame bullets
Reply With Quote #35

1. Did you modify

2. cAn you post your hazmat class sma please
__________________
Snaker beatter is offline
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 02-15-2012 , 06:42   Re: [ZP 5.0.7] Hazmat class+ extra: flame bullets
Reply With Quote #36

Quote:
Originally Posted by Snaker beatter View Post
1. Did you modify

2. cAn you post your hazmat class sma please
no i did'nt modify it heres the sma
PHP Code:
#include <amxmodx>
#include <xs>
#include <fun>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <zp50_grenade_fire>

//define DEBUG        // Error log problem

#define PLUGIN    "[ZP] ZM: Hazmat Zombie & HM: Fire Weapon  [L4D2]"
#define VERSION    "1.1"
#define AUTHOR    "HsK"

#define FLA_ZP_NNE        // Support ZP Incendiary (On top plus / / or removal of the technical assistance incendiary ZP)

#define FLAME_DURATION args[0]
#define FLAME_ATTACKER args[1]

const OFFSET_LINUX_WEAPONS // weapon offsets are only 4 steps higher on Linux
const OFFSET_iWeapId 43
const OFFSET_iClipAmmo 51

new const WEAPON_CLASSNAME[][] = { """weapon_p228""""weapon_scout""""weapon_xm1014""""weapon_mac10",
    
"weapon_aug""""weapon_elite""weapon_fiveseven""weapon_ump45""weapon_sg550""weapon_galil""weapon_famas",
    
"weapon_usp""weapon_glock18""weapon_awp""weapon_mp5navy""weapon_m249""weapon_m3""weapon_m4a1",
    
"weapon_tmp""weapon_g3sg1""""weapon_deagle""weapon_sg552""weapon_ak47""weapon_knife""weapon_p90" }

// Zombie
new const zclass_name[] = { "L4D2_Hazmat" }
new const 
zclass_info[] = { "Not afraid of fire" }
new const 
zclass_model[] = { "winkler_himik" }
new const 
zclass_clawmodel[] = { "v_HimikHandsNew.mdl" }
const 
zclass_health 5000
const zclass_speed 280
const Float:zclass_gravity 0.8
const Float:zclass_knockback 0.1

new g_zclass_hazmat

//------------------------------------------------------------------------------
// Hm item

new g_item_name[] = { "Flame bullets" //Props Name
new g_item_cost 1             //Buy "Flame bullets," How many bullets package

new g_itemid_fire_weapon
new g_fire_weapon[33] = 0
new cvar_fire_ammo_maxcvar_firl_ammo_buy
new cvar_firedurationcvar_firedamagecvar_fireslowdown

new g_flameSprg_smokeSprg_msgSync
new cvar_botquota
new bool:BotHasDebug false
#if defined DEBUG
    
new g_bot_buy[33]
#endif
    
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
//火焰子彈
    
cvar_fire_ammo_max register_cvar("zp_fire_ammo_max""90")        //Maximum flame bullets
    
cvar_firl_ammo_buy register_cvar("zp_fire_ammo_buy""30")        //Buy a fire bullets, Available fire bullets

    
cvar_fireduration register_cvar("zp_fire_fireduration""10")        // Burn time
    
cvar_firedamage register_cvar("zp_fire_damage""10")         // Burn injury [every 0.2 seconds]
    
cvar_fireslowdown register_cvar("zp_fire_slowdown""0.7")         // Slow burning speed (0.5 = rate by half) [0 - Close]

    
g_itemid_fire_weapon zp_register_extra_item(g_item_nameg_item_costZP_TEAM_HUMAN)

    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack")
    
register_forward(FM_PlayerPreThink"fw_PlayerPreThink")

    for (new 
0sizeof WEAPON_CLASSNAMEi++)
    {
        if (
strlen(WEAPON_CLASSNAME[i]) == 0)
            continue;
        
        
RegisterHam(Ham_Weapon_PrimaryAttackWEAPON_CLASSNAME[i], "fw_WeapPriAttack")
    }

    
g_msgSync CreateHudSyncObj()

    
cvar_botquota get_cvar_pointer("bot_quota")
}

public 
plugin_precache()
{
    
g_zclass_hazmat zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)

    
g_flameSpr precache_model("sprites/flame.spr")
    
g_smokeSpr precache_model("sprites/black_smoke3.spr")
}

public 
zp_user_infected_post(idinfector)
{
    if (
zp_get_user_zombie_class(id) == g_zclass_hazmat)
    {
        
client_print(idprint_chat"[ZP] you is L4D2_Hazmat..you not afraid of fire!")
    }
}

public 
zp_extra_item_selected(iditemid)
{
    if (
itemid == g_itemid_fire_weapon)
        
buy_ammo(id)
}

buy_ammo(id)
{
    new 
buy_packs
    
#if defined DEBUG
        
if (g_bot_buy[id])
            
buy_packs g_item_cost 2
        
else
            
buy_packs g_item_cost
    
#endif

    
if (g_fire_weapon[id] == get_pcvar_num(cvar_fire_ammo_max))
    {
        
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + buy_packs)
        
client_print(idprint_chat"[ZP] Flame bullets had full, do not buy!!")
        return
    }

    if (
get_pcvar_num(cvar_fire_ammo_max) > get_pcvar_num(cvar_firl_ammo_buy))
    {
        new 
ammo g_fire_weapon[id] + get_pcvar_num(cvar_firl_ammo_buy)

        if (
ammo get_pcvar_num(cvar_fire_ammo_max))
            
g_fire_weapon[id] = get_pcvar_num(cvar_fire_ammo_max)
        else
            
g_fire_weapon[id] = ammo

        client_print
(idprint_chat"[ZP] You bought a% d flame  bullet!!"get_pcvar_num(cvar_firl_ammo_buy))
    }
    else
    {
        
g_fire_weapon[id] = get_pcvar_num(cvar_fire_ammo_max)
        
client_print(idprint_chat"[ZP] Flame bullets have been added!!")
    }
    
#if defined DEBUG
    
if (g_bot_buy[id])
        
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) - buy_packs)
    
#endif
}

public 
fw_PlayerPreThink(id)
{
    if (!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
#if defined DEBUG
        
if (is_user_bot(id) && g_bot_buy[id])
        {
            if (
g_fire_weapon[id] < get_pcvar_num(cvar_firl_ammo_buy) / 2)
            {
                switch (
random_num(13))
                {
                    case 
1g_bot_buy[id] = false
                    
case 2..3:
                    {
                        new 
packs zp_get_user_ammo_packs(id)
                        if (
packs g_item_cost 2)
                        {
                            
g_bot_buy[id] = true
                            buy_ammo
(id)
                        }
                    }
                }
            }
        }
    
        if (!
is_user_bot(id))
        {
            if (
g_bot_buy[id])
                
g_bot_buy[id] = false
        
}
    
#endif
    #if defined FLA_ZP_NNE
        
if (zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == g_zclass_hazmat)
        {
            if (
zp_grenade_fire_get(id))
                
zp_grenade_fire_set(id0)
        }
    
#endif
    
return FMRES_IGNORED;
}

public 
fw_WeapPriAttack(weapon)
{
    if (!
pev_valid(weapon))
        return 
HAM_IGNORED;

    if (
fm_get_weaponid(weapon) == CSW_KNIFE)
        return 
HAM_IGNORED;

    static 
owner
    owner 
pev(weaponpev_owner)
    
    if (
fm_get_weapon_ammo(weapon) > && g_fire_weapon[owner] > 0)
    {
        
g_fire_weapon[owner] -= 1
        hud_firl_ammo
(owner)
    }

    return 
HAM_IGNORED;
}

public 
fw_TraceAttack(victimattackerFloat:damageFloat:direction[3], tracehandledamage_type)
{
    if (!
g_fire_weapon[attacker])
        return 
HAM_IGNORED;

    if ((
get_user_weapon(attacker) == CSW_KNIFE))
        return 
HAM_IGNORED;

    
// Non-player damage or self damage
    
if (victim == attacker || !is_user_connected(attacker))
        return 
HAM_IGNORED;

    
// Prevent friendly fire
    
if (zp_get_user_zombie(attacker) == zp_get_user_zombie(victim))
        return 
HAM_IGNORED;

    
// Victim isn't a normal zombie
    
if (!zp_get_user_zombie(victim))
        return 
HAM_IGNORED;

    if (!(
damage_type DMG_BULLET))
        return 
HAM_IGNORED;

    if ((
zp_get_user_zombie_class(victim) == g_zclass_hazmat))
        return 
FMRES_IGNORED;

    
vic_fire(victimattacker)

    return 
HAM_IGNORED;
}

vic_fire(idi)
{
    if (
zp_get_user_zombie(id))
    {
        
zp_grenade_fire_set(id1)
    }
        
    static 
params[2]
    
params[0] = get_pcvar_num(cvar_fireduration) * // duration
    
params[1] = i// attacker

    
set_task(0.2"burning_flame"idparamssizeof params)
}

public 
burning_flame(args[2], id)
{
    if (!
is_user_alive(id))
        return;

    static 
Float:originF[3]
    
pev(idpev_originoriginF)

    if ((
pev(idpev_flags) & FL_INWATER) || FLAME_DURATION 1)
    {
        
// Smoke sprite
        
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
        
write_byte(TE_SMOKE// TE id
        
engfunc(EngFunc_WriteCoordoriginF[0]) // x
        
engfunc(EngFunc_WriteCoordoriginF[1]) // y
        
engfunc(EngFunc_WriteCoordoriginF[2]-50.0// z
        
write_short(g_smokeSpr// sprite
        
write_byte(random_num(1520)) // scale
        
write_byte(random_num(1020)) // framerate
        
message_end()
        
        return;
    }

    if ((
pev(idpev_flags) & FL_ONGROUND) && get_pcvar_float(cvar_fireslowdown) > 0.0)
    {
        static 
Float:velocity[3]
        
pev(idpev_velocityvelocity)
        
xs_vec_mul_scalar(velocityget_pcvar_float(cvar_fireslowdown), velocity)
        
set_pev(idpev_velocityvelocity)
    }

    static 
health
    health 
pev(idpev_health)

    if (
health get_pcvar_float(cvar_firedamage))
        
fm_set_user_health(idhealth floatround(get_pcvar_float(cvar_firedamage)))
    else
        
ExecuteHamB(Ham_KilledidFLAME_ATTACKER0)

    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYoriginF0)
    
write_byte(TE_SPRITE// TE id
    
engfunc(EngFunc_WriteCoordoriginF[0]+random_float(-5.05.0)) // x
    
engfunc(EngFunc_WriteCoordoriginF[1]+random_float(-5.05.0)) // y
    
engfunc(EngFunc_WriteCoordoriginF[2]+random_float(-10.010.0)) // z
    
write_short(g_flameSpr// sprite
    
write_byte(random_num(510)) // scale
    
write_byte(200// brightness
    
message_end()
    
    
// Decrease burning duration counter
    
FLAME_DURATION -= 1

    
new Float:firl_time
    
if (0.2 get_pcvar_num(cvar_fireduration))
        
firl_time get_pcvar_num(cvar_fireduration) - 0.1
    
else
        
firl_time 0.2

    
// Keep sending flame messages
    
set_task(firl_time"burning_flame"idargssizeof args)
}


public 
hud_firl_ammo(id)
{
    
set_hudmessage(02002000.900.9006.00.80.00.0, -1)
    
ShowSyncHudMsg(idg_msgSync"Flame bullets ammunition:%d"g_fire_weapon[id])
}

public 
zp_round_started(gamemodeid
{
    
#if defined DEBUG
        
set_task (0.1"bot_buy")
    
#endif
}

#if defined DEBUG
    
public bot_buy()
    {
        for (new 
id 1id <= 32id++)
        {
            if (!
is_user_connected(id) && !is_user_bot(id) || !is_user_alive(id))
                continue;
    
            if (
zp_get_user_zombie(id) || zp_get_user_survivor(id))
                continue;
    
            if (
g_fire_weapon[id])
                continue;
            
                
g_bot_buy[id] = false
    
            
new packs zp_get_user_ammo_packs(id)
            if (
packs g_item_cost 2)
                
set_task(random_float(1.312.0), "bot_buy_anno"id)
        }
    }
    
    public 
bot_buy_ammo(id)
    {
        switch (
random_num(13))
        {
            case 
1g_bot_buy[id] = false
            
case 2g_bot_buy[id] = false
            
case 3
            {
                new 
packs zp_get_user_ammo_packs(id)
                if (
packs g_item_cost 2)
                {
                    
g_bot_buy[id] = true
                    buy_ammo
(id)
                }
            }
        }
    }
#endif
public client_putinserver(id)
{
    if (!
cvar_botquota || !is_user_bot(id) || BotHasDebug)
        return;
    
    new 
classname[32]
    
pev(idpev_classnameclassname31)
    
    if (!
equal(classname"player"))
        
set_task(0.1"_Debug"id)
}

public 
_Debug(id)
{
    
// Make sure it's a CZ bot and it's still connected
    
if (!get_pcvar_num(cvar_botquota) || !is_user_connected(id))
        return;
    
    
BotHasDebug true
    RegisterHamFromEntity
(Ham_TraceAttackid"fw_TraceAttack")
}

stock fm_set_user_health(idhealth)
    (
health 0) ? set_pev(idpev_healthfloat(health)) : dllfunc(DLLFunc_ClientKillid);

stock fm_get_weaponid(entity)
    return 
get_pdata_int(entityOFFSET_iWeapIdOFFSET_LINUX_WEAPONS);

stock fm_get_weapon_ammo(entity)
    return 
get_pdata_int(entityOFFSET_iClipAmmoOFFSET_LINUX_WEAPONS);
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
naSTR is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 02-16-2012 , 01:40   Re: [ZP 5.0.7] Hazmat class+ extra: flame bullets
Reply With Quote #37

This only works on zp 5.0, i known you use zp 4.3 fix 5a
__________________
Snaker beatter is offline
naSTR
Veteran Member
Join Date: Dec 2011
Location: Asia, Mongolia
Old 02-16-2012 , 14:33   Re: [ZP 5.0.7] Hazmat class+ extra: flame bullets
Reply With Quote #38

Quote:
Originally Posted by Snaker beatter View Post
This only works on zp 5.0, i known you use zp 4.3 fix 5a
yeah some reason i updated my server 4.3 to 5.0.8 but i got tons of runtime error. now back to 4.3fix5a.
oh and is there any safe bank? i really need bank. i know there are many banks but theyre not work correctly.

Last edited by naSTR; 02-16-2012 at 14:35.
naSTR is offline
Reply



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 10:45.


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