[FilterScript] simple STATUS like counter-cstrike console.
#1


put in your FS.
Код:
public OnRconCommand(cmd[])
{
	if (strcmp("status", cmd, true, 10) == 0)
	{
	    new h,mo,s,y,m,d;
		getdate(y,mo,d);
		gettime(h,m,s);
		print("__________________________________________________");
		print("Server Infomation:");
	    printf("[%d/%d/%d][%d:%d:%d]",y,mo,d,h,m,s);
		for(new i;i<MAX_PLAYERS;i++)
		{
			if(IsPlayerConnected(i))
			{
			    new Name[64];
			    new IP[64];
			    new PING;
			    new id=i;
			    GetPlayerName(i,Name,sizeof(Name));
			    GetPlayerIp(i,IP,sizeof(IP));
				PING=GetPlayerPing(i);
				if(IsPlayerNPC(i))
				{
				    format(Name,sizeof(Name),"-NPC-%s",Name);
				    format(IP,sizeof(IP),"localhost");
					PING=0;
				}
				format(Name,sizeof(Name),"%s(%d)",Name,id);
			    printf("%s ip:%s pings:%dms",Name,IP,PING);
			}
		}
		print("__________________________________________________");
		return 1;
	}
	return 1;
}
Made By oicq747285250
Reply
#2

Looks really nice. Just reduce the size of Name to MAX_PLAYER_NAME, which is 24, and do the same to IP. IP's string size can't go above 17. Also what's the use of "new id=i;"? I think I couldn't find place where you used it.
Reply
#3

Actually an IPv4 address can be 15 characters long: 255.255.255.255
IPv6 address can be 41 characters long: [ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]
Reply
#4

Quote:
Originally Posted by KoczkaHUN
Посмотреть сообщение
Actually an IPv4 address can be 15 characters long: 255.255.255.255
IPv6 address can be 41 characters long: [ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]
IPv4 will never be shown in "public". Only your Public address. [whatsmyip.com]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)