AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help with my Zombie Class (https://forums.alliedmods.net/showthread.php?t=173683)

Lowfyr 12-09-2011 06:00

Need help with my Zombie Class
 
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! :D

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"
             }



H.RED.ZONE 12-09-2011 10:04

Re: Need help with my Zombie Class
 
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!

Torge 12-09-2011 10:36

Re: Need help with my Zombie Class
 
It work. But how i can fix that only display for cold zm?

H.RED.ZONE 12-09-2011 11:35

Re: Need help with my Zombie Class
 
Quote:

Originally Posted by Torge (Post 1610271)
It work. But how i can fix that only display for cold zm?

How do you mean display little more info :3

Lowfyr 12-09-2011 12:28

Re: Need help with my Zombie Class
 
I mean, how can i do that the message "[ZP] You have gained extra 400 hp!" only printed for the cold zombie?

JoKeR LauGh 12-09-2011 12:37

Re: Need help with my Zombie Class
 
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!")     } }

echo_cs 12-09-2011 12:53

Re: Need help with my Zombie Class
 
Develope the plugin because he has errors

echo_cs 12-09-2011 12:54

Re: Need help with my Zombie Class
 
I'm Going To help you wait...

echo_cs 12-09-2011 12:58

Re: Need help with my Zombie Class
 
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

echo_cs 12-09-2011 13:02

Re: Need help with my Zombie Class
 
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"
             }




All times are GMT -4. The time now is 12:09.

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