Raised This Month: $12 Target: $400
 3% 

Help / Support [Solved] zp50_class_human_madness


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
New.ZM.Life
Veteran Member
Join Date: Sep 2014
Location: Iran
Old 11-13-2014 , 19:06   [Solved] zp50_class_human_madness
Reply With Quote #1

Hi all

i tried to make a human class which get zombie madness when infected!

but i failed (i compiled plugin successfully,but ability doesnt work )

can anyone modify it or remake it,or tell me what is the problem?
Attached Files
File Type: sma Get Plugin or Get Source (zp50_class_human_madness.sma - 595 views - 1.5 KB)
__________________
PLUGINS

Zombie Plague 5.0 + New Modes

Added NightCrawler Mode to ZP






Last edited by New.ZM.Life; 11-15-2014 at 14:41.
New.ZM.Life is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 11-13-2014 , 20:05   Re: [Req || Help] zp50_class_human_madness
Reply With Quote #2

Forward zp_fw_core_cure_post(id) infect forward is used for zombies.
__________________
H.RED.ZONE is offline
New.ZM.Life
Veteran Member
Join Date: Sep 2014
Location: Iran
Old 11-14-2014 , 04:06   Re: [Req || Help] zp50_class_human_madness
Reply With Quote #3

thank you bro,but nothing happened again....after infection,no zombie madness got!

