Simple teleport to coords -
JeevanJyothish - 26.08.2014
Simple Teleport to Coords
Introduction
I was bored so I make this . This is a simple script allows you to teleport anywhere by typing their (X/Y/Z)
Commands
/tp (X/Y/Z)
Requires
Sscanf2
y_commands
Download
pastebin
Credits
JeevanJyothish (scripter)
****** (sscanf2 , y_commands)
Working times 2Hrs (Newibe Scripter)
Re: Simple teleport to coords -
KayJ - 26.08.2014
Very Simple as hell. BTW you made this so Good work.
Re: Simple teleport to coords -
Stinged - 26.08.2014
This will not work correctly.
1) Positions are floats.
2):
It shouldn't be like this.
pawn Код:
YCMD:tp(playerid, params[], help)
{
{
new x,y,z;
if(sscanf(params, "iii", x, y, z))return SendClientMessage(playerid, 0xFF0000FF, "/tp (X/Y/Z)");
SetPlayerPos(playerid, x, y, z);
return 1;
{
return 1;
}
It should be like this:
pawn Код:
YCMD:tp(playerid, params[], help)
{
new x,y,z;
if(sscanf(params, "iii", x, y, z))return SendClientMessage(playerid, 0xFF0000FF, "/tp (X/Y/Z)");
SetPlayerPos(playerid, x, y, z);
return 1;
}
Here's a working version:
pawn Код:
YCMD:tp(playerid, params[], help)
{
new Float:x, Float:y, Float:z;
if(sscanf(params, "fff", x, y, z)) return SendClientMessage(playerid, 0xFF0000FF, "/tp (X/Y/Z)");
SetPlayerPos(playerid, x, y, z);
return 1;
}
Re: Simple teleport to coords -
ScripteRNaBEEL - 26.08.2014
yeah Stinged is right, u take 2 hrs for this simple script omg...........
Re: Simple teleport to coords -
Abagail - 26.08.2014
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.