how to send admin messege
#1

i know there is sendclientmessege but it's for all players how to send it to admins only ?
Reply
#2

Код:
stock SendAdminMessage(color,text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i,color,text);
}
}
return 1;
}
Reply
#3

no i mean i have this in my script

Код:
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;
}
send admin message is eroorr so there is another type ? if idid sendclientmessege it's succes but i wanna this for admin
Reply
#4

pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)