28.12.2011, 10:08
Try this:
pawn Код:
CMD:a(playerid,params[])
{
new text[200],pname[32],string[128];
if(sscanf(params,"s",text)) return SendClientMessage(playerid,0xFF0000FF,"USAGE: /a {question or bug report to admins}");
for(new i=0,i<MAX_PLAYERS;i++)
{
if(!APlayerData[i][PlayerLevel] >= 1) return SendClientMessage(playerid,0xFF0000FF,"No admins currently online");
GetPlayerName(playerid,pname,32);
format(string,128,"{00B2FF}%s needs help :{00FF00} %s",pname,text);
if(APlayerData[i][PlayerLevel] >= 1) return SendClientMessage(i,0xFF0000FF,string);
format(string,128,"{00B2FF}Message sent to admins: {00FF00}%s",text);
SendClientMessage(playerid,0xFFFFFFFF,string);
}
return 1;
}
CMD:b(playerid,params[])
{
SendAdminText(playerid, "/b", params);
new text[200],pname[32],string[128],op;
if(APlayerData[playerid][PlayerLevel] = 0) return SendClientMessage(playerid,0xff0000ff,"You aren't an admin");
if(sscanf(params,"us",op,text)) return SendClientMessage(playerid,0xFF0000,"USAGE:/b {player} {answer}");
GetPlayerName(playerid,pname,32);
format(string,sizeof(string),"{00B2FF}Answer of Admin %s : {00FF00}%s",pname,text);
SendClientMessage(op,0xffffffff,string);
GetPlayerName(op,pname,32);
format(string,128,"{00B2FF}Answer send to %s : {00FF00}%s",pname,text);
SendClientMessage(playerid,0xffffffff,string);
return 1;
}