04.07.2016, 21:16
Hi, how to make goto player command ini Ysi/y_ini
CMD:goto(playerid, params[]) { new id, Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME],msg[128]; if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_YELLOW, "[COMMAND]{FFFFFF} Usage:{FFFF00} /goto [playerid]"); else if(pInfo[playerid][Adminlevel] <= 2) return SendClientMessage(playerid, COLOR_RED,"[ERROR]{FFFFFF} You have entered an unknown command, please view {FFFF00}/cmds{FFFFFF} or{FFFF00} /commands{FFFFFF} and try again."); else if(pInfo[playerid][Adminlevel] == 0) return SendClientMessage(playerid, COLOR_RED,"[ERROR]{FFFFFF} You have entered an unknown command, please view {FFFF00}/cmds{FFFFFF} or{FFFF00} /commands{FFFFFF} and try again."); else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "[SERVER]{FFFFFF} That player is not connected."); else if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "[ERROR]{FFFFFF} You cannot teleport to yourself!"); else { GetPlayerPos(id,x,y,z); SetPlayerPos(playerid, x+1, y+1,z); GetPlayerName(id,name,sizeof(name)); format(msg,sizeof(msg),"You have teleported to {FFFF00}%s(%d){FFFFFF}.",name,id); SendClientMessage(playerid, COLOR_LIGHTGREEN,msg); } return 1; }
CMD:goto(playerid, params[])
{
new id;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: goto [playerid]");
else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "USAGE: goto [playerid]");
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(id, x, y, z);
SetPlayerPos(id, x, y, z);
}
return true;
}