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

[ZP] Extra Item: Zombie Force v.1.2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DjReactive
Member
Join Date: Sep 2010
Location: Russia
Old 09-24-2010 , 04:36   [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #1

Discription:
At the purchase of it Extra Item of zombies gets additional force, which increases his information such as speed, receipt of additional health, attack, gravity, and similarly you can give out him the long jump of uncomment 98 line

Cvars:
Quote:
zp_force_speed 300.0 // Speed of zombies (Def: 300.0)
zp_force_gravity 0.6 // gravity (1.0 is const / Def: 0.6)
zp_force_damage 2.0 // Multiple Zombie Damage (Def: 1.0)
zp_force_health 2000 // additional hp for zombie (Def: 2000)
zp_glow_on 1 // On or Off glow effect for zombies (Def: 1)
zp_aura_red 255 // the Red color at glow
zp_aura_green 100 // the Green color at glow
zp_aura_blue 0 // the Dark blue color at glow
Screens:


Credits:
Re.Act!ve - Plugin Released

Changelog:
Quote:
v. 1.0 - First Plugin Released

v. 1.1 - Small Bugs fixed (Aura remained post mortem and other small bugs)

v. 1.2 - Fixed Bug to Speed (No gives on speed)
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_zombie_force.sma - 1366 views - 4.1 KB)
File Type: amxx zp_extra_zombie_force.amxx (6.0 KB, 762 views)
File Type: zip zombie_force_and_sound.zip (26.7 KB, 1693 views)

