[HELP] Two commands
#1

How to make two commands but same function (no command system)
exp.
/goto
Goto to player id
/tele
Run /goto

And how to make commands in command xD
exp.
/tele
LS
LV
SF
Reply
#2

This is quite handy to you.

LINK

If you still don't understand something just ask back .
Reply
#3

here you go try this
Quote:

CMD:goto(playerid,params[])
{
new ID;
new Float:X;
new Float:Y;
new Float:Z;
new Float:A;
if(sscanf(params,"i", ID)) return SendClientMessage(playerid,-1,"{FF0000}AdmUsage: {15FF00}/Goto [PlayerID]");
GetPlayerPos(ID, X,Y,Z);
GetPlayerFacingAngle(ID, A);
SetPlayerPos(playerid, X,Y,Z);
SetPlayerFacingAngle(playerid, A);
SendClientMessage(playerid, -1, "{FF0000}Cmd: {15FF00}You teleported to specified player !");
return 1;
}

Reply
#4

Here is a /tele command.

with the explaination,

Hope it's clear.

Код:
CMD:tele(playerid, params[])
{
	if(isnull(params)) // IF you didn't type any parameter... then It'll show you the option.
	{ //then
		SendClientMessage(playerid, -1, "* Usage: /tele [input]"); //send this message
		SendClientMessage(playerid, -1, " *** LS,SF,LV"); // Locations you can TP to
		return 1;
	}

	if(strcmp(params,"ls",true) == 0) //if player types the parameter "ls"
	{ //then
		SetPlayerPos(playerid, 0, 0, 0); // sets the player's position to this coordinates.
	}
	else if (strcmp(params,"sf",true) == 0) //else if player types the params "sf"
	{ //then
		SetPlayerPos(playerid, 0, 0, 0); // sets the player's position to this coordinates.
	}
	else if (strcmp(params,"lv",true) == 0) //else if player types the params "lv"
	{ //then
		SetPlayerPos(playerid, 0, 0, 0);// sets the player's position to this coordinates.
	}
	return 1; // returns as true
}
Reply
#5

it's not ZCMD, there no have cmd procesor.
and no one help me
Reply
#6

Quote:
Originally Posted by Zekiloni
Посмотреть сообщение
it's not ZCMD, there no have cmd procesor.
and no one help me
Ok there is the explantion for the /goto command.

Код:
CMD:goto(playerid,params[])
{
	new ID, //
		Float:X,
		Float:Y,
		Float:Z,
		Float:A;
	if(sscanf(params,"i", ID)) return SendClientMessage(playerid,-1,"* Usage: /goto [player]"); // Refer to my previous explaination.
	GetPlayerPos(ID, X,Y,Z); // Getting position of the player you want to TP to.
	GetPlayerFacingAngle(ID, A); // Getting his facing angle.
	SetPlayerPos(playerid, X,Y+5,Z); // Setting your position , playerid refers to you & ID refers to the player you're wanting to TP to.
	SetPlayerFacingAngle(playerid, A); // setting your facing angle
	SendClientMessage(playerid, -1, " You have successfully been teleported.");
	return 1;
}
Reply
#7

i don't need goto/teleport commands, it's example, read the again
Reply
#8

Quote:
Originally Posted by Zekiloni
Посмотреть сообщение
i don't need goto/teleport commands, it's example, read the again
Isn't that an example I gave you..?
I explained aswell.
What else do you need, please be specific.!
Reply
#9

sorry but you asking people help but don't explain clearly your question, so how we can help you ?
Create commands but don't want commands system ? OnPlayerCommandText or what ?
Reply
#10

It's obvious that this guy is using strcmp. Here is an example of how to make multiple commands, executed doing the same function:

pawn Код:
if(!strcmp(cmdtext[4],"goto",true) || !strcmp(cmdtext[4],"tele",true))
But still it's better to use some faster commands processor like ZCMD.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)