Better way to check if exist other than for loop
PHP Code:
Is there better way to check it? |
Re: Better way to check if exist other than for loop
You should first find which skills the player doesn't have yet and then select only among those randomly.
|
Re: Better way to check if exist other than for loop
Quote:
I knew few way but if those way run on 32 player at the same time, It didn't work out too well |
Re: Better way to check if exist other than for loop
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. |
Re: Better way to check if exist other than for loop
Not sure about this:
PHP Code:
|
Re: Better way to check if exist other than for loop
PHP Code:
|
Re: Better way to check if exist other than for loop
Sorry for late reply
I did thing of this but the number of skill (g_TotalSkill) increase via register native like Extra Item or Zombie Class in ZP Because of that, I can't create the Array with the size of total skill Also, I want it to be random too so check by order is not gonna work. P?S: Sorry if I am being dumb |
Re: Better way to check if exist other than for loop
It will assign a new skill at random regardless of order as defined in the enum. I am not sure what you mean by the number of skills increasing by register native. You'd need to show more code
|
Re: Better way to check if exist other than for loop
Quote:
PHP Code:
So I can't use enum as it is predetermine. |
Re: Better way to check if exist other than for loop
Ok, how do I determine what skills have already been used and which are free? Which variables store this?
I don't want to waste time (again) with assumptions. |
All times are GMT -4. The time now is 17:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.