[HELP] Custom teleport command
#1

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?
Reply
#2

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. ^^
Reply
#3

Thanks man, it works perfect
Reply
#4

Great. Thanks for the feedback.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)