Raised This Month: $ Target: $400
 0% 

Better way to check if exist other than for loop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 04-16-2021 , 13:09   Re: Better way to check if exist other than for loop
Reply With Quote #1

Not sure about this:
PHP Code:
new g_PlayerSkill[33][30];

public 
SkillGain(idlevel)
{
    static 
nextskillnextskill random_num(,g_TotalSkill)
    if(!
IsPlayerHasSkill(idnextskill))
    {
        
Set_Skill(idnextskilltrue)
        
g_PlayerSkill[id][level-1] = nextskill
    
}
    else
        
SkillGain(idlevel)    
}

public 
IsPlayerHasSkill(idskillid)
{
    
// I assume that "skillid" is the index of skill in array
    
return g_PlayerSkill[id][skillid] != true false

__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi 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 17:38.


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