30.12.2012, 20:02
This command I currently have working. However, a lot of coordinates use a decimal place, if not all of them.
The command only works without the decimal place, which isn't much of a problem since it still spawns in pretty much the exact location. However, I don't like things that don't work 100% so if anybody can help me with this, that would be great.
Anybody is welcome to use this code, it's VERY useful.
The command only works without the decimal place, which isn't much of a problem since it still spawns in pretty much the exact location. However, I don't like things that don't work 100% so if anybody can help me with this, that would be great.
Код:
CMD:tp(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 99998) { SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command."); return 1; } new string[128], giveplayerid, X, Y, Z; if(sscanf(params, "uiii", giveplayerid, X, Y, Z)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tp [playerid] [X] [Y] [Z]"); if(IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "Administrator %s has teleported you.", GetPlayerNameEx(playerid)); SendClientMessageEx(giveplayerid, COLOR_WHITE, string); format(string, sizeof(string), "You have teleported %s.", GetPlayerNameEx(giveplayerid)); SendClientMessageEx(playerid, COLOR_WHITE, string); SendClientMessageEx(giveplayerid, COLOR_GRAD1, " You have been teleported!"); SetPlayerPos(giveplayerid, X, Y, Z); } return 1; }