Raised This Month: $ Target: $400
 0% 

Random_num


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 12-04-2009 , 19:42   Re: Random_num
Reply With Quote #1

Quote:
Originally Posted by Exolent[jNr] View Post
If you only want it random every time the map starts.

Code:
new HEALTH</p><p>&nbsp;</p><p>public plugin_init( ) {</p><p> HEALTH = random_num( 0, 1000 )</p><p>}</p><p>&nbsp;</p><p>yourCode( ) {</p><p> set_user_health( id, get_user_health( id ) + HEALTH )</p><p> chat_print( id, " You have won %d heath.", HEALTH ) </p><p>}



Or if you only want it random every time the function is used:


Code:
#define HEALTH random_num( 0, 1000 )</p><p>&nbsp;</p><p>yourCode( ) {</p><p> new iHealth = HEALTH</p><p> set_user_health( id, get_user_health( id ) + iHealth )</p><p> chat_print( id, " You have won %d heath.", iHealth ) </p><p>}
Thanks so much
__________________
ƒa†es™ is offline
Reply



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 00:30.


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