SA-MP Forums Archive
Teleport ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Teleport ? (/showthread.php?tid=306884)



Teleport ? - Gooday - 28.12.2011

How i can make a command like

/Teleport [ID] and teleport the id who i choose in a location?

(Like a command for admins for teleport to the spawn point if someone is bugged, but reserved just for the skin 285)


Re: Teleport ? - §с†¶e®РµРe - 28.12.2011

Didnt understand..
U wanna bring the player to you?


Re: Teleport ? - Gooday - 28.12.2011

i wanna teleport the player to a location....(set the X,Y,Z) and teleport him there..


Re: Teleport ? - Mike_Peterson - 28.12.2011

Still unclear, do you want to teleport the player to XYZ which you choose in the /teleport [id] [x] [y] [z] command?
or if, i thought.. You want the teleport the player to the spawnpoint, only when you are using SkinID 285, or someone else is using SkinID 285.


Re: Teleport ? - Gooday - 28.12.2011

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
Still unclear, do you want to teleport the player to XYZ which you choose in the /teleport [id] [x] [y] [z] command?
or if, i thought.. You want the teleport the player to the spawnpoint, only when you are using SkinID 285, or someone else is using SkinID 285.
I want a command just for the skin n*285 who work like this:

/Teleport [ID]

and teleport the choosen id to this location:
Quote:

-88.0029, 1222.8109, 19.7422




Re: Teleport ? - Mike_Peterson - 28.12.2011

Well,use strtok or sscanf(easier), make an if() statement to check if the playerid has skinid 285..
if so, teleport the ID to -88.0029, 1222.8109, 19.7422 .. You said you wanted to know how to do it, i'm not going to give u snippets


Re: Teleport ? - Gooday - 28.12.2011

well: Can you please post a example? I can give u rep!


Re: Teleport ? - Leo_Johnson - 28.12.2011

You mean /goto or /gethere? or...


Re: Teleport ? - Mike_Peterson - 28.12.2011

Listen, i'm oldskool, so i'm still using dcmd but heres an example
pawn Код:
dcmd_teleport(playerid,params[])
{
new id;
if (sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_RED, "[System] Usage: /teleport [ID]");
if(GetPlayerSkin(playerid) != 285) return 0;
SetPlayerPos(id,-88.0029, 1222.8109, 19.7422);
return 1;
}
edit: coded this in 30 seconds, so i'm not sure if it works.. compiled without errors though..
Make sure you have dcmd & sscanf.. or else edit it to whatever you want
Heres a line for dcmd, you put it at your defines
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1