Question - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Question (
/showthread.php?tid=182873)
Question -
zack3021 - 13.10.2010
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.
Re: Question -
Georgelopez1 - 13.10.2010
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;
}
Re: Question -
bigcomfycouch - 13.10.2010
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.");
}
Re: Question -
Georgelopez1 - 13.10.2010
Same as what i said...
Re: Question -
zack3021 - 13.10.2010
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.
Re: Question -
Las Venturas CNR - 13.10.2010
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.
Re: Question -
Georgelopez1 - 13.10.2010
The colors were the same......