Making /goto player command in Ysi/y_ini
#1

Hi, how to make goto player command ini Ysi/y_ini
Reply
#2

Sorry mate, but that sentence wasn't a real sentence. You have to describe what exactly do you want. Do you want player to be able to go to positions defined in an ini file?
Reply
#3

Here, next time use "search"

Код:
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;
}
Reply
#4

PHP код:
CMD:goto(playeridparams[])
{
    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:xFloat:yFloat:z;
        
GetPlayerPos(idxyz);
        
SetPlayerPos(idxyz);
    }
    return 
true;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)