if(strcmp(cmd, "/askadmin", true) == 0 || strcmp(cmd, "/ahelp", true) == 0)
{
if(!strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use /ahelp [message]");
new str[128];
if((gettime()-LastReport[playerid]) < 30)
{
format(str, 128, "You have to wait %d seconds before you can send a new help message!", (30-(gettime()-LastReport[playerid])));
SendClientMessage(playerid, 0xFF0000AA, str); return 1;
}
format(str, 128, "[ASKADMIN] Sender ID: %d. Message: %s", playerid, cmdtext[8]);
for(new i; i<MAX_PLAYERS; i++){
AdministratorMessage(COLOR_ADMINCMD, string,1);
SendClientMessage(i, 0x00FFFFAA, str);
}
SendClientMessage(playerid, 0x00FF00AA, "Help send to online admins!");
LastReport[playerid] = gettime();
return 1;
}
Remove your loop, as you already have a function to send the message to all admins (AdministratorMessage?).
Also in case you care about the grammar in your messages: "Help send to online admins!" --> sent* Edit: Oh yea, also remove the SendClientMessage that is below the AdministratorMessage. |
Remove your loop, as you already have a function to send the message to all admins (AdministratorMessage?).
Also in case you care about the grammar in your messages: "Help send to online admins!" --> sent* Edit: Oh yea, also remove the SendClientMessage that is below the AdministratorMessage. |
if(strcmp(cmd, "/askadmin", true) == 0 || strcmp(cmd, "/ahelp", true) == 0)
{
if(!strlen(cmdtext[8])) return SendClientMessage(playerid, 0xFF0000AA, "Use /ahelp [message]");
new str[128];
if((gettime()-LastReport[playerid]) < 30)
{
format(str, 128, "You have to wait %d seconds before you can send a new help message!", (30-(gettime()-LastReport[playerid])));
SendClientMessage(playerid, 0xFF0000AA, str); return 1;
}
format(str, 128, "[ASKADMIN] Sender ID: %d. Message: %s", playerid, cmdtext[8]);
AdministratorMessage(COLOR_ADMINCMD, string,1);
}
SendClientMessage(playerid, 0x00FF00AA, "Help send to online admins!");
LastReport[playerid] = gettime();
return 1;
}