[FilterScript] Simple teleport to coords
#5

This should be a code snippet, not to mention how basic this is. Here's a better version(untested),

pawn Код:
CMD:tp(playerid, params[])
{
      new Float: pPos[3], interior;
      if(sscanf(params, "fffD", pPos[0], pPos[1], pPos[2], interior)) return SendClientMessage(playerid, 0xFF0000FF, "/tp (X/Y/Z)");
      SetPlayerPos(pPos[0], pPos[1], pPos[2]);
      if(interior > 0)
      {
            TogglePlayerControllable(playerid, false);
            SetPlayerInterior(playerid, interior);
            SetTimerEx("UnfreezePlayer", 2500, false, "i", playerid);
            return true;
      }
      return true;
}

forward UnfreezePlayer(playerid);
public UnfreezePlayer(playerid)
{
    TogglePlayerControllable(playerid, true);
    return true;
}
A word of advice...

If your going to release something atleast make sure its more than 5 lines of code.
Reply


Messages In This Thread
Simple teleport to coords - by JeevanJyothish - 26.08.2014, 09:49
Re: Simple teleport to coords - by KayJ - 26.08.2014, 10:15
Re: Simple teleport to coords - by Stinged - 26.08.2014, 11:32
Re: Simple teleport to coords - by ScripteRNaBEEL - 26.08.2014, 13:21
Re: Simple teleport to coords - by Abagail - 26.08.2014, 13:30

Forum Jump:


Users browsing this thread: 1 Guest(s)