Raised This Month: $535 Target: $400
 133% 

Bug Report Zombie Plague Lasermine/Kit Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RBE sLayeR
Member
Join Date: Jul 2019
Location: Republic of Kosovo
Old 06-02-2020 , 09:53   Zombie Plague Lasermine/Kit Damage
Reply With Quote #1

How to fix a bug where if you buy 3 lasermines and Damage Kit (https://forums.alliedmods.net/showthread.php?t=99113) then if you try to buy Damage kit again players gets +50 ammo packs
__________________
Copy-and-Paste was programmed by programmers for programmers actually
RBE sLayeR is offline
RBE sLayeR
Member
Join Date: Jul 2019
Location: Republic of Kosovo
Old 06-05-2020 , 17:07   Re: Zombie Plague Lasermine/Kit Damage
Reply With Quote #2

Bump ... Anyone knows the solution ??
__________________
Copy-and-Paste was programmed by programmers for programmers actually
RBE sLayeR is offline
RBE sLayeR
Member
Join Date: Jul 2019
Location: Republic of Kosovo
Old 06-07-2020 , 09:10   Re: Zombie Plague Lasermine/Kit Damage
Reply With Quote #3

Found solution ... So the problem was in Kit_damage plugin
Credits : Thanks to Sannchezz#3407 in Discord for helping with that problem

Here is the fixed Kit_damage.sma
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <engine>
#include <zombieplague>
#include <fun>
#include <fakemeta_util>

new cvar_knife_dmgcvar_m3_dmg
new cvar_deagle_dmgg_itemidcvar_healthcvar_armor
new cvar_redcvar_greencvar_blue

new bool:g_bHasKitDamage[33], g_maxplayersg_msgSayText

new const v_m3_model[] = "models/v_m3_released.mdl"
new const p_m3_model[] = "models/p_m3_released.mdl"

public plugin_init() 
{
    
register_plugin("Damage Kit" "1.3b""lucas_7_94")
    
register_cvar ("zp_extra_damage""1.3b"FCVAR_SERVER)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_event("CurWeapon""event_CurWeapon""be""1=1")
    
g_itemid zp_register_extra_item("Kit De Damage"50ZP_TEAM_HUMAN)
    
cvar_m3_dmg register_cvar ("zp_m3_damage""6.0")
    
cvar_knife_dmg register_cvar ("zp_knife_damage""4.0")
    
cvar_deagle_dmg register_cvar ("zp_deagle_damage""6.0")
    
cvar_health register_cvar ("zp_kit_health""400")
    
cvar_armor register_cvar ("zp_kit_armor""500")
    
cvar_red register_cvar ("zp_kit_glow_R""000")
    
cvar_green register_cvar ("zp_kit_glow_G""255")
    
cvar_blue register_cvar ("zp_kit_glow_B""255")
    
g_maxplayers get_maxplayers()
    
g_msgSayText get_user_msgid("SayText")
}

public 
plugin_precache()
{
    
precache_model(v_m3_model)
    
precache_model(p_m3_model)
}

public 
event_round_start() 
{
    for(new 
id 1id <= g_maxplayersid++) 
        
g_bHasKitDamage[id] = false     
}

public 
zp_user_infected_post(infectedinfector)
{
    if (
g_bHasKitDamage[infected])
    {
        
g_bHasKitDamage[infected] = false
    
}
}

public 
fw_player_killed(victimattackershouldgib)
{
    if(
g_bHasKitDamage[victim])
    {
        
KitDamage(victim"^x04[Kit Damage] You do not have the kit Damage!")
        
g_bHasKitDamage[victim] = false
    
}
}

public 
zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_itemid)
    {
        if(
g_bHasKitDamage[player])
        {
            
KitDamage(player"^x04[Zombie Plague] You already have the Damage Kit")
            
//zp_set_user_ammo_packs(player, zp_get_user_ammo_packs(player) + 50)
            
            
return;
        }
        else
        {
            
g_bHasKitDamage[player] = true
            fm_set_user_health
(playerget_user_health(player) + get_pcvar_num(cvar_health));
            
fm_set_user_armor(playerget_user_armor(player) + get_pcvar_num(cvar_armor));
            
fm_set_rendering(playerkRenderFxGlowShell, (cvar_red), (cvar_green), (cvar_blue), kRenderNormal16);
            
fm_strip_user_weapons(player)
            
give_item(player"weapon_knife")
            
give_item(player"weapon_deagle")
            
give_item(player"weapon_m3")
            
KitDamage(player"^x04[Zombie Plague] You purchased a kit Damage!!")
        }
    }
}

public 
event_CurWeapon(id)
{
    new 
weapid read_data(2)
    
    if(!
is_user_alive(id))
        return;
    
    if(
g_bHasKitDamage[id] && weapid == CSW_M3)
    {
        
entity_set_string(idEV_SZ_viewmodelv_m3_model)  
        
entity_set_string(idEV_SZ_weaponmodelp_m3_model)    
    }
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if(!(
<= attacker <= g_maxplayers))
        return 
HAM_IGNORED;
    
    if(
get_user_weapon(attacker) != CSW_M3)
        if(
get_user_weapon(attacker) != CSW_DEAGLE)
        if(
get_user_weapon(attacker) != CSW_KNIFE)
        return 
HAM_IGNORED;
    
    if (
get_user_weapon(attacker) && g_bHasKitDamage[attacker])
    {
        
SetHamParamFloat(4damage get_pcvar_float(cvar_m3_dmg))
        
SetHamParamFloat(4damage get_pcvar_float(cvar_deagle_dmg))
        
SetHamParamFloat(4damage get_pcvar_float(cvar_knife_dmg))
    }
    
    return 
HAM_IGNORED;
}  

KitDamage(target, const message[], any:...)
{
static 
buffer[512], iargscount
argscount 
numargs()

// Send to everyone
if (!target)
{
    static 
player
    
for (player 1player <= g_maxplayersplayer++)
    {
        
// Not connected
        
if (!is_user_connected(player))
            continue;
            
            static 
changed[5], changedcount;
            
changedcount 0
            
            
for (2argscounti++)
            {
                if (
getarg(i) == LANG_PLAYER)
                {
                    
setarg(i0player)
                    
changed[changedcount] = i
                    changedcount
++
                }
            }
            
            
vformat(buffersizeof buffer 1message3)
            
            
message_begin(MSG_ONEg_msgSayText_player)
            
write_byte(player)
            
write_string(buffer)
            
message_end()
            
            for (
0changedcounti++)
                
setarg(changed[i], 0LANG_PLAYER)
        }
    }
    else
    {
        
        
// Format message for player
        
vformat(buffersizeof buffer 1message3)
        
        
// Send it
        
message_begin(MSG_ONEg_msgSayText_target)
        
write_byte(target)
        
write_string(buffer)
        
message_end()
    }

__________________
Copy-and-Paste was programmed by programmers for programmers actually
RBE sLayeR 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 11:06.


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