SA-MP Forums Archive
Minor erros for getIP CmD - 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: Minor erros for getIP CmD (/showthread.php?tid=592224)



Minor erros for getIP CmD - fuckingcruse - 22.10.2015

Here you go

Код:
CMD:getip(playerid,params[])
{
	new ip;
	ip = GetPlayerIp(playerid,IP[playerid],sizeof(IP));
	new nameforip;
	nameforip = GetPlayerName(playerid);
	new ipinfomsg;
	format(ipinfomsg,sizeof(ipinfomsg),"The IP of '%s' is '%d'",nameforip,ip);
	SendClientMessage(playerid,-1,ipinfomsg);
        return 1;
}



Re: Minor erros for getIP CmD - PrivatioBoni - 22.10.2015

That will just get your own IP every time, and is missing the [number] at the end of "ip" (which is a string).

Take mine:

Код:
CMD:getip(playerid, params[])
{
	new ip[16], ID, string[128];

	if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, -1, "No permissions");
	if(sscanf(params, "u", ID)) SendClientMessage(playerid, -1, "/getip [name/playerid]");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1, "Invalid player");

	GetPlayerIp(ID, ip, sizeof(ip));
    format(string, sizeof(string),"%s[%i] gets IP of %s[%i]. IP: %s", GetName(playerid), playerid, GetName(ID), ID, ip);
	SendClientMessage(playerid, -1, string);

	return 1;
}
Indentation is screwed because of the forum.

Also, I can't help but notice your signature: "Scripting for money , except Mysql and textdraws , I can script everything." This GetIP command is pretty basic...


Re: Minor erros for getIP CmD - fuckingcruse - 22.10.2015

and a last thing to ask.. i am back at scripting after a long time.. So.. i am getting noob atm.. I forgot many things.. When player goes to request spawn.. i added two skins.. it's isn't showing at the request class once check this...

Код:
public OnGameModeInit()
{

	SetGameModeText("Blank Script");
	AddPlayerClass(297,726.0939+1,-1573.9521+1,16.4773+1,179.3009+1, 0, 0, 0, 0, 0, 0);
 	AddPlayerClass(298,726.0939,-1573.9521,16.4773,179.3009, 0, 0, 0, 0, 0, 0);
	UsePlayerPedAnims();
	CreatePickup(1314, 1, 739.4675,-1431.0551,13.5234, -1);
	mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
	mysql = mysql_connect(host, user, db, pass); 


	return 1;
}
public OnPlayerRequestClass(playerid, classid)
{

	SetPlayerCameraPos(playerid,724.1221,-1576.6000,15.6914);
	SetPlayerCameraLookAt(playerid, 739.4675,-1431.0551,13.5234);


	return 1;
}



Re: Minor erros for getIP CmD - PrivatioBoni - 22.10.2015

Did the get IP thing work?


Re: Minor erros for getIP CmD - fuckingcruse - 22.10.2015

Nope.. I have made some changes once look at it..

Код:
CMD:getip(playerid, params[])
{
	new ip[16], IDforIP, string[128];


	if(sscanf(params, "u", IDforIP)) SendClientMessage(playerid, -1, "/getip [name/playerid]");
    if(!IsPlayerConnected(IDforIP)) return SendClientMessage(playerid, -1, "Invalid player");

	GetPlayerIp(ID, ip, sizeof(ip));
    format(string, sizeof(string),"%s[%i] gets IP of %s[%i]. IP: %s", GetPlayerName(playerid), playerid, GetPlayerName(IDforIP), IDforIP, ip);
	SendClientMessage(playerid, -1, string);

	return 1;
}



Re: Minor erros for getIP CmD - PrivatioBoni - 22.10.2015

Okay, the only thing you changed was a variable name and removed an admin check?
You're welcome, by the way.


Re: Minor erros for getIP CmD - fuckingcruse - 22.10.2015

Still it's not working.. buddy. and help me with the player class too..


Re: Minor erros for getIP CmD - PrivatioBoni - 22.10.2015

No, you're rude.
P.s. if you don't have sscanf, you need it.


Re: Minor erros for getIP CmD - fuckingcruse - 22.10.2015

I don't know in which way i am rude.. If this is rude.. i don't know what's going to happen to you in your further future. thanks anyway lol..


Re: Minor erros for getIP CmD - PrivatioBoni - 22.10.2015

Quote:
Originally Posted by fuckingcruse
Посмотреть сообщение
I don't know in which way i am rude.. If this is rude.. i don't know what's going to happen to you in your further future. thanks anyway lol..
See my above post's edit.
And, if you don't put a "thank you" here nor there despite other/s trying to assist you, you won't get helped anymore. You should also realise that.

Anyway, I'm out of this topic now. Maybe somebody else will assist you further.