Raised This Month: $ Target: $400
 0% 

random_num


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 03-04-2014 , 18:26   Re: random_num
Reply With Quote #5

Quote:
Originally Posted by georgik57 View Post
PHP Code:
#define SCREENSHOT_PER_DEATHS random_num(2, 12) 
->
PHP Code:
const SCREENSHOT_PER_DEATHS random_num(212
or(for float)
PHP Code:
const Float:SCREENSHOT_PER_DEATHS random_float(2.012.0
Try to compile the first one and the second one just won't work.

Code:
#include <amxmodx> #define SCREENSHOT_PER_DEATHS random_num(2, 12) public plugin_init() {     register_plugin("Test Plugin 1", "", "[ --{-@ ]");         new Timer = tickcount();     new count, problems;         for ( new i ; i < 2147483647 ; i++ ) {                 if ( ! ( 0 <= ( i % SCREENSHOT_PER_DEATHS ) <= 11 ) )             problems++;                 count++     }         Timer = tickcount() - Timer;         server_print("Done. %d loops, %d problems occurred and it all took %d minutes, %d seconds and %d milliseconds.", count, problems, Timer / 60000, Timer % 60000 / 1000, Timer % 1000 ); }

Code:
Done. 2147483647 loops, 0 problems occurred and it all took 3 minutes, 22 seconds and 152 milliseconds.
__________________

Last edited by Black Rose; 03-04-2014 at 19:13.
Black Rose is offline
 



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 05:57.


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