Raised This Month: $ Target: $400
 0% 

What is better way of printing this?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-02-2019 , 08:54   Re: What is better way of printing this?
Reply With Quote #5

Your code is limited to only 2 arrays of vips. With 32 VIPs online, it won't print all of them.

PHP Code:
public print_online_vips(id)
{
    static const 
iMax 4
    
new szVips[160], iPlayers[MAX_PLAYERS], iPnumiCountAll
    get_players
(iPlayersiPnum"ch")

    
szVips "^4VIPs Online: ^3"

    
for(new iiCountiPlayeriPnumi++)
    {
        
iPlayer iPlayers[i]

        if(
get_user_flags(iPlayer) & VIP_LEVEL)
        {
            
iCountAll++

            if(
iCount++ < iMax)
            {
                
add(szVipscharsmax(szVips), fmt("%n"iPlayer))

                if(
iPnum 1)
                {
                    
add(szVipscharsmax(szVips), "^4, ^3")
                }
            }
            else
            {
                
iCount 0
                client_print_color
(ididszVips)
                
szVips[0] = EOS
            
}
        }
    }

    if(
iCountAll)
    {
        
client_print_color(ididszVips)
    }
    else
    {
        
client_print_color(idid"^4%l""NO_VIP_ONLINE")
    }

    return 
PLUGIN_HANDLED

iMax is the maximum number of players that will get printed on each line.
__________________

Last edited by OciXCrom; 06-02-2019 at 11:17.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
 



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:18.


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