11.07.2014, 21:15
pawn Код:
CMD:a(playerid,params[])
{
new string[128], chat[128];
if(PlayerInfo[playerid][pAdminLevel] <= 1) return SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use this command!");
if(sscanf(params, "s[128]", chat)) return SendClientMessage(playerid,COLOR_GREY,"SYNTAX: /a(dmin) [message]");
format(string,sizeof(string),"%s: %d",GetName(playerid), chat);
SendToAdmins(COLOR_RED, string);
return 1;
}
pawn Код:
stock SendToAdmins(COLOR,message[])//here we set params for this stock, [] means string/message
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( PlayerInfo[i][pAdminLevel] >= 1 )
{
SendClientMessage( i,COLOR,message );
}
}
return 1; //for everyone else return 0;
}