24.02.2013, 13:55
i know there is sendclientmessege but it's for all players how to send it to admins only ?
stock SendAdminMessage(color,text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i,color,text);
}
}
return 1;
}
CMD:reportbug(playerid, params[])
{
if(sscanf(params, "s[128]", params))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reportbug [text]");
if(strlen(params) > 12)
return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
new File: file = fopen("bugs.cfg", io_append), string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof(string), "[%s] %s\r\n", pName, params);
fwrite(file, string);
fclose(file);
SendClientMessage(playerid, COLOR_ORANGE, "Your bug report has been saved, scripters will check it once possible.");
format(string, sizeof(string), "AdmWarn: %s has reported a bug, /bugs to view it. (Inform Zaiat about it ASAP)", pName);
SendadminMessage(COLOR_DARKRED, 1, string);
return 1;
}
CMD:reportbug(playerid, params[])
{
if(sscanf(params, "s[128]", params))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reportbug [text]");
if(strlen(params) > 12)
return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
new File: file = fopen("bugs.cfg", io_append), string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof(string), "[%s] %s\r\n", pName, params);
fwrite(file, string);
fclose(file);
SendClientMessage(playerid, COLOR_ORANGE, "Your bug report has been saved, scripters will check it once possible.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
format(string, sizeof(string), "AdmWarn: %s has reported a bug, /bugs to view it. (Inform Zaiat about it ASAP)", pName);
SendClientMessage(i, COLOR_DARKRED, string);
}
return 1;
}