Raised This Month: $ Target: $400
 0% 

Need help with my Zombie Class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lowfyr
Junior Member
Join Date: Jul 2011
Old 12-09-2011 , 06:00   Need help with my Zombie Class
Reply With Quote #1

Hello,

I created a cold zombie class and this class gets hp when he unfrozen
But there is one problem, if i choose raptor zombie and i gets frozen then there it say "[ZP] You have gained extra 400 hp!" how can i only set this for cold zombie? Thanks!

Here is my code:
PHP Code:
#include <amxmodx> 
#include <fun>
#include <zombieplague>

new hpamount

// Cold Zombie Attributes
new const zclass_name[] = { "Cold Zombie" // name
new const zclass_info[] = { "Gains hp when frozen" // description
new const zclass_model[] = { "zombie_human" // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" // claw model
const zclass_health 1500 // health
const zclass_speed 210 // speed
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 1.0 // knockback  

public zp_user_unfrozen(id)
{
        
set_user_health(id,get_user_health(id)+get_pcvar_num(hpamount));
        
client_print(idprint_chat"[ZP] You have gained extra 400 hp!")
}

// Class IDs
new g_zclass_czombie 

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
 
register_plugin("[ZP] Cold Zombie""1.0""Lowfyr"
 
hpamount register_cvar("zp_hpamount""400"
 
 
// Register the new class and store ID for reference
 
g_zclass_czombie zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback
}  

public 
zp_user_infected_post idinfector )
{
              if (
zp_get_user_zombie_class(id) == g_zclass_czombie)
             {
                  
client_print(idprint_chat"[ZP] You're using a cold zombie class! You will gain extra hp when frozen"
             }


Last edited by Lowfyr; 12-09-2011 at 06:02.
Lowfyr is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 12-09-2011 , 10:04   Re: Need help with my Zombie Class
Reply With Quote #2

Code:
public zp_user_unfrozen(id)
{
        set_user_health(id,get_user_health(id)+get_pcvar_num(hpamount));
        client_print(id, print_chat, "[ZP] You have gained extra 400 hp!")
}
Change [ZP] You have gained extra 400 hp!
__________________
H.RED.ZONE is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 12-09-2011 , 10:36   Re: Need help with my Zombie Class
Reply With Quote #3

It work. But how i can fix that only display for cold zm?
Torge is offline
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 12-09-2011 , 11:35   Re: Need help with my Zombie Class
Reply With Quote #4

Quote:
Originally Posted by Torge View Post
It work. But how i can fix that only display for cold zm?
How do you mean display little more info
__________________
H.RED.ZONE is offline
Lowfyr
Junior Member
Join Date: Jul 2011
Old 12-09-2011 , 12:28   Re: Need help with my Zombie Class
Reply With Quote #5

I mean, how can i do that the message "[ZP] You have gained extra 400 hp!" only printed for the cold zombie?
Lowfyr is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-09-2011 , 12:37   Re: Need help with my Zombie Class
Reply With Quote #6

Code:
public zp_user_unfrozen(id) {     if ( zp_get_user_zombie(id) == g_zclass_czombie )     {         set_user_health(id,get_user_health(id)+get_pcvar_num(hpamount));         client_print(id, print_chat, "[ZP] You have gained extra 400 hp!")     } }
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
echo_cs
Senior Member
Join Date: Dec 2011
Old 12-09-2011 , 12:53   Re: Need help with my Zombie Class
Reply With Quote #7

Develope the plugin because he has errors
__________________
Pawn (5%)

C (80%)

C++ (20%)

SQL (5%)

Last edited by echo_cs; 12-09-2011 at 13:03.
echo_cs is offline
echo_cs
Senior Member
Join Date: Dec 2011
Old 12-09-2011 , 12:54   Re: Need help with my Zombie Class
Reply With Quote #8

I'm Going To help you wait...
__________________
Pawn (5%)

C (80%)

C++ (20%)

SQL (5%)
echo_cs is offline
echo_cs
Senior Member
Join Date: Dec 2011
Old 12-09-2011 , 12:58   Re: Need help with my Zombie Class
Reply With Quote #9

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

new hpamount

new const zclass_name[] = "Cold Zombie" // name
new const zclass_info[] = "Gains hp when frozen" // description
new const zclass_model[] = "zombie_source" // model
new const zclass_clawmodel[] = "v_knife_zombie.mdl" // claw model
const zclass_health 1500 
const zclass_speed 210 
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 1.0 // knockback 
First I correct your's mistakes
don't write {} between Value
__________________
Pawn (5%)

C (80%)

C++ (20%)

SQL (5%)

Last edited by echo_cs; 12-09-2011 at 13:09.
echo_cs is offline
echo_cs
Senior Member
Join Date: Dec 2011
Old 12-09-2011 , 13:02   Re: Need help with my Zombie Class
Reply With Quote #10

Now the plugin is ready

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

new hpamount

new const zclass_name[] = "Cold Zombie" // name
new const zclass_info[] = "Gains hp when frozen" // description
new const zclass_model[] = "zombie_source" // model
new const zclass_clawmodel[] = "v_knife_zombie.mdl" // claw model
const zclass_health 1500 
const zclass_speed 210 
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 1.0 // knockback  

public zp_user_unfrozen(id)
{
        
set_user_health(id,get_user_health(id)+get_pcvar_num(hpamount));
        
client_print(idprint_chat"[ZP] You have gained extra 400 hp!")
}

// Class IDs
new g_zclass_czombie 

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
 
register_plugin("[ZP] Cold Zombie""1.0""echo_cs"
 
hpamount register_cvar("zp_hpamount""400"
 
 
// Register the new class and store ID for reference
 
g_zclass_czombie zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback
}  

public 
zp_user_infected_post idinfector )
{
              if (
zp_get_user_zombie_class(id) == g_zclass_czombie)
             {
                  
client_print(idprint_chat"[ZP] You're using a cold zombie class! You will gain extra hp when frozen"
             }

__________________
Pawn (5%)

C (80%)

C++ (20%)

SQL (5%)

Last edited by echo_cs; 12-09-2011 at 13:09.
echo_cs 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 12:09.


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