View Single Post
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 01-29-2022 , 09:30   Re: Get max array of X flags in the loop
Reply With Quote #19

Quote:
Originally Posted by Natsheh View Post
The 2nd code in your post will output the last vip in the players array, test it with two vips and you will see what is happening.
Sorry, after testing it i found i was wrong but i tried to optimize for the code by using strlen native
Is there any problem with this ? or another way is faster than this ?
PHP Code:
@OnVipsOnlineid )
{
    new 
szBufferMAX_TEXT_LENGTH ], szPlayersMAX_PLAYERS ], iNum;

    
get_playersszPlayersiNum)//, "ch" );

    
for( new iIndexiiNumi++ )
    {
        if( 
g_iPlayer[ ( iIndex szPlayers] ) ][ VIP ] & g_iSettingsAccess_OnlineList ] )
        {
            
formatexszBufferstrlenszBuffer ) ], charsmaxszBuffer ), "%s, "g_iPlayeriIndex ][ Name ] )
        }
    }
    
    if( 
szBuffer] != EOS )
    {
        
szBufferstrlenszBuffer ) - ] = '.'
        
CC_SendMessageidszBuffer );
    }
    else
    {
        
CC_SendMessageid"There are no vip's online." );
    }

__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 01-29-2022 at 10:15.
Supremache is offline