SA-MP Forums Archive
Making /goto player command in Ysi/y_ini - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Making /goto player command in Ysi/y_ini (/showthread.php?tid=611308)



Making /goto player command in Ysi/y_ini - alekschowee - 04.07.2016

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


Re: Making /goto player command in Ysi/y_ini - Misiur - 04.07.2016

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?


Re: Making /goto player command in Ysi/y_ini - Quinncell - 05.07.2016

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;
}



Re: Making /goto player command in Ysi/y_ini - iKarim - 05.07.2016

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;