22.12.2010, 14:26
Hi,i've this admin chat cmd:
I have admin variables but all players can use it.Why?
pawn Код:
dcmd_a(playerid, params[])
{
new ChatMessage[256],name[24];
if(sscanf(params, "s", ChatMessage)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /a [message]");
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
new string[256];
format(string,sizeof(string),"AdmChat %s [%d]: %s",name,playerid,ChatMessage);
IRC_GroupSay(gGroupID, IRC_ADMINCHANNEL, string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][AdminLevel] >= 2)
{
SendClientMessage(i, COLOR_GOLD, string);
AdminCLog(string);
PlayerPlaySound(i, 1137, 0.0, 0.0, 0.0);
}
}
return 1;
}