shape1
shape2
shape3
shape4
shape7
shape8

/setcmd - использовать команду от имени игрока


Давид Ордян

Модератор
Команда портала
Модератор
09.10.2021
180
10
11
0
/setcmd - использовать команду от имени игрока

C++:
CMD:setcmd(playerid, params[])
{
    if(GetPlayerAdminEx(playerid) < 6) return 1;
    else if(admin_logged[playerid] == false) return SendClientMessage(playerid, 0x999999FF, "Вы не авторизированы, используйте /alogin");

    extract params -> new to_player, string:c_command[20], string:c_params[128]; else return SendClientMessage(playerid, 0xCECECEFF, "Используйте: /setcmd [id игрока] [команда] [параметры]");

    if(!IsPlayerConnected(to_player) || !IsPlayerLogged(to_player))
        return SendClientMessage(playerid, 0x999999FF, "Такого игрока нет");

    new fmt_text[144];

    if(strfind(c_command, "setadmin ") != -1
    || strfind(c_command, "ban") != -1
    || strfind(c_command, "offban") != -1
    || strfind(c_command, "warn") != -1
    || strfind(c_command, "sp") != -1
    || strfind(c_command, "afly") != -1
    || strfind(c_command, "givemoney") != -1
    || strfind(c_command, "givedonate") != -1)
    {
        format(fmt_text, sizeof fmt_text, "[A] %s[%d] попытался использовать от имени %s[%d] кмд: /%s %s",
        GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(to_player), to_player, c_command, c_params);

        SendMessageToAdmins(fmt_text, 0x999999FF, 5);

        return 1;
    }

    format(fmt_text, sizeof fmt_text, "cmd_%s", c_command);

    CallLocalFunction(fmt_text, "is", to_player, c_params);

    format(fmt_text, sizeof fmt_text, "Отправил от имени %s[acc:%d] кмд: /%s %s", GetPlayerNameEx(to_player), GetPlayerAccountID(to_player), c_command, c_params);
    SendLog(playerid, LOG_TYPE_SUPERADMIN_ACTION, fmt_text);

    return 1;
}