SA-MP Forums Archive
[/gethere] command help - 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: [/gethere] command help (/showthread.php?tid=584169)



[/gethere] command help - Nebunul14 - 02.08.2015

Please help me with command /gethere.


Re: [/gethere] command help - Mencent - 02.08.2015

Do you start already a "/gethere" command?
Where do you exaclty need help?


Re: [/gethere] command help - TheSnaKe - 02.08.2015

Check this https://sampforum.blast.hk/showthread.php?tid=302111


Re: [/gethere] command help - SFA7X - 02.08.2015

So you want a cmd that teleports the desired player to your location?
Код:
dcmd_gethere(playerid,params[])
{
	new string[128];
	new ID;
	if(sscanf(params,"u",ID))
	{
	    SendClientMessage(playerid,-1,"{CACA00}[INFO]{FFFFFF}: /bring (Player Name/ID)");
	    return 1;
	}
	if(ID == INVALID_PLAYER_ID)
	{
	    format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot bring them.",ID);
	    SendClientMessage(playerid,-1,string);
	    return 1;
	}
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid,x,y,z);

	SetPlayerPos(ID,x+1,y,z);
	SetPlayerVirtualWorld(ID,GetPlayerVirtualWorld(playerid));
	SetPlayerInterior(ID,GetPlayerInterior(playerid));
	format(string,sizeof(string),"You have been teleported to %s(%d).",PlayerName(playerid),playerid);
	SendClientMessage(ID,-1,string);
	format(string,sizeof(string),"You have teleported %s(%d) to you.",PlayerName(ID),ID);
	SendClientMessage(playerid,-1,string);
	return 1;
}



Re: [/gethere] command help - dominik523 - 02.08.2015

Quote:
Originally Posted by SFA7X
Посмотреть сообщение
So you want a cmd that teleports the desired player to your location?
Код:
dcmd_gethere(playerid,params[])
{
	new string[128];
	new ID;
	if(sscanf(params,"u",ID))
	{
	    SendClientMessage(playerid,-1,"{CACA00}[INFO]{FFFFFF}: /bring (Player Name/ID)");
	    return 1;
	}
	if(ID == INVALID_PLAYER_ID)
	{
	    format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot bring them.",ID);
	    SendClientMessage(playerid,-1,string);
	    return 1;
	}
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid,x,y,z);

	SetPlayerPos(ID,x+1,y,z);
	SetPlayerVirtualWorld(ID,GetPlayerVirtualWorld(playerid));
	SetPlayerInterior(ID,GetPlayerInterior(playerid));
	format(string,sizeof(string),"You have been teleported to %s(%d).",PlayerName(playerid),playerid);
	SendClientMessage(ID,-1,string);
	format(string,sizeof(string),"You have teleported %s(%d) to you.",PlayerName(ID),ID);
	SendClientMessage(playerid,-1,string);
	return 1;
}
Pasting finished code will never help. You should let him go through the tutorial.


Re: [/gethere] command help - Remy0 - 03.08.2015

At The First Put that with the includes

Код:
#include <zcmd>
And This is the command

Код:
CMD:gethere(playerid,params[])
{
	if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, 0xFF0606FF, "[ERROR] You are not an admin!");
	new Float:x,Float:y,Float:z,playerb,str[128];
	if(sscanf(params,"u",playerb)) return SendClientMessage(playerid, 0x33AA33FF, "[USAGE]: /get [id]");
	if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, 0xFF0606FF, "[ERROR] Invalid player id!");
	GetPlayerPos(playerid,x,y,z);
	SetPlayerPos(playerb,x,y,z);
	SetPlayerInterior(playerb, GetPlayerInterior(playerid));
	SetPlayerVirtualWorld(playerb, GetPlayerVirtualWorld(playerid));
	format(str,sizeof(str), "Admin %s has teleported you.", Name(playerid));
	SendClientMessage(playerb, 0xFFFF00FF, str);
	format(str,sizeof(str), " Successfully teleported %s to you.", Name(playerb));
	SendClientMessage(playerid, 0xFF00AEFF, str);
	return 1;
}