/Goto Question
#2

Try this:
Код:
dcmd_goto(playerid, params[])
{
if (strlen(params))
{
new id = strval(params);
if(playerid == id)//If typed ID is playerid
{
  SendClientMessage(playerid,0xFF0000AA,"You cannot teleport to yourself");//then player will receive this messsage
  return 1;
}
if (IsPlayerConnected(id))
{
if(IsPlayerAdmin(playerid))
{
new
Float:pPos[ 3 ];
GetPlayerPos(id, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] );
SetPlayerPos( playerid, pPos[ 0 ], pPos[ 1 ], pPos[ 2 ] );
SetPlayerInterior(playerid, GetPlayerInterior(id));
SendClientMessage(playerid, COLOR_WHITE, "You've been teleported to the player!");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You are not an Administrator");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found!");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/goto <playerid>\"");
}
return 1;
}
Reply


Messages In This Thread
/Goto Question - by JoeDaDude - 31.12.2009, 20:23
Re: /Goto Question - by Norck - 31.12.2009, 20:44

Forum Jump:


Users browsing this thread: 1 Guest(s)