Question
#1

I don't remember how to do it, but i saw somewhere on a script when a player types two different commands, they get the same thing.

Example:
I type /cmds.
Then i see "The server commands are /kill and /tele"
And another player types /commands
Then they see "The server commands are /kill and /tele"

That is showing even if i type /cmds or /commands i see the same thing. Please remind me how to do it.
Reply
#2

Just edit the "color" to a specific color id ( 0xFFFF00AA )
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/commands", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, color,"Commands text here");
		return 1;
	}
	if (strcmp("/cmds", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, color,"Commands text here");
		return 1;
	}
	return 0;
}
Reply
#3

ZCMD:
pawn Код:
cmd(commands, playerid, params[])
{
    return SendClientMessage(playerid, 0xFF000000, "The server commands are /kill and /tele.");
}

cmd(cmds, playerid, params[]) return cmd_commands(playerid, params);
or

OnPlayerCommandText:
pawn Код:
if (!strcmp(cmdtext, "/commands", true) || !strcmp(cmdtext, "/cmds", true))
{
    return SendClientMessage(playerid, 0xFF000000, "The server commands are /kill and /tele.");
}
Reply
#4

Same as what i said...
Reply
#5

Quote:
Originally Posted by bigcomfycouch
Посмотреть сообщение
ZCMD:
pawn Код:
cmd(commands, playerid, params[])
{
    return SendClientMessage(playerid, 0xFF000000, "The server commands are /kill and /tele.");
}

cmd(cmds, playerid, params[]) return cmd_commands(playerid, params);
or

OnPlayerCommandText:
pawn Код:
if (!strcmp(cmdtext, "/commands", true) || !strcmp(cmdtext, "/cmds", true))
{
    return SendClientMessage(playerid, 0xFF000000, "The server commands are /kill and /tele.");
}
Thanks, this is what i mean but with zcmd, and Georgelopez1 you did not read properly, i did not want to change the color with different cmds.
Reply
#6

Quote:
Originally Posted by Georgelopez1
Посмотреть сообщение
Just edit the "color" to a specific color id ( 0xFFFF00AA )
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/commands", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, color,"Commands text here");
		return 1;
	}
	if (strcmp("/cmds", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, color,"Commands text here");
		return 1;
	}
	return 0;
}
You can do that, or add:


pawn Код:
if(strcmp(cmd, "/commands", true) == 0 || strcmp(cmd, "/cmds", true) == 0)
{
SendClientMessage(playerid, COLOR_HERE, "The server commands are /kill and /tele");
// Other SendClientMessage things + other functions here.
}
return 1;
}
Pretty much same thing from comfycouch, but my codes sorta different where the CMD's are defined.
Reply
#7

The colors were the same......
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)