[/gethere] command help
#1

Please help me with command /gethere.
Reply
#2

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)