[Help] /goto and /nogoto
#6

Код:
CMD:goto (playerid, params[])
{
	new
		Float:x,
		Float:y,
		Float:z
	;
	new id, string[128];
	if (sscanf(params,"u",id)) return SendClientMessage (playerid,0x6FFF00FF,"{F07F1D}USAGE: {BBFF00}/goto <ID>");
	if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"{FA002E}ERROR: {C7BDBF}Invalid player ID!");
	if ( PlayerInfo[playerid][inDM] == 1) return SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"You cannot use this command here! Please type /leave to exit!" );
	if (PlayerInfo[id][Goto] == 1)
	{
		format(string, sizeof(string), "{FA002E}ERROR: {C7BDBF}%s(%d) has teleport disabled!", GetName(id), id);
		SendClientMessage( playerid, -1, string );
		return 1;
	}
	else
	format(string,sizeof(string),"{D9F238}You have teleported to {%06x}%s(%d){D9F238}!", (GetPlayerColor(id) >>> 8), GetName(id), id );
	GetPlayerPos(id,x,y,z);
	if (IsPlayerInAnyVehicle(playerid))
	{
        SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z + 1.0);
		SendClientMessage(playerid, -1, string);
	}
	else
	{
		SetPlayerPos(playerid, x, y, z + 1.0);
		SendClientMessage(playerid,-1,string);
	}
	return 1;
}

CMD:enablegoto (playerid) return cmd_allowgoto (playerid);
CMD:allowgoto (playerid)
{
	if (PlayerInfo[playerid][Goto] == 0) return SendClientMessage( playerid, -1, "{FA002E}ERROR: {C7BDBF}You already have your teleport enabled!");
	else
	PlayerInfo[playerid][Goto] = 0;
	SendClientMessage( playerid, -1, ""ORANGE"- Teleport - "GREEN"You have enabled your teleport!" );
	return 1;
}

CMD:disablegoto (playerid) return cmd_disallowgoto (playerid);
CMD:disallowgoto (playerid)
{
	if (PlayerInfo[playerid][Goto] == 1) return SendClientMessage( playerid, -1, "{FA002E}ERROR: {C7BDBF}You already have your teleport disabled!");
	else
	PlayerInfo[playerid][Goto] = 1;
	SendClientMessage( playerid, -1, ""ORANGE"- Teleport - "RED"You have disabled your teleport!" );
	return 1;
}
Reply


Messages In This Thread
[Help] /goto and /nogoto - by goldenpower - 04.08.2014, 06:31
Re: [Help] /goto and /nogoto - by GShock - 04.08.2014, 06:36
Re: [Help] /goto and /nogoto - by Stinged - 04.08.2014, 08:23
Re: [Help] /goto and /nogoto - by goldenpower - 04.08.2014, 09:06
Re: [Help] /goto and /nogoto - by Stinged - 04.08.2014, 10:29
Re: [Help] /goto and /nogoto - by SpikY_ - 04.08.2014, 11:31
Re: [Help] /goto and /nogoto - by goldenpower - 04.08.2014, 12:51
Re: [Help] /goto and /nogoto - by SpikY_ - 04.08.2014, 12:58
Re: [Help] /goto and /nogoto - by Stinged - 04.08.2014, 13:29
Re: [Help] /goto and /nogoto - by goldenpower - 04.08.2014, 14:02

Forum Jump:


Users browsing this thread: 2 Guest(s)