Last edited by DjReactive; 09-24-2010 at 08:38.
DjReactive is offline
Send a message via ICQ to DjReactive
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 09-24-2010 , 05:35   Re: [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #2

Setting player's speed wont work since ZP overrides player's speed so you should remove the speed's option

And you should change this
Code:
fm_set_rendering(player, kRenderFxGlowShell, (get_cvar_num("zp_aura_red")), (get_cvar_num("zp_aura_green")),          (get_cvar_num("zp_aura_blue")), kRenderNormal, 12);
with this:
Code:
set_user_rendering(player, kRenderFxGlowShell, get_cvar_num("zp_aura_red"), get_cvar_num("zp_aura_green"), get_cvar_num("zp_aura_blue"), kRenderNormal, 12);
So you can remove the fakemeta_util include
And use pcvars instead of cvars since theey are faster and more effecient
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
GAARA54
Veteran Member
Join Date: Oct 2009
Location: Everywhere
Old 09-24-2010 , 05:41   Re: [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #3

PHP Code:
/*================================================================================
    
    -------------------------------------------
    -*- [ZP] Extra Item: Zombie Force v. 1.2 | by Re.Act!ve -*-
    -------------------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    At the choose of it Zombie Force you will become have advantages: 
    * Good speed
    * Hight Attack
    * Model
    * Health
    * Long Jump

    ~~~~~~~~~~~~~~~
    - Changelog -
    ~~~~~~~~~~~~~~~
    v. 1.0     - First Plugin Released
    v. 1.1 - Small Bugs fixed (Aura remained post mortem and other small bugs)
    v. 1.2 - Fixed Bug to Speed (No gives on speed)
================================================================================*/

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <fun>
#include <fakemeta_util>
#include <zombieplague>


#define PLUGIN "[ZP] Extra Item: Zombie Force"
#define VERSION "1.2"
#define AUTHOR "Re.Act!ve"
#pragma tabsize 0

new SayText
new g_new_health 
new g_new_speed g_force_gravity
new g_itemid_zforce
new g_extra_glow
new g_extra_damage
new g_has_force[33]

new const 
g_item_name[] = { "Zombie Force" }; // Item name
new const g_item_cost 15 // Item cost
new const sound_force[] = { "zombie_plague/buy_force.wav" // Sound


// Zombie Classes MUST be registered on plugin_precache

public plugin_precache()
{
    
engfunc(EngFunc_PrecacheSoundsound_force)
    
precache_sound(sound_force)
}

public 
plugin_init()
{
    
g_new_speed register_cvar("zp_force_speed""300.0")        // Speed on Zombie Force
    
g_extra_damage register_cvar("zp_force_damage""1.0")        // Multiple Damage for Zombies
    
g_force_gravity register_cvar("zp_force_gravity""0.6")        // Gravity Zombie Force
    
g_new_health register_cvar("zp_force_health""2000")         // Extra health to Force for Zombies
    
g_extra_glow register_cvar("zp_glow_on""1")
    
register_cvar("zp_aura_red""255")
    
register_cvar("zp_aura_green""100")
    
register_cvar("zp_aura_blue""0")
    
register_plugin(PLUGINVERSIONAUTHOR)
    
g_itemid_zforce zp_register_extra_item(g_item_nameg_item_costZP_TEAM_ZOMBIE)
    
    
register_dictionary("zp_extra_zombie_force.txt")
    
register_forward(FM_PlayerPreThink"fm_PlayerPreThink"// Replace speed?
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamaged")
    
SayText get_user_msgid("SayText")
    
}


public 
zp_extra_item_selected(playeritemid)
{
    if (
itemid == g_itemid_zforce && zp_get_user_zombie(player) && !zp_get_user_nemesisplayer ))
    {        
        
print_col_chatplayer"^4[ZP] ^1%L: ^3%L" LANG_PLAYER"AD_EF"LANG_PLAYER"ABILITY")        
        
engfunc(EngFunc_EmitSoundplayerCHAN_BODYsound_force1.0ATTN_NORM0PITCH_NORM)
        
// Health
        
set_user_health(playerget_user_health(player) + get_pcvar_num(g_new_health))
        
set_user_gravity(playerg_force_gravity)
        new 
name[32]
        
// Hud Message Buy Zombie Force
        
get_user_name(playername31)
        
set_hudmessage(255000.050.4510.05.01.01.0, -1)
        
show_hudmessage(0"%s Probed Zombie Force!!"name)
        
set_task(0.2"ForceAura"player__"b")
        
g_has_force[player] = true
        
// engfunc(EngFunc_SetClientMaxspeed, player, g_new_speed)
        
set_pev(playerpev_maxspeedget_pcvar_float(g_new_speed))

        
// Additional Item LongJump, open her to give longjump 
        // give_item(player, "item_longjump")
        
}
    else
    {
        
g_has_force[player] = false
    
}

return 
1

}


public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)

    if ( 
get_user_weapon(attacker) == CSW_KNIFE ) { 
    if (
g_has_force[attacker])
                    {
      
SetHamParamFloat(4damage g_extra_damage
                    }
     }
}  

public 
ForceAura(player)
{
if (!
is_user_alive(player) || !zp_get_user_zombie(player)) { 
            
g_has_force[player] = false
                            
}

        if (
g_has_force[player])
                        {
        if ( (
zp_get_user_zombie(player)) && (get_pcvar_num(g_extra_glow)) )
            {
            
fm_set_rendering(playerkRenderFxGlowShell,   (get_cvar_num("zp_aura_red")), (get_cvar_num("zp_aura_green")),               (get_cvar_num("zp_aura_blue")), kRenderNormal12);
            }
                        }
}

public 
fm_PlayerPreThink(player)
{
    if (
g_has_force[player])
        
set_pev(playerpev_maxspeedget_pcvar_float(g_new_speed))

        return 
FMRES_IGNORED
}

stock print_col_chat(const id, const input[], any:...) 

    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
    
replace_all(msg190"!g""^4"); // Green Color 
    
replace_all(msg190"!y""^1"); // Default Color (у©°  ж№«ој©) 
    
replace_all(msg190"!t""^3"); // Team Color 
    
if (idplayers[0] = id; else get_players(playerscount"ch"); 
    { 
        for ( new 
0counti++ ) 
        { 
            if ( 
is_user_connected(players[i]) ) 
            { 
                
message_begin(MSG_ONE_UNRELIABLESayText_players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

-= Added Colorchat =-
-= Added Multilangual =-
p.s. don't tested
Attached Files
File Type: amxx zp_extra_zombie_force.amxx (8.2 KB, 372 views)
File Type: sma Get Plugin or Get Source (zp_extra_zombie_force.sma - 551 views - 5.0 KB)
File Type: txt zp_extra_zombie_force.txt (224 Bytes, 438 views)
__________________

Last edited by GAARA54; 09-24-2010 at 06:00.
GAARA54 is offline
DjReactive
Member
Join Date: Sep 2010
Location: Russia
Old 09-24-2010 , 06:13   Re: [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #4

Thanks)!!
DjReactive is offline
Send a message via ICQ to DjReactive
albert123
Veteran Member
Join Date: Mar 2009
Location: VietNam, Hai Phong
Old 09-24-2010 , 07:27   Re: [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #5

Very like Zombie Maddness :-?. But it's good than madness :d. GJ !
__________________
albert123 is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 09-25-2010 , 00:55   Re: [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #6

It could be done super better.

Just some hints:
- I can do this plug-in without FM, Engine. It's so simple!

EDIT: Hehe. . Oh, please leave lines for some functions as it makes your plug-in more neat and I don't see the point of leaving so many blank spaces on fm_set_rendering.

EDIT2: @Abdul: It works for ZP. I tried it before with my simple custom zombie. But make sure you don't use anything related to making player frozen. E.g. Froze Galil(I think I got the name wrong :X) It changes back to default speed which makes plug-ins with speed doesn't work.

EDIT3: Ah, I'm done with it.
PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <zombieplague>

// Extra Item ID
new g_item_zforce

// PCVars
new pCvarAdditionalHealthpCvarGravitypCvarSpeedpCvarDmgMultiplierpCvarGlowRedpCvarGlowGreenpCvarGlowBlue

// Player Variables
new gHasZForce[33]

// Credits to joaquimandrade
new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

// Extra Item name, cost and sound
new const g_item_name[] = "Zombie Force" // Item name
new const g_item_cost 15 // Item cost
new const sound_force[] = "zombie_plague/buy_force.wav" // Sound

public plugin_init()
{
    
register_plugin("[ZP] Extra Item: Zombie Force""1.0""eXcalibur.007")
    
    
g_item_zforce zp_register_extra_item(g_item_nameg_item_costZP_TEAM_ZOMBIE)
    
    
pCvarAdditionalHealth register_cvar("zp_zforce_additional_health""2000")
    
pCvarGravity register_cvar("zp_zforce_gravity""0.6")
    
pCvarSpeed register_cvar("zp_zforce_speed""50.0")
    
pCvarDmgMultiplier register_cvar("zp_zforce_dmg_multi""1.2")
    
pCvarGlowRed register_cvar("zp_zforce_glow_red""255")
    
pCvarGlowGreen register_cvar("zp_zforce_glow_green""100")
    
pCvarGlowBlue register_cvar("zp_zforce_glow_blue""0")
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage_Pre")
    
RegisterHam(Ham_Player_ResetMaxSpeed"player""fw_Player_ResetMaxSpeed_Post"1)
    
RegisterHam(Ham_Killed"player""fw_Killed_Post"1)
}

public 
plugin_precache()
{
    
precache_sound(sound_force)
}

public 
zp_extra_item_selected(playeritemid)
{
    if(
itemid == g_item_zforce)
    {
        
gHasZForce[player] = true
        
        
// Set player's health, gravity, etc.
        
set_user_health(playerget_user_health(player) + get_pcvar_num(pCvarAdditionalHealth))
        
set_user_gravity(playerget_pcvar_float(pCvarGravity))
        
set_user_rendering(playerkRenderFxGlowShellget_pcvar_num(pCvarGlowRed), get_pcvar_num(pCvarGlowGreen), get_pcvar_num(pCvarGlowBlue), kRenderNormal25)
        
        
// Plays a sound
        
emit_sound(playerCHAN_BODYsound_force1.0ATTN_NORM0PITCH_NORM)
        
        static 
szName[32]
        
get_user_name(playerszNamecharsmax(szName))
        
        
set_hudmessage(255000.050.4510.05.01.01.0, -1)
        
show_hudmessage(0"%s has bought Zombie Force!!"szName)
        
    }
}

public 
fw_TakeDamage_Pre(victiminflictorattackerFloat:damagedamage_type)

    if(
get_user_weapon(attacker) == CSW_KNIFE && gHasZForce[attacker])
    {
        
SetHamParamFloat(4damage get_pcvar_num(pCvarDmgMultiplier))
    }
}

public 
fw_Player_ResetMaxSpeed_Post(player)
{
    if(!
is_user_connected(player) || !is_user_alive(player) || !gHasZForce[player])
        return
        
    static 
Float:iMaxSpeediMaxSpeed get_user_maxspeed(player)
    
    
// Not moving(Doesn't need to change since it's not moving)
    
if(iMaxSpeed != 1.0)
    {
        
set_user_maxspeed(playeriMaxSpeed get_pcvar_float(pCvarSpeed))
    }
}

public 
fw_Killed_Post(victimattacker)
{
    if(
gHasZForce[victim])
        
gHasZForce[victim] = false

No FM + No Engine.

Last edited by Excalibur.007; 09-25-2010 at 22:18.
Excalibur.007 is offline
DjReactive
Member
Join Date: Sep 2010
Location: Russia
Old 09-25-2010 , 05:24   Re: [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #7

Thank you for advices, but want to say that it my FIRST plagin, next time will endeavour as that to watch after that, to use less than includes
DjReactive is offline
Send a message via ICQ to DjReactive
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 09-25-2010 , 06:08   Re: [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #8

It should be more efficient modules instead of lesser includes.
Excalibur.007 is offline
manafi
Senior Member
Join Date: Jun 2009
Old 09-25-2010 , 20:18   Re: [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #9

Excalibur.007 your plugin version have error

L 09/26/2010 - 04:061: Start of error session.
L 09/26/2010 - 04:061: Info (map "zm_ice_attack") (file "addons/amxmodx/logs/error_20100926.log")
L 09/26/2010 - 04:061: [HAMSANDWICH] Function fw_TakeDamage_Pre not found.
L 09/26/2010 - 04:061: [AMXX] Run time error 10 (plugin "zp_extra_zombie_force.amxx") (native "RegisterHam") - debug not enabled!
L 09/26/2010 - 04:061: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

DjReactive
your plugin have compile error
zp_extra_zombie_force.sma<86> :Warning 213 : tag mismatch
manafi is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 09-25-2010 , 22:18   Re: [ZP] Extra Item: Zombie Force v.1.2
Reply With Quote #10

PHP Code:
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#include <zombieplague>

// Extra Item ID
new g_item_zforce

// PCVars
new pCvarAdditionalHealthpCvarGravitypCvarSpeedpCvarDmgMultiplierpCvarGlowRedpCvarGlowGreenpCvarGlowBlue

// Player Variables
new gHasZForce[33]

// Credits to joaquimandrade
new Ham:Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

// Extra Item name, cost and sound
new const g_item_name[] = "Zombie Force" // Item name
new const g_item_cost 15 // Item cost
new const sound_force[] = "zombie_plague/buy_force.wav" // Sound

public plugin_init()
{
    
register_plugin("[ZP] Extra Item: Zombie Force""1.0""eXcalibur.007")
    
    
g_item_zforce zp_register_extra_item(g_item_nameg_item_costZP_TEAM_ZOMBIE)
    
    
pCvarAdditionalHealth register_cvar("zp_zforce_additional_health""2000")
    
pCvarGravity register_cvar("zp_zforce_gravity""0.6")
    
pCvarSpeed register_cvar("zp_zforce_speed""50.0")
    
pCvarDmgMultiplier register_cvar("zp_zforce_dmg_multi""1.2")
    
pCvarGlowRed register_cvar("zp_zforce_glow_red""255")
    
pCvarGlowGreen register_cvar("zp_zforce_glow_green""100")
    
pCvarGlowBlue register_cvar("zp_zforce_glow_blue""0")
    
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage_Pre")
    
RegisterHam(Ham_Player_ResetMaxSpeed"player""fw_Player_ResetMaxSpeed_Post"1)
    
RegisterHam(Ham_Killed"player""fw_Killed_Post"1)
}

public 
plugin_precache()
{
    
precache_sound(sound_force)
}

public 
zp_extra_item_selected(playeritemid)
{
    if(
itemid == g_item_zforce)
    {
        
gHasZForce[player] = true
        
        
// Set player's health, gravity, etc.
        
set_user_health(playerget_user_health(player) + get_pcvar_num(pCvarAdditionalHealth))
        
set_user_gravity(playerget_pcvar_float(pCvarGravity))
        
set_user_rendering(playerkRenderFxGlowShell,  get_pcvar_num(pCvarGlowRed), get_pcvar_num(pCvarGlowGreen),  get_pcvar_num(pCvarGlowBlue), kRenderNormal25)
        
        
// Plays a sound
        
emit_sound(playerCHAN_BODYsound_force1.0ATTN_NORM0PITCH_NORM)
        
        static 
szName[32]
        
get_user_name(playerszNamecharsmax(szName))
        
        
set_hudmessage(255000.050.4510.05.01.01.0, -1)
        
show_hudmessage(0"%s has bought Zombie Force!!"szName)
        
    }
}

public 
fw_TakeDamage_Pre(victiminflictorattackerFloat:damagedamage_type)

    if(
get_user_weapon(attacker) == CSW_KNIFE && gHasZForce[attacker])
    {
        
SetHamParamFloat(4damage get_pcvar_num(pCvarDmgMultiplier))
    }
}

public 
fw_Player_ResetMaxSpeed_Post(player)
{
    if(!
is_user_connected(player) || !is_user_alive(player) || !gHasZForce[player])
        return
        
    static 
Float:iMaxSpeediMaxSpeed get_user_maxspeed(player)
    
    
// Not moving(Doesn't need to change since it's not moving)
    
if(iMaxSpeed != 1.0)
    {
        
set_user_maxspeed(playeriMaxSpeed get_pcvar_float(pCvarSpeed))
    }
}

public 
fw_Killed_Post(victimattacker)
{
    if(
gHasZForce[victim])
        
gHasZForce[victim] = false

No FM + No Engine.

My bad. Forgotten to add a _Pre on the public function. This is the new code.

Last edited by Excalibur.007; 09-27-2010 at 04:09.
Excalibur.007 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 15:43.


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