Raised This Month: $ Target: $400
 0% 

Error Log zp_incendiary_bullets


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
unscarred
Member
Join Date: Dec 2009
Location: cs 1.6
Old 03-17-2016 , 22:52   Error Log zp_incendiary_bullets
Reply With Quote #1

PHP Code:
/*=======================================================
    
    *******************
    -    Incendiary Bullets
    -    v1.0
    -    Kiske
    *******************
    
    [ZP] Item: Incendiary Bullets
    Copyright (C) 2012 by Kiske, Buenos Aires, Argentina
    
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
    
    In addition, as a special exception, the author gives permission to
    link the code of this program with the Half-Life Game Engine ("HL
    Engine") and Modified Game Libraries ("MODs") developed by Valve,
    L.L.C ("Valve"). You must obey the GNU General Public License in all
    respects for all of the code used other than the HL Engine and MODs
    from Valve. If you modify this file, you may extend this exception
    to your version of the file, but you are not obligated to do so. If
    you do not wish to do so, delete this exception statement from your
    version.
    
=======================================================*/


#include <amxmodx>
#include <fun>
#include <engine>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <zp50_core>
#include <zp50_class_nemesis>
#include <zp50_class_survivor>
#include <zp50_gamemodes>
#include <zp50_grenade_fire>
#include <zp50_items>

/*
    =================
    = Customization =
    =================
*/

#define ITEM_NAME "Incendiary Bullets"
#define ITEM_COST 20

/*    
    ===========================================================
    = Customizble part end here. Editing anything beyond here =
    = is not officially supported. Proceed at your own risk.. =
    ===========================================================
*/

#define flag_get(%1,%2)    (%1 & (1 << (%2 & 31)))
#define flag_set(%1,%2)    %1 |= (1 << (%2 & 31))
#define flag_unset(%1,%2) %1 &= ~(1 << (%2 & 31))

new g_IncendiaryBullets;

new 
g_ItemID;
new 
g_GameModeNemesisID;

new 
g_pCVAR_ItemEnable;
new 
g_pCVAR_InB_Accumulate;
new 
g_pCVAR_InB_ExtraDmgMult;
new 
g_pCVAR_InB_Nemesis;

public 
plugin_init()
{
    
register_plugin("[ZP] Item: Incendiary Bullets""v1.0""Kiske");
    
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled");
    
RegisterHam(Ham_TakeDamage"player""fw_PlayerTakeDamage");
    
    
g_pCVAR_ItemEnable register_cvar("zp_inb_enable""1");
    
g_pCVAR_InB_Accumulate register_cvar("zp_inb_accumulate""0");
    
g_pCVAR_InB_ExtraDmgMult register_cvar("zp_inb_extra_damage_mult""2");
    
g_pCVAR_InB_Nemesis register_cvar("zp_inb_nemesis""0");
    
    
g_ItemID zp_items_register(ITEM_NAMEITEM_COST);
}

public 
plugin_cfg()
{
    
g_GameModeNemesisID zp_gamemodes_get_id("Nemesis Mode");
}

public 
client_disconnect(id)
{
    
flag_unset(g_IncendiaryBulletsid);
}

public 
zp_fw_items_select_pre(iditemidignorecost)
{
    if(
itemid == g_ItemID)
    {
        if(!
get_pcvar_num(g_pCVAR_ItemEnable))
            return 
ZP_ITEM_DONT_SHOW;
        
        if(
zp_core_is_zombie(id) || zp_class_survivor_get(id) || zp_class_nemesis_get(id))
            return 
ZP_ITEM_DONT_SHOW;
        
        new 
iCurrentGameMode zp_gamemodes_get_current();
        
        if(!
get_pcvar_num(g_pCVAR_InB_Nemesis) && iCurrentGameMode == g_GameModeNemesisID)
            return 
ZP_ITEM_DONT_SHOW;
        
        if(
iCurrentGameMode == ZP_NO_GAME_MODE)
            return 
ZP_ITEM_NOT_AVAILABLE;
        
        if(
flag_get(g_IncendiaryBulletsid))
            return 
ZP_ITEM_NOT_AVAILABLE;
    }
    
    return 
ZP_ITEM_AVAILABLE;
}

public 
zp_fw_items_select_post(iditemidignorecost)
{
    if(
itemid != g_ItemID)
        return;
    
    
flag_set(g_IncendiaryBulletsid);
}

public 
fw_PlayerKilled(victimattackershouldgib)
{
    
flag_unset(g_IncendiaryBulletsvictim);
}

public 
fw_PlayerTakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if(
victim == attacker || !is_user_alive(attacker))
        return 
HAM_IGNORED;
    
    if(
flag_get(g_IncendiaryBulletsattacker) && get_user_weapon(attacker) != CSW_KNIFE)
    {
        if((
zp_grenade_fire_get(victim) && get_pcvar_num(g_pCVAR_InB_Accumulate)) || !zp_grenade_fire_get(victim))
        {
            
zp_grenade_fire_set(victim1);
        }
    
        if(
get_pcvar_float(g_pCVAR_InB_ExtraDmgMult) == 1.00)
            return 
HAM_IGNORED;
        
        
damage *= get_pcvar_float(g_pCVAR_InB_ExtraDmgMult);
        
        
SetHamParamFloat(4damage);
    }
    
    return 
HAM_IGNORED;
}

public 
zp_fw_core_spawn_post(id)
{
    
flag_unset(g_IncendiaryBulletsid);
}

public 
zp_fw_core_cure_post(idattacker)
{
    
flag_unset(g_IncendiaryBulletsid);

error logs
[AMXX] Run time error 10: native error (native "zp_grenade_fire_get")
[AMXX] [0] zp_incendiary_bullets.sma::fw_PlayerTakeDamag e (line 151)
[ZP] Invalid Player (9)
unscarred is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 03-18-2016 , 04:13   Re: Error Log zp_incendiary_bullets
Reply With Quote #2

Change is user alive to is user connected
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
unscarred
Member
Join Date: Dec 2009
Location: cs 1.6
Old 03-18-2016 , 17:30   Re: Error Log zp_incendiary_bullets
Reply With Quote #3

how ?
unscarred is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 03-18-2016 , 20:28   Re: Error Log zp_incendiary_bullets
Reply With Quote #4

Line 153
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
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 09:18.


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