22.12.2011, 15:00
Making admin commands with sscanf, the commands won't work for ID 0, it just does the action for yourself (like, /kick 5 and it kicks you instead of ID 5)
my code, the problem shouldn't be in it because copypasting other peoples goto commands won't work either.
my code, the problem shouldn't be in it because copypasting other peoples goto commands won't work either.
Код:
command(goto, playerid, params[]) { new tPlayer; if(!sscanf(params, "u", tPlayer)) { new Float:X, Float:Y, Float:Z, string[128]; SetPlayerInterior(playerid, GetPlayerInterior(tPlayer)); GetPlayerPos(tPlayer, X, Y, Z); SetPlayerPos(playerid, X, Y, Z + 5); format(string, sizeof(string), ""GREEN"Successfully teleported to "YELLOW"'%s'"GREEN".", GetName(tPlayer)); SendClientMessage(playerid, -1, string); SendClientMessage(tPlayer, -1, ""RED"An admin has teleported to you."); } else return SendClientMessage(playerid, -1, ""RED"Usage: /goto <player>"); return 1; }