19.08.2013, 14:20
Can any one tell me code to make goto cordinate commands..
new cmd[50];
cmd = strtok(cmdtext, idx);
if(!strcmp(cmd, "/Teleport", true))
{
new tmp[128], tmp2[128];
cmd = strtok(cmdtext, idx);
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext, idx);
if(!strlen(cmd) || !strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, 0x808080FF, "/Teleport [x] [y] [z]");
new Float:x = Floatstr(cmd), Float:y = Floatstr(tmp), Float:z = Floatsr(tmp2));
SetPlayerPos(playerid, x, y, z);
return SendClientMessage(playerid, 0xFFFFFFFF, "You have been teleported succesfully.");
}
CMD:gotocoord(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new Float: pos[3], int;
if(sscanf(params, "fffd", pos[0], pos[1], pos[2], int)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gotocoord [x coordinate] [y coordinate] [z coordinate] [interior]");
SendClientMessageEx(playerid, COLOR_GRAD2, "You have been teleported to the coordinates specified.");
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetPlayerInterior(playerid, int);
}
return 1;
}