Minor erros for getIP CmD
#1

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;
}
Reply
#2

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...
Reply
#3

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;
}
Reply
#4

Did the get IP thing work?
Reply
#5

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;
}
Reply
#6

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

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

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

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..
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)