06.08.2011, 07:34
You can use this one:
PHP код:
if(strcmp(cmd, "/gotopos", true) == 0)
{
tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /gotopos [InteriorId] [x] [y] [z]");
return 1;
}
new int_id;
int_id = strval(tmp);
tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /gotopos [InteriorId] [x] [y] [z]");
return 1;
}
new Float:int_x;
int_x = floatstr(tmp);
tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /gotopos [InteriorId] [x] [y] [z]");
return 1;
}
new Float:int_y;
int_y = floatstr(tmp);
tmp = strtok(cmdtext,idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /gotopos [InteriorId] [x] [y] [z]");
return 1;
}
new Float:int_z;
int_z = floatstr(tmp);
format(string, sizeof(string), "You have been teleported to pos: %d, x=%1.5f, y%=1.5f, z=%1.5f", int_id, int_x, int_y, int_z);
SendClientMessage(playerid, COLOR_YELLOW, string);
SetPlayerPos(playerid, int_x, int_y, int_z);
SetPlayerInterior(playerid, int_id);
return 1;
}