17.12.2013, 20:24
Hello!
When I type /goto [ID] or /get[ID] I always got [ERROR]Player not connected but in reality he is.Both commands have same issue.
CMD:goto
CMD:get
Please someone fix it.THanks!
When I type /goto [ID] or /get[ID] I always got [ERROR]Player not connected but in reality he is.Both commands have same issue.
CMD:goto
Код:
CMD:goto(playerid, params[]) { if(pInfo[playerid][Adminlevel] == 0)return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command."); new targetid; if(sscanf(params,"d",targetid))return SendClientMessage(playerid, COLOR_YELLOW, "Usage:{FFFFFF} /goto [ID]"); if(IsPlayerConnected(targetid))return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF} Player not connected"); if(pInfo[targetid][USER_LOGGED_IN] == 0)return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF} Player has not logged in"); new Float:x, Float:y, Float:z, interior = GetPlayerInterior(targetid), vworld = GetPlayerVirtualWorld(targetid); GetPlayerPos(targetid, x, y, z); SetPlayerInterior(playerid, interior); SetPlayerVirtualWorld(playerid, vworld); SetPlayerPos(playerid, x +1, y +1, z); SendClientMessage(playerid, COLOR_ADMIN, "You have been teleported successfully!"); return 1; }
Код:
CMD:get(playerid, params[]) { if(pInfo[playerid][Adminlevel] < 2)return SendClientMessage(playerid,COLOR_RED,"[ERROR]{FFFFFF} You don't have an appropriate administration level to use this command."); new pName[MAX_PLAYER_NAME]; new string[128], targetid; if(sscanf(params,"d",targetid)) { SendClientMessage(playerid, COLOR_YELLOW, "Usage:{FFFFFF} /get [ID]"); return 1; } if(IsPlayerConnected(targetid)) { SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF} Player not connected"); return 1; } if(pInfo[targetid][USER_LOGGED_IN] == false) { SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF} Player has not logged in"); return 1; } if(pInfo[playerid][Adminlevel] >= 2 || IsPlayerAdmin(playerid)) { new Float:x,Float:y,Float:z, interior = GetPlayerInterior(playerid), vworld = GetPlayerVirtualWorld(playerid); GetPlayerPos(playerid, x,y,z); SetPlayerInterior(targetid, interior); SetPlayerVirtualWorld(targetid, vworld); SetPlayerPos(targetid, x+1, y+1, z); GetPlayerName(targetid, pName, sizeof(pName)); format(string, sizeof(string), "[ADMIN]{FFFFFF} %s has been successfully teleported!", pName); SendClientMessage(playerid, COLOR_ADMIN, string); } return 1; }