View Single Post
101
Member
Join Date: Nov 2023
Old 12-09-2023 , 07:27   Re: Question about native : get_players
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
Why don't you just look at the native to see what it does?
I don't have any idea where to get native sources , i searched and didn't find them , and nothing f important about natives in here: https://www.amxmodx.org/api/

When i see this native for the first time , i felt that something wrong in it , and i was right .
i think there must be a general amxx plugin instead, that tracks events moment by moment and set players flags BOOLs method as the example above , and this general plugin should create a general native that gives information instantly without checking ( Teams, connections, status :alive...)
and here is a quick example of Only_bool_Flags_Check:
PHP Code:
native wtf(....,char flags_to_check,..)
{
    for (
i=0i<Hello i++)    //int Hello represents the max ingame-players count (Pre-calculated)
    
{
        
j0;
        While (
strlen(flags_to_check)    )
        {
                
f=find_flag_index(flags_to_check[j++]);
                if ( 
flags[p_index[i]][ ] )    count++;
        }
        if (
count==strlen(flags_to_check))        //player got all flags 
        
wtf[x++]=p_index[i];                                // so add him to array 
    
}
    *
iMax x;
}

find_flag_index(String:s_[1])
{
    for (
int i =max_flags ;i++)
    {
        if (
allowed_flags[i]==s_[0])
        return 
i;
    }
    
SetFailure...;

another issue in is_user_alive and other functions that Shouldn't check if is_user_connected , cuze this will duplicate checking inside loops .
anyway , thank you Mr Bugsy , Correct me if i was wrong .

Last edited by 101; 12-09-2023 at 20:51.
101 is offline