AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Zombie Plague Mod (https://forums.alliedmods.net/forumdisplay.php?f=126)
-   -   [ZP]Extra Items: Damage bullets (https://forums.alliedmods.net/showthread.php?t=89022)

Pach 04-01-2009 02:48

[ZP]Extra Items: Damage bullets
 
Where a mistake?:?: Help please!
Code:

#include <amxmodx>
#include <hamsandwich>
#include <zombieplague>

new bool:g_bHasDamage[33]
new g_iItem

public plugin_init()
{
        g_iItem = zp_register_extra_item("Damage bullets", 20, ZP_TEAM_HUMAN)
       
        RegisterHam(Ham_Spawn, "player", "Fwd_PlayerSpawn_Post", 1)
        RegisterHam(Ham_TakeDamage, "player", "Fwd_TakeDamage_Pre", 0)
}

public zp_extra_item_selected(id, item)
        if (item == g_iItem)
                g_bHasDamage[id] = true

public Fwd_PlayerSpawn_Post(id)
        if (g_bHasDamage[id])
                g_bHasDamage[id] = false
               
public Fwd_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits)
{
        if (!is_user_connected(attacker))
                return HAM_IGNORED
               
        if (g_bHasDamage[attacker])
        {
                SetHamParamFloat(4, (damage*2.0))
                return HAM_SUPERCEDE
        }
        return HAM_IGNORED
}


Anggara_nothing 04-01-2009 03:19

Re: [ZP]Extra Items: Damage bullets
 
change like bellow :
PHP Code:

public zp_extra_item_selected(iditem)
{
    if (
item == g_iItem)
        
g_bHasDamage[id] = true
}
public 
Fwd_PlayerSpawn_Post(id)
{
    if (
g_bHasDamage[id])
        
g_bHasDamage[id] = false



4eRT 04-01-2009 09:54

Re: [ZP]Extra Items: Damage bullets
 
Is there any diff? Is this not the same thing?

alan_el_more 04-01-2009 10:12

Re: [ZP]Extra Items: Damage bullets
 
is the same :|

Pach 04-01-2009 10:33

Re: [ZP]Extra Items: Damage bullets
 
Quote:

Originally Posted by Anggara_nothing (Post 794580)
change like bellow :
PHP Code:

public zp_extra_item_selected(iditem)
{
    if (
item == g_iItem)
        
g_bHasDamage[id] = true
}
public 
Fwd_PlayerSpawn_Post(id)
{
    if (
g_bHasDamage[id])
        
g_bHasDamage[id] = false



When released into the zombies get ammo packs x2, but the health of the zombie does not decrease :( What could be problem? :|


All times are GMT -4. The time now is 16:53.

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