View Single Post
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