Commands - 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: Commands (
/showthread.php?tid=275195)
Commands -
Alex_Obando - 08.08.2011
Hello,
How I can do this:
When the player types any command send a message to all with the command,
Like this:
Alex_Obando just typed /hello
Re: Commands -
Unknown_Killer - 08.08.2011
hey alex first
@ OnPlayerCommandText do
like
pawn Код:
if(Isadmin > 3)
{
format(string, sizeof(string), "player %s (%d) have typed Command: %s", pName(playerid),playerid,cmdtext);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SendClientMessage(i, COLOR_WHITE, string);
}
}
Re: Commands -
UnknownKilla2 - 08.08.2011
hey alex haha.. UnknownKiller is a good helper eh ?..good luck with ur thingy
Respuesta: Commands -
Alex_Obando - 08.08.2011
Hey thanks UK :P
Hows your server anyways?
Re: Commands -
HyperZ - 08.08.2011
OnPlayerCommandText:
pawn Код:
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(str, sizeof(str), "%s (%d) just typed: %s", pName,playerid,cmdtext);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SendClientMessage(i, -1, str);
}
}
Re: Respuesta: Commands -
UnknownKilla2 - 08.08.2011
Quote:
Originally Posted by Alex_Obando
Hey thanks UK :P
Hows your server anyways?
|
Its pretty cool alex visit us you are welcome anytime
Re: Respuesta: Commands -
Jay. - 08.08.2011
Quote:
Originally Posted by UnknownKilla2
Its pretty cool alex visit us you are welcome anytime ![Smiley](images/smilies/smile.png)
|
Try and stay on topic.
If you want to talk do it in pm , or some messager.
Here isn't the place.
Respuesta: Re: Commands -
Alex_Obando - 08.08.2011
Quote:
Originally Posted by Russell_
OnPlayerCommandText:
pawn Код:
new str[128], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, MAX_PLAYER_NAME); format(str, sizeof(str), "%s (%d) just typed: %s", pName,playerid,cmdtext); for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SendClientMessage(i, -1, str); } }
|
Gave you +1 Reputation.
Btw, How do I do like a variable like this:
/messageson
You will now be able to see the commands that the players type.
/messagesoff
You wont be longer able to see the commands.
Re: Commands -
iPLEOMAX - 08.08.2011
pawn Код:
//On top of script:
new bool:EnabledCmds[MAX_PLAYERS];
//Already given, just modify little:
new str[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(str, sizeof(str), "%s (%d) just typed: %s", pName,playerid,cmdtext);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && EnabledCmds[i])
{
SendClientMessage(i, -1, str);
}
}
//In your /message command: (Single command to turn on-off)
if(!EnabledCmds[playerid])
{ EnabledCmds[playerid] = true; SendClientMessage(playerid, 0x00FF00FF, "Enabled..."); }
else
{ EnabledCmds[playerid] = false; SendClientMessage(playerid, 0xFF0000FF, "Disabled..."); }
Re: Commands -
Unknown_Killer - 08.08.2011
^
|
|
|
|
|
Respuesta: Commands -
Alex_Obando - 08.08.2011
Thank you very much, iPLEOMAX see pm.
+1 reputation.