[HELP] Custom teleport command - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Custom teleport command (
/showthread.php?tid=184154)
[HELP] Custom teleport command -
Pooh7 - 18.10.2010
I want to make command to teleport on custom coordinates. I have some teleport commands in my gamemode, but I want to type coordinates in game and get there. For example: /port [X] [Y] [Z].
How to make it?
Re: [HELP] Custom teleport command -
Jeffry - 18.10.2010
Try:
pawn Код:
if(!strcmp(cmdtext, "/port"))
{
new tmp[256], tmp2[256], tmp3[256], idx;
tmp=strtok(cmdtext, idx); tmp2=strtok(cmdtext, idx); tmp3=strtok(cmdtext, idx);
new Float:x, Float:y, Float:z;
x=floatstr(tmp); y=floatstr(tmp2); z=floatstr(tmp3);
SetPlayerPos(playerid, x,y,z);
return 1;
}
I just typed this fast, dunno if it works. ^^
Re: [HELP] Custom teleport command -
Pooh7 - 18.10.2010
Thanks man, it works perfect
Re: [HELP] Custom teleport command -
Jeffry - 18.10.2010
Great. Thanks for the feedback.