PHP Code:
/*================================================================================
    
    ----------------------------------
    -*- [ZP] Class: Human: MadGuy -*-
    ----------------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include <amxmodx>
#include <zp50_class_human>
#include <zp50_class_assassin>
#include <zp50_class_nemesis>
#include <zp50_item_zombie_madness>


// Mad Guy Attributes
new const humanclass1_name[] = "Mad Guy"
new const humanclass1_info[] = "[Infected = Zombie Madness]"
new const humanclass1_models[][] = { "rangers1" }
const 
humanclass1_health 150
const Float:humanclass1_speed 1.0
const Float:humanclass1_gravity 1.0

new g_Human_mad

public plugin_precache()
{
    
register_plugin("[ZP] Class: Human: MadGuy"ZP_VERSION_STRING"ZP Dev Team")
    
    
g_Human_mad zp_class_human_register(humanclass1_namehumanclass1_infohumanclass1_healthhumanclass1_speedhumanclass1_gravity)
    new 
index
    
for (index 0index sizeof humanclass1_modelsindex++)
        
zp_class_human_register_model(g_Human_madhumanclass1_models[index])
}



public 
zp_fw_core_cure_post(id)
{
    
// Madness Zombie Set
    
if (zp_class_human_get_current(id) == g_Human_mad)
    {
        
                
// except nemesis and assassin
        
if (!zp_class_assassin_get(id) || !zp_class_nemesis_get(id))
            
zp_item_zombie_madness_get(id)
    }

__________________
PLUGINS

Zombie Plague 5.0 + New Modes

Added NightCrawler Mode to ZP





New.ZM.Life is offline
Old 11-14-2014, 05:52
zmd94
This message has been deleted by zmd94.
New.ZM.Life
Veteran Member
Join Date: Sep 2014
Location: Iran
Old 11-14-2014 , 14:00   Re: [Req || Help] zp50_class_human_madness
Reply With Quote #4

No one can help?!....


I really need this human class,
When Infected,get zombie madness
__________________
PLUGINS

Zombie Plague 5.0 + New Modes

Added NightCrawler Mode to ZP





New.ZM.Life is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 11-14-2014 , 14:31   Re: [Req || Help] zp50_class_human_madness
Reply With Quote #5

In this case use forward zp_fw_core_infect_post(id, attacker) and another thing this native zp_item_zombie_madness_get(id) get when zombie have zombie madness, i think zp50_item_zombie_madness.inc dont have the native to set zombie madness (mercylezz dont create the native to set the madness)..

Last edited by wicho; 11-14-2014 at 14:33.
wicho is offline
New.ZM.Life
Veteran Member
Join Date: Sep 2014
Location: Iran
Old 11-14-2014 , 14:44   Re: [Req || Help] zp50_class_human_madness
Reply With Quote #6

Quote:
Originally Posted by wicho View Post
In this case use forward zp_fw_core_infect_post(id, attacker) and another thing this native zp_item_zombie_madness_get(id) get when zombie have zombie madness, i think zp50_item_zombie_madness.inc dont have the native to set zombie madness (mercylezz dont create the native to set the madness)..


So,You mean its impossible to make this human class?!
__________________
PLUGINS

Zombie Plague 5.0 + New Modes

Added NightCrawler Mode to ZP





New.ZM.Life is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 11-14-2014 , 15:40   Re: [Req || Help] zp50_class_human_madness
Reply With Quote #7

All its possible just use your mind, u can see the sma of zombie madness and check how he set the glow, inmunity, sound, etc. or make a native to set..

ok i make a native to set madness but i dont tested, first replace this code of zp50_item_zombie_madness..

PHP Code:
/*================================================================================
    
    ---------------------------------
    -*- [ZP] Item: Zombie Madness -*-
    ---------------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#define ITEM_NAME "Zombie Madness"
#define ITEM_COST 15

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <amx_settings_api>
#include <cs_ham_bots_api>
#include <zp50_items>
#define LIBRARY_GRENADE_FROST "zp50_grenade_frost"
#include <zp50_grenade_frost>
#define LIBRARY_GRENADE_FIRE "zp50_grenade_fire"
#include <zp50_grenade_fire>
#define LIBRARY_NEMESIS "zp50_class_nemesis"
#include <zp50_class_nemesis>

// Settings file
new const ZP_SETTINGS_FILE[] = "zombieplague.ini"

// Default sounds
new const sound_zombie_madness[][] = { "zombie_plague/zombie_madness1.wav" }

#define SOUND_MAX_LENGTH 64

new Array:g_sound_zombie_madness

#define TASK_MADNESS 100
#define TASK_AURA 200
#define ID_MADNESS (taskid - TASK_MADNESS)
#define ID_AURA (taskid - TASK_AURA)

#define flag_get(%1,%2) (%1 & (1 << (%2 & 31)))
#define flag_get_boolean(%1,%2) (flag_get(%1,%2) ? true : false)
#define flag_set(%1,%2) %1 |= (1 << (%2 & 31))
#define flag_unset(%1,%2) %1 &= ~(1 << (%2 & 31))

new g_ItemID
new g_MadnessBlockDamage

new cvar_zombie_madness_time
new cvar_madness_aura_color_Rcvar_madness_aura_color_Gcvar_madness_aura_color_B

public plugin_init()
{
    
register_plugin("[ZP] Item: Zombie Madness"ZP_VERSION_STRING"ZP Dev Team")
    
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
RegisterHamBots(Ham_Spawn"fw_PlayerSpawn_Post"1)
    
RegisterHam(Ham_TraceAttack"player""fw_TraceAttack")
    
RegisterHamBots(Ham_TraceAttack"fw_TraceAttack")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
RegisterHamBots(Ham_TakeDamage"fw_TakeDamage")
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled_Post"1)
    
RegisterHamBots(Ham_Killed"fw_PlayerKilled_Post"1)
    
    
cvar_zombie_madness_time register_cvar("zp_zombie_madness_time""5.0")
    
cvar_madness_aura_color_R register_cvar("zp_madness_aura_color_R""150")
    
cvar_madness_aura_color_G register_cvar("zp_madness_aura_color_G""0")
    
cvar_madness_aura_color_B register_cvar("zp_madness_aura_color_B""0")
    
    
g_ItemID zp_items_register(ITEM_NAMEITEM_COST)
}

public 
plugin_precache()
{
    
// Initialize arrays
    
g_sound_zombie_madness ArrayCreate(SOUND_MAX_LENGTH1)
    
    
// Load from external file
    
amx_load_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ZOMBIE MADNESS"g_sound_zombie_madness)
    
    
// If we couldn't load custom sounds from file, use and save default ones
    
new index
    
if (ArraySize(g_sound_zombie_madness) == 0)
    {
        for (
index 0index sizeof sound_zombie_madnessindex++)
            
ArrayPushString(g_sound_zombie_madnesssound_zombie_madness[index])
        
        
// Save to external file
        
amx_save_setting_string_arr(ZP_SETTINGS_FILE"Sounds""ZOMBIE MADNESS"g_sound_zombie_madness)
    }
    
    
// Precache sounds
    
new sound[SOUND_MAX_LENGTH]
    for (
index 0index ArraySize(g_sound_zombie_madness); index++)
    {
        
ArrayGetString(g_sound_zombie_madnessindexsoundcharsmax(sound))
        
precache_sound(sound)
    }
}

public 
plugin_natives()
{
    
register_library("zp50_item_zombie_madness")
    
register_native("zp_item_zombie_madness_get""native_item_zombie_madness_get")
    
register_native("zp_item_zombie_madness_set""native_item_zombie_madness_set")
    
    
set_module_filter("module_filter")
    
set_native_filter("native_filter")
}
public 
module_filter(const module[])
{
    if (
equal(moduleLIBRARY_NEMESIS) || equal(moduleLIBRARY_GRENADE_FROST) || equal(moduleLIBRARY_GRENADE_FIRE))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}
public 
native_filter(const name[], indextrap)
{
    if (!
trap)
        return 
PLUGIN_HANDLED;
        
    return 
PLUGIN_CONTINUE;
}

public 
native_item_zombie_madness_get(plugin_idnum_params)
{
    new 
id get_param(1)
    
    if (!
is_user_alive(id))
    {
        
log_error(AMX_ERR_NATIVE"[ZP] Invalid Player (%d)"id)
        return 
false;
    }
    
    return 
flag_get_boolean(g_MadnessBlockDamageid);
}

public 
native_item_zombie_madness_set(plugin_idnum_params)
{
    new 
id get_param(1)
    
    if (!
is_user_alive(id))
    {
        
log_error(AMX_ERR_NATIVE"[ZP] Invalid Player (%d)"id)
        return 
false;
    }
    
    new 
set get_param(2)
    
    
// End madness
    
if (!set)
    {
        
// Not Madness
        
if (!task_exists(id+TASK_MADNESSid))
            return 
true;
        
        
// Not Aura
        
if (!task_exists(id+TASK_AURAid))
            return 
true;
        
        
// Remove madness and aura and stop the task
        
remove_task(id+TASK_MADNESS)
             
remove_task(id+TASK_AURA)
        return 
true;
    }
    
    return 
set_madness(id);
}

public 
zp_fw_items_select_pre(iditemidignorecost)
{
    
// This is not our item
    
if (itemid != g_ItemID)
        return 
ZP_ITEM_AVAILABLE;
    
    
// Zombie madness only available to zombies
    
if (!zp_core_is_zombie(id))
        return 
ZP_ITEM_DONT_SHOW;
    
    
// Zombie madness not available to Nemesis
    
if (LibraryExists(LIBRARY_NEMESISLibType_Library) && zp_class_nemesis_get(id))
        return 
ZP_ITEM_DONT_SHOW;
    
    
// Player already has madness
    
if (flag_get(g_MadnessBlockDamageid))
        return 
ZP_ITEM_NOT_AVAILABLE;
    
    return 
ZP_ITEM_AVAILABLE;
}

public 
zp_fw_items_select_post(iditemidignorecost)
{
    
// This is not our item
    
if (itemid != g_ItemID)
        return;
    
    
set_madness(id)
}

set_madness(victim)
{    
    
// Do not take damage
    
flag_set(g_MadnessBlockDamagevictim)
    
    
// Madness aura
    
set_task(0.1"madness_aura"victim+TASK_AURA__"b")
    
    
// Madness sound
    
new sound[SOUND_MAX_LENGTH]
    
ArrayGetString(g_sound_zombie_madnessrandom_num(0ArraySize(g_sound_zombie_madness) - 1), soundcharsmax(sound))
    
emit_sound(victimCHAN_VOICEsound1.0ATTN_NORM0PITCH_NORM)
    
    
// Set task to remove it
    
set_task(get_pcvar_float(cvar_zombie_madness_time), "remove_zombie_madness"victim+TASK_MADNESS)
    return 
true
}

// Ham Player Spawn Post Forward
public fw_PlayerSpawn_Post(id)
{
    
// Not alive or didn't join a team yet
    
if (!is_user_alive(id) || !cs_get_user_team(id))
        return;
    
    
// Remove zombie madness from a previous round
    
remove_task(id+TASK_MADNESS)
    
remove_task(id+TASK_AURA)
    
flag_unset(g_MadnessBlockDamageid)
}

// Ham Trace Attack Forward
public fw_TraceAttack(victimattacker)
{
    
// Non-player damage or self damage
    
if (victim == attacker || !is_user_alive(attacker))
        return 
HAM_IGNORED;
    
    
// Prevent attacks when victim has zombie madness
    
if (flag_get(g_MadnessBlockDamagevictim))
        return 
HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;
}

// Ham Take Damage Forward (needed to block explosion damage too)
public fw_TakeDamage(victiminflictorattacker)
{
    
// Non-player damage or self damage
    
if (victim == attacker || !is_user_alive(attacker))
        return 
HAM_IGNORED;
    
    
// Prevent attacks when victim has zombie madness
    
if (flag_get(g_MadnessBlockDamagevictim))
        return 
HAM_SUPERCEDE;
    
    return 
HAM_IGNORED;
}

public 
zp_fw_grenade_frost_pre(id)
{
    
// Prevent frost when victim has zombie madness
    
if (flag_get(g_MadnessBlockDamageid))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

public 
zp_fw_grenade_fire_pre(id)
{
    
// Prevent burning when victim has zombie madness
    
if (flag_get(g_MadnessBlockDamageid))
        return 
PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;
}

public 
zp_fw_core_cure(idattacker)
{
    
// Remove zombie madness task
    
remove_task(id+TASK_MADNESS)
    
remove_task(id+TASK_AURA)
    
flag_unset(g_MadnessBlockDamageid)
}

// Ham Player Killed Post Forward
public fw_PlayerKilled_Post(victimattackershouldgib)
{
    
// Remove zombie madness task
    
remove_task(victim+TASK_MADNESS)
    
remove_task(victim+TASK_AURA)
    
flag_unset(g_MadnessBlockDamagevictim)
}

// Remove Spawn Protection Task
public remove_zombie_madness(taskid)
{
    
// Remove aura
    
remove_task(ID_MADNESS+TASK_AURA)
    
    
// Remove zombie madness
    
flag_unset(g_MadnessBlockDamageID_MADNESS)
}

public 
client_disconnect(id)
{
    
// Remove tasks on disconnect
    
remove_task(id+TASK_MADNESS)
    
remove_task(id+TASK_AURA)
    
flag_unset(g_MadnessBlockDamageid)
}

// Madness aura task
public madness_aura(taskid)
{
    
// Get player's origin
    
static origin[3]
    
get_user_origin(ID_AURAorigin)
    
    
// Colored Aura
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
    
write_byte(TE_DLIGHT// TE id
    
write_coord(origin[0]) // x
    
write_coord(origin[1]) // y
    
write_coord(origin[2]) // z
    
write_byte(20// radius
    
write_byte(get_pcvar_num(cvar_madness_aura_color_R)) // r
    
write_byte(get_pcvar_num(cvar_madness_aura_color_G)) // g
    
write_byte(get_pcvar_num(cvar_madness_aura_color_B)) // b
    
write_byte(2// life
    
write_byte(0// decay rate
    
message_end()

then added this native to your zp50_item_zombie_madness.inc

PHP Code:
native zp_item_zombie_madness_set(id
finally test your class:

PHP Code:
/*================================================================================
    
    ----------------------------------
    -*- [ZP] Class: Human: MadGuy -*-
    ----------------------------------
    
    This plugin is part of Zombie Plague Mod and is distributed under the
    terms of the GNU General Public License. Check ZP_ReadMe.txt for details.
    
================================================================================*/

