[FilterScript] simple STATUS like counter-cstrike console. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] simple STATUS like counter-cstrike console. (
/showthread.php?tid=282500)
simple STATUS like counter-cstrike console. -
oicq747285250 - 11.09.2011

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
Re: simple STATUS like counter-cstrike console. -
Srdjan - 11.09.2011
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.
Re: simple STATUS like counter-cstrike console. -
KoczkaHUN - 11.09.2011
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]
Re: simple STATUS like counter-cstrike console. -
TheArcher - 11.09.2011
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]