Simple thing I whipped up.
pawn Код:
new gototog[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
gototog[playerid] = 0;
return 1;
}
CMD:goto(playerid, params[])
{
new targetid, string[128];
if(sscanf(params, "u", targetid))
{
return SendClientMessage(playerid, COLOR_GRAY, "Usage: /goto [playerid]");
}
else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "Invalid player specified.");
else if(targetid == playerid) return SendClientMessage(playerid, -1, "You cannot use this command on yourself!");
else if(gototog[targetid] == 1) return SendClientMessage(playerid, -1, "That player has disabled players from going to them");
new Float: pos[3];
GetPlayerPos(targetid, pos[0], pos[1], pos[2]);
SetPlayerInterior(playerid, GetPlayerInterior(targetid));
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
return 1;
}
CMD:toggoto(playerid, params[])
{
if(gototog[playerid] == 0)
{
gototog[playerid] = 1;
SendClientMessage(playerid, -1, "Other players may not teleport to you now!");
}
else if(gototog[playerid] == 1)
{
gototog[playerid] = 0;
SendClientMessage(playerid, -1, "Other players may teleport to you now!");
}
return 1;
}
/goto command I got from my own script. This simply creates a variable gototog, and sets it to 0 when the player joins (people can goto him). Then if they /toggoto, it sets it either disabled or disabled, depending on what it already is.
Untested, could work though. Tired, wasn't paying much attention while I scripted.