27.06.2011, 11:39
Hey all. I made a /report command.
But the message: Your report was send to the admins is sended to times to me. It's anoying.
But the message: Your report was send to the admins is sended to times to me. It's anoying.
pawn Код:
COMMAND:report(playerid,params[])
{
new text[80];
if(sscanf(params,"s[80]",text)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /report [text]");
for(new admins;admins < MAX_PLAYERS; admins++)
{
if(PlayerInfo[admins][pAdminLevel] >=1)
{
GetPlayerName(playerid,Name,sizeof(Name));
format(String,sizeof(String),"Report from %s[%d]: {FFFFFF}%s.",Name,GetPlayerIdFromName(Name),text,GetPlayerIdFromName(Name));
SendClientMessage(admins,COLOR_ORANGE,String);
format(String,sizeof(String),"Use /respond %d to help him/her.",GetPlayerIdFromName(Name));
SendClientMessage(admins,COLOR_GREY,String);
format(String,sizeof(String),"Report to the admins: {FFFFFF}%s",text);
SendClientMessage(playerid,COLOR_ORANGE,String);
SendClientMessage(playerid,COLOR_WHITE,"Your Report Message was sent to all available admins. They will respond shortly.");
PlayerInfo[playerid][pReported] = 1;
}
}
return 1;
}