AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hp doesn't work like supost too (https://forums.alliedmods.net/showthread.php?t=121257)

DoviuX 03-13-2010 14:25

Hp doesn't work like supost too
 
I got a problem i made class on zs but i get random hp from Class1 hp to Class2.

PHP Code:

    PlayerClass[id] = random_num(03)
    {
            switch (
random_num(03))
            {
                    case 
0
                    {
                        
copy(player_model[id], charsmaxplayer_model[] ), ZOMBIE_MODEL1)
                        
set_pev(idpev_healthzombie_hp1)
                        
set_pev(idpev_gravityzombie_gravity1)
                    }
                    case 
1
                    {
                        
copy(player_model[id], charsmaxplayer_model[] ), ZOMBIE_MODEL2)
                        
set_pev(idpev_healthzombie_hp2)
                        
set_pev(idpev_gravityzombie_gravity2)
                    }
                    case 
2:
                    {
                        
copy(player_model[id], charsmaxplayer_model[] ), ZOMBIE_MODEL3)
                        
set_pev(idpev_healthzombie_hp3)
                        
set_pev(idpev_gravityzombie_gravity3)
                    }
                    case 
3:
                    {
                        
copy(player_model[id], charsmaxplayer_model[] ), ZOMBIE_MODEL4)
                        
set_pev(idpev_healthzombie_hp4)
                        
set_pev(idpev_gravityzombie_gravity4)
                    }
            }
    } 


Exolent[jNr] 03-13-2010 15:22

Re: Hp doesn't work like supost too
 
Show where zombie_hp1 zombie_hp2 zombie_hp3 zombie_hp4 are declared/assigned values.

DoviuX 03-13-2010 15:23

Re: Hp doesn't work like supost too
 
This ?
PHP Code:

    cvar_zombie_hp1        =    register_cvar("zswarm_zahealth""750")
    
cvar_zombie_gravity1    =    register_cvar("zswarm_zagravity""800")
    
cvar_zombie_speed1    =    register_cvar("zswarm_zaspeed",    "250")

    
cvar_zombie_hp2        =    register_cvar("zswarm_zmhealth""900")
    
cvar_zombie_gravity2    =    register_cvar("zswarm_zmgravity""800")
    
cvar_zombie_speed2    =    register_cvar("zswarm_zmspeed",    "250")

    
cvar_zombie_hp3        =    register_cvar("zswarm_zhealth",    "1000")
    
cvar_zombie_gravity3    =    register_cvar("zswarm_zgravity""800")
    
cvar_zombie_speed3    =    register_cvar("zswarm_zspeed",    "255")

    
cvar_zombie_hp4        =    register_cvar("zswarm_ahealth",    "1200")
    
cvar_zombie_gravity4    =    register_cvar("zswarm_agravity""800")
    
cvar_zombie_speed4    =    register_cvar("zswarm_aspeed",    "265"


fysiks 03-13-2010 15:28

Re: Hp doesn't work like supost too
 
Try again.

Quote:

Originally Posted by Exolent[jNr] (Post 1116458)
Show where zombie_hp1 zombie_hp2 zombie_hp3 zombie_hp4 are declared/assigned values.

Or are you trying to retrieve the cvar value of cvar_zombie_hp1??

DoviuX 03-13-2010 15:30

Re: Hp doesn't work like supost too
 
I want that the class1 had 800Hp class2 had 900Hp class3 had 1000Hp and class4 had 1200Hp but when spawn they mixing and like class3 has 1200Hp or next spawn class3 has 800.

And you mean these ?

PHP Code:

        new Float:zombie_hp1Float:zombie_gravity1
        zombie_hp1 
=    get_pcvar_float(cvar_zombie_hp1)
        
zombie_gravity1 =    get_pcvar_float(cvar_zombie_gravity1) / 800

        
new Float:zombie_hp2Float:zombie_gravity2
        zombie_hp2    
=    get_pcvar_float(cvar_zombie_hp2)
        
zombie_gravity2    =    get_pcvar_float(cvar_zombie_gravity2) / 800

        
new Float:zombie_hp3Float:zombie_gravity3
        zombie_hp3    
=    get_pcvar_float(cvar_zombie_hp3)
        
zombie_gravity3    =    get_pcvar_float(cvar_zombie_gravity3) / 800

        
new Float:zombie_hp4Float:zombie_gravity4
        zombie_hp4    
=    get_pcvar_float(cvar_zombie_hp4)
        
zombie_gravity4    =    get_pcvar_float(cvar_zombie_gravity4) / 800 


ConnorMcLeod 03-13-2010 18:19

Re: Hp doesn't work like supost too
 
Code is ok, the problem is that you can't see HPs above 255, means that if you have 300HPs you will see 300-256, also if you have 256, 512, 768 etc.. you will see 0 and you gonna have a annoying movement bug.

DoviuX 03-14-2010 00:12

Re: Hp doesn't work like supost too
 
Hp's are showing by the hud message, how can i explain... Class1: 600Hp on spawn Class2: 600Hp (but suppost to be 750).


All times are GMT -4. The time now is 08:45.

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