SA-MP Forums Archive
/getinfo command - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /getinfo command (/showthread.php?tid=649567)



/getinfo command - ivndosos - 11.02.2018

Hi,

I've made a getinfo command for admins, the only problem is when I write an ID (doesn't matter who's, mine or someone else's) It won't show, nothing happens!

Код:
CMD:getinfo(playerid, params[])
{
    if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
    if(pInfo[playerid][Admin] < 2) return SendClientMessage(playerid, -1, "{C3C3C3}(INFO) You don't have the priviliges to use this command.");
	{
		new str[500], target;
	    new ip[16], country[32], isp[32], city[32];
		if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /getinfo [id]");
	    if(pInfo[playerid][Admin] == 1)
	    {
	       GetPlayerIp(target, ip, 16);
	       GetIPCountry(ip, country, sizeof country);
	       GetIPISP(ip, isp, sizeof isp);
	       GetIPCity(ip, city, sizeof city);
	       GetPlayerIp(target,ip,sizeof(ip));
	       format(str,sizeof(str), "Player Information\nName: {EFB509}%s(ID:%d)\nIP: {EFB509}%s\nCountry: {EFB509}%s\nCity: {EFB509}%s\nISP: {EFB509}%s",RealName[target], playerid, ip, country, city, isp);
		   ShowPlayerDialog(playerid, 1029, DIALOG_STYLE_MSGBOX, "info",str, "Ok","");
		}
	}
	return 1;
}



Re: /getinfo command - BulletRaja - 11.02.2018

Код:
if(pInfo[playerid][Admin] == 1)
	    {
remoe this
Код:
}
then try

Код:
CMD:getinfo(playerid, params[])
{
    if(connected[playerid] == true) return GameTextForPlayer(playerid, "~r~Spawn First", 5000, 5);
    if(pInfo[playerid][Admin] < 2) return SendClientMessage(playerid, -1, "{C3C3C3}(INFO) You don't have the priviliges to use this command.");
	{
		new str[500], target;
	    new ip[16], country[32], isp[32], city[32];
		if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "{c3c3c3}(INFO) /getinfo [id]");
	       GetPlayerIp(target, ip, 16);
	       GetIPCountry(ip, country, sizeof country);
	       GetIPISP(ip, isp, sizeof isp);
	       GetIPCity(ip, city, sizeof city);
	       GetPlayerIp(target,ip,sizeof(ip));
	       format(str,sizeof(str), "Player Information\nName: {EFB509}%s(ID:%d)\nIP: {EFB509}%s\nCountry: {EFB509}%s\nCity: {EFB509}%s\nISP: {EFB509}%s",RealName[target], playerid, ip, country, city, isp);
		   ShowPlayerDialog(playerid, 1029, DIALOG_STYLE_MSGBOX, "info",str, "Ok","");
	}
	return 1;
}



Re: /getinfo command - ivndosos - 11.02.2018

oh lol haven't notice there are 2 admin checks lol, works thanks