Raised This Month: $ Target: $400
 0% 

What is better way of printing this?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
6Yukimuro9
Junior Member
Join Date: May 2019
Location: Serbia, Belgrade
Old 06-02-2019 , 04:49   What is better way of printing this?
Reply With Quote #1

Hello, I'm creating VIP plugin from scratch and its like 90% done by now so I' m doing optimisation...

I'm wondering what is better way of doing this:

Code:
public print_online_vips(id)
{
	new vips[100], vips2[100], iPlayers[32], iPlayersNum, i;
	
	get_players(iPlayers, iPlayersNum, "c");
	for(i = 0; i < iPlayersNum; ++i)
	{
		if(get_user_flags(iPlayers[i]) & VIP_LEVEL)
		{
			new name[MAX_NAME_LENGTH];
			get_user_name(iPlayers[i], name, sizeof(name));
			
			
			if(strlen(vips) < 100)
				format(vips, sizeof(vips), "%s%s%s", vips, name, !vips[0] ? "" : ", ");
			else
				format(vips2, sizeof(vips2), "%s, %s", vips2, name);
		}
	}
	
	if(!vips[0])
		client_print_color(id, id, "^4[VIP]^1 %L", id, "NO_VIP_ONLINE");
		
	else
		client_print_color(id, id, "^4VIP Online:^3 %s^4%s", vips, vips2[0] ? "," : ".");
		
	if(vips2[0])
		client_print_color(id, id, "^3 %s^4.", vips2);
		
	return PLUGIN_HANDLED;
}
6Yukimuro9 is offline
 



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