#include <amxmodx>
#include <zp50_class_human>
#include <zp50_class_assassin>
#include <zp50_class_nemesis>
#include <zp50_item_zombie_madness>


// Mad Guy Attributes
new const humanclass1_name[] = "Mad Guy"
new const humanclass1_info[] = "[Infected = Zombie Madness]"
new const humanclass1_models[][] = { "rangers1" }
const 
humanclass1_health 150
const Float:humanclass1_speed 1.0
const Float:humanclass1_gravity 1.0

new g_Human_mad

public plugin_precache()
{
    
register_plugin("[ZP] Class: Human: MadGuy"ZP_VERSION_STRING"ZP Dev Team")
    
    
g_Human_mad zp_class_human_register(humanclass1_namehumanclass1_infohumanclass1_healthhumanclass1_speedhumanclass1_gravity)
    new 
index
    
for (index 0index sizeof humanclass1_modelsindex++)
        
zp_class_human_register_model(g_Human_madhumanclass1_models[index])
}



public 
zp_fw_core_infect_post(idattacker)
{
    
// Madness Zombie Set
    
if (zp_class_human_get_current(id) == g_Human_mad)
    {
        
                
// except nemesis and assassin
        
if (!zp_class_assassin_get(id) || !zp_class_nemesis_get(id))
            
zp_item_zombie_madness_set(id)
    }

test it and tell me if work or not..

Last edited by wicho; 11-14-2014 at 16:57.
wicho is offline
New.ZM.Life
Veteran Member
Join Date: Sep 2014
Location: Iran
Old 11-15-2014 , 10:35   Re: [Req || Help] zp50_class_human_madness
Reply With Quote #8

bro,so tnx,it working well....
i will modified by my self for zp5.0.8(sniper & assassin) (it need some codes for assassin)

but just a little problem....

when i become assassin or nemesis,i will get zombie madness(if only my human class is madguy)

so,this lines need to change?

PHP Code:
// except nemesis and assassin
        
if (!zp_class_assassin_get(id) || !zp_class_nemesis_get(id))
            
zp_item_zombie_madness_set(id
--->


PHP Code:
// except nemesis and assassin
        
if (zp_class_assassin_get(id) || zp_class_nemesis_get(id))
                  return;
zp_item_zombie_madness_set(id
or else?
__________________
PLUGINS

Zombie Plague 5.0 + New Modes

Added NightCrawler Mode to ZP





New.ZM.Life is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 11-15-2014 , 12:56   Re: [Req || Help] zp50_class_human_madness
Reply With Quote #9

Try it..
wicho is offline
New.ZM.Life
Veteran Member
Join Date: Sep 2014
Location: Iran
Old 11-15-2014 , 14:40   Re: [Req || Help] zp50_class_human_madness
Reply With Quote #10

Quote:
Originally Posted by wicho View Post
Try it..

working fine
thank you ;)
__________________
PLUGINS

Zombie Plague 5.0 + New Modes

Added NightCrawler Mode to ZP





New.ZM.Life 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 17:09.


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