Raised This Month: $ Target: $400
 0% 

Better way to check if exist other than for loop


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-16-2021 , 08:30   Re: Better way to check if exist other than for loop
Reply With Quote #4

I would load an array with the skills he doesn't have and then to get a new skill, use random() to index it.

Or if you don't need random, use an array that maintains which skills a player doesn't have, as he gets a new one, set the index to true. When he needs a new skill, cycle through this array and any that are false are assignable.
__________________

Last edited by Bugsy; 04-16-2021 at 08:36.
Bugsy 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 17:38.


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