Raised This Month: $51 Target: $400
 12% 

[Loop] Random number & retry after exception


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 11-07-2015 , 20:32   [Loop] Random number & retry after exception
Reply With Quote #1

I have search through this forum & google for a few hours now and I can't find anything I'm used to convert from.
Anyway, I need a loop starting from 0 to 4.
One of these numbers are supposed be randomized and put into a integer.
It also has to exclude number 3, and run through the failed iteration of the loop again if the number becomes 3 or if there is a way to just exclude it from the loop.

EDIT:
Figured out another way of doing it by doing this since the size of the loop wouldn't be so big.
Code:
new const g_Random[] = { 1, 2, 4 } client_print( iPlayer, print_console, "g_Random = %i" g_Random[random(sizeof g_Random)] );

Last edited by Rirre; 11-07-2015 at 21:01.
Rirre 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 03:21.


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