08.08.2011, 19:37
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..."); }