Jump to content
  • 0

Admin Chat


marin1223

Question

Am incercat sa fac un admin chat dar nu merge...

CMD:adminchat(playerid, params[])
{
    new mesaj[128], string[128];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ERROR, "Nu esti admin.");
    if(sscanf(params, "s[128]", mesaj)) return SendClientMessage(playerid, COLOR_SYN, "Foloseste: /adminchat <mesaj>");
    {
        if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdmin] < 5)format(string, sizeof(string), "Admin %s[lv %d]: %s", GetName(playerid), PlayerInfo[playerid][pAdmin], mesaj);
        AdminChat(COLOR_AC, string, 1);
    }
    return 1;
}

 

function AdminChat(color, mesaj[], lv)
{
    foreach(new i : Player)
    {
        if(PlayerInfo[pAdmin] >= lv)
        {
            SendClientMessage(i, color, mesaj);
        }
    }
    return 1;
}

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
La 25.11.2018 la 10:32, AlexxAdv a spus:

Iti lipseste multe la functie, iar comanda nu inteleg de ce trebuie sa aiba adminul mai mare decat 1 si mai mic decat 5 atat timp cand ai verificare daca este admin.

Ti-am modificat eu codul tau, poftim https://pastebin.com/e80zKTfL

Acum am observat si eu greseala de la functie. mersi. T/C rezolvat.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.