AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Random Hp , speed for zswarm (https://forums.alliedmods.net/showthread.php?t=107684)

DoviuX 10-29-2009 02:57

Random Hp , speed for zswarm
 
How can start to make random hp for zombies in zswarm ? I tried this:

PHP Code:

    cvar_health        =    register_cvar("zswarm_health",    hprandom(idsize of hp)] 

But won't compile how can i compile ?

Xellath 10-29-2009 04:17

Re: Random Hp , speed for zswarm
 
Random hp each map or random hp when the client becomes that zombie class?

drakeris 10-29-2009 08:02

Re: Random Hp , speed for zswarm
 
i think when he becomes that zobmie class

unnyquee 10-29-2009 08:18

Re: Random Hp , speed for zswarm
 
You can use:
PHP Code:

new health random_num(minmax);
cvar_health register_cvar("zswarm_health"health); 

Hope it works! :crab:

Xellath 10-29-2009 16:32

Re: Random Hp , speed for zswarm
 
Quote:

Originally Posted by unnyquee (Post 975088)
You can use:
PHP Code:

new health random_num(minmax);
cvar_health register_cvar("zswarm_health"health); 

Hope it works! :crab:

Wont work, you've gotta convert it to a string.

Code:
new szHealth[ 6 ], iHealth = random_num( 200, 500 ); // example values num_to_str( iHealth, szHealth, charsmax( szHealth ) ); cvar_health = register_cvar( "zswarm_health", szHealth );

grimvh2 10-29-2009 17:46

Re: Random Hp , speed for zswarm
 
Maybe 2 cvars ?

PHP Code:

min_health register_cvar("min_health" "100")
max_health register_cvar("max_health""500"

then in ur code where you set the zombie his health
PHP Code:

new num random_num get_pcvar_num(min_health),get_pcvar_num(max_health) )  
set_user_health(player,num

So each time you set the zombie his health, it will be random from 100 to 500 (by cvar)

unnyquee 10-30-2009 08:27

Re: Random Hp , speed for zswarm
 
Xellath, why to convert it into a string?

xPaw 10-30-2009 08:35

Re: Random Hp , speed for zswarm
 
Quote:

Originally Posted by unnyquee (Post 975947)
Xellath, why to convert it into a string?

Because second param is string.


All times are GMT -4. The time now is 17:32.

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