06.10.2011, 18:28
Quote:
This code: ( example )
pawn Код:
pawn Код:
|
I was trying to script an /a CMD for admin chat that when you excute it , it sends the text to all online admins , only admins .
This is what i got so far , not sure if this works but let's give it a shot .
pawn Код:
CMD:a(playerid, o[])
{
new aname[MAX_PLAYER_NAME],string[128];
if(PlayerInfo[playerid][pAdmin]<1) return SendClientMessage(playerid, -1, "You are not authorized to use this command!");
if(isnull(o)) return SendClientMessage(playerid, -1, "Usage: /a(dmin) [text]");
else
{
GetPlayerName(playerid, aname, sizeof(aname));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin]>=1)
{
format(string, sizeof(string),"Admin %s: %s", aname, o);
SendClientMessage(PlayerInfo[i][pAdmin]>=1, -1, string);
SendClientMessage(playerid, -1, string);
}
}
}
}
return 1;
}