new AllowChat[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/disablechat", cmdtext, true) == 0)
{
if(AllowChat[playerid] == 1)
{
AllowChat[playerid]=0;
}
else
{
AllowChat[playerid]=1;
}
if(!IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has used /disablechat command.", name);
SendCommandMessageToAdmins(0xDEEE20FF, string);
}
return 1;
}
return 0;
}
stock SendMessageToAdmins(text[]) { for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) SendClientMessage(i,blue,text); return 1; }
SendMessageToAdmins
SendCommandMessageToAdmins
new AllowChat[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/disablechat", cmdtext, true) == 0)
{
if(AllowChat[playerid] == 1)
{
AllowChat[playerid]=0;
}
else
{
AllowChat[playerid]=1;
}
if(!IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has used /disablechat command.", name);
SendMessageToAdmins(string);
}
return 1;
}
return 0;
}
stock SendCommandMessageToAdmins(playerid,command[]) { if(!Config[DisplayCommandMessage]) return 1; new string[256],name[24]; GetPlayerName(playerid,name,24); format(string,256,"%s has used the command \'/%s\'.",name,command); return SendMessageToAdmins(string); }
new AllowChat[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/disablechat", cmdtext, true) == 0)
{
if(AllowChat[playerid] == 1)
{
AllowChat[playerid]=0;
}
else
{
AllowChat[playerid]=1;
}
if(!IsPlayerAdmin(playerid))
{
SendCommandMessageToAdmins(playerid, "DISABLECHAT");
}
return 1;
}
return 0;
}
|
I am using ZCMD can u make it more easy please with showing me in a Filter Script in pastebin so i can easily make
it this is the one thing i don't understand in admin system |
if(!IsPlayerAdmin(playerid))
{
new name[MAX_PLAYER_NAME+1], string[24+MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s has used /disablechat command.", name);
SendMessageToAdmins(string);
}