Posts: 186
Threads: 62
Joined: Jul 2009
Reputation:
0
can someone give me a code which makes an admin command; /coor <your coordinates>
i mean this command does for example: you type /coor 218.35,345.32,32.53.
i want this command to teleport you to any coordinates you want.
it is possible?
Posts: 6,129
Threads: 36
Joined: Jan 2009
pawn Код:
if(strcmp(cmd, "/goto", true) == 0)
{
tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "SYNTAX - /goto [interior] [x] [y] [z]");
return 1;
}
new int_id;
int_id = strval(tmp);
tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "SYNTAX - /goto [interior] [x] [y] [z]");
return 1;
}
new Float:int_x;
int_x = floatstr(tmp);
tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "SYNTAX - /goto [interior] [x] [y] [z]");
return 1;
}
new Float:int_y;
int_y = floatstr(tmp);
tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "SYNTAX - /goto [interior] [x] [y] [z]");
return 1;
}
new Float:int_z;
int_z = floatstr(tmp);
SetPlayerPos(playerid, int_x, int_y, int_z);
SetPlayerInterior(playerid, int_id);
return 1;
}
That should work.