Raised This Month: $ Target: $400
 0% 

Random Hp , speed for zswarm


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 10-29-2009 , 02:57   Random Hp , speed for zswarm
Reply With Quote #1

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 ?
DoviuX is offline
Send a message via Skype™ to DoviuX
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-29-2009 , 04:17   Re: Random Hp , speed for zswarm
Reply With Quote #2

Random hp each map or random hp when the client becomes that zombie class?
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
drakeris
Senior Member
Join Date: Jul 2009
Old 10-29-2009 , 08:02   Re: Random Hp , speed for zswarm
Reply With Quote #3

i think when he becomes that zobmie class
drakeris is offline
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 10-29-2009 , 08:18   Re: Random Hp , speed for zswarm
Reply With Quote #4

You can use:
PHP Code:
new health random_num(minmax);
cvar_health register_cvar("zswarm_health"health); 
Hope it works!
__________________
unnyquee is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 10-29-2009 , 16:32   Re: Random Hp , speed for zswarm
Reply With Quote #5

Quote:
Originally Posted by unnyquee View Post
You can use:
PHP Code:
new health random_num(minmax);
cvar_health register_cvar("zswarm_health"health); 
Hope it works!
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 );
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-29-2009 , 17:46   Re: Random Hp , speed for zswarm
Reply With Quote #6

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)
__________________
I am out of order!
grimvh2 is offline
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 10-30-2009 , 08:27   Re: Random Hp , speed for zswarm
Reply With Quote #7

Xellath, why to convert it into a string?
__________________
unnyquee 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 17:32.


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