LuxAdmin Admin Chat?
#1

I have an Ladmin admin chat and i have LuxAdmin Admin Chat and i want to change the LuxAdmin Admin Chat into the Ladmin Admin chat but when i do that it gives me errors

Here is my Ladmin Admin Chat Code
pawn Код:
CMD:o(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 7) {
        new string[128]; format(string, sizeof(string), "[OWNER] %s: %s", PlayerName2(playerid), params[0] );
        MessageToAdmins(green,string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be owner to use this command");
    return 1;
}

CMD:a(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 3) {
        new string[128]; format(string, sizeof(string), "[ADMIN] %s: %s", PlayerName2(playerid), params[0] );
        MessageToAdmins(green,string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be admin to use this command");
    return 1;
}

CMD:m(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 2) {
        new string[128]; format(string, sizeof(string), "[MOD] %s: %s", PlayerName2(playerid), params[0] );
        MessageToAdmins(green,string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be moderator to use this command");
    return 1;
}

CMD:v(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 1) {
        new string[128]; format(string, sizeof(string), "[VIP] %s: %s", PlayerName2(playerid), params[0] );
        MessageToAdmins(green,string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be a VIP to use this command");
    return 1;
}

CMD:osay(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 5) {
        if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /osay [text]");
        new string[128]; format(string, sizeof(string), "**Owner %s: %s", PlayerName2(playerid), params[0] );
        return SendClientMessageToAll(red,string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level owner to use this command");}

CMD:asay(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 3) {
        if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /asay [text]");
        new string[128]; format(string, sizeof(string), "**Admin %s: %s", PlayerName2(playerid), params[0] );
        return SendClientMessageToAll(red,string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 3 to use this command");}
   
CMD:msay(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 2) {
        if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /msay [text]");
        new string[128]; format(string, sizeof(string), "**Moderator %s: %s", PlayerName2(playerid), params[0] );
        return SendClientMessageToAll(red,string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be level 2 to use this command");}
   
CMD:vsay(playerid,params[]) {
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 1) {
        if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /vsay [text]");
        new string[128]; format(string, sizeof(string), "**VIP %s: %s", PlayerName2(playerid), params[0] );
        return SendClientMessageToAll(red,string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be VIP to use this command");}
And Here is the LuxAdmin Admin Chat.

pawn Код:
//==============================================================================
// Vip Chat
//==============================================================================
    if(text[0] == '*' && AccInfo[playerid][pVip] >= 1)
    {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"|ChatVip| %s: %s",string,text[1]);
        MessageToPlayerVIP(0xDC686BAA,string);
        SaveIn("ChatVipLog",string);
        return 0;
    }
//==============================================================================
// Administration Chat
//==============================================================================
    if(text[0] == '#' && AccInfo[playerid][Level] >= 1)
    {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"Admin Chat: %s: %s",string,text[1]);
        MessageToAdmins(green,string);
        GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"9Admin Chat: %s: %s",string,text[1]);
        #if ADM_CHAT_LOG == true
        SaveIn("AdmChatLog",string);
        #endif
        return 0;
    }
Could Someone please help me. Whoever helps me will ofcourse get +1 Rep.
Reply
#2

First of all are all the stocks included in the script?

if they are have you edited the vars to your servers vars properly?

if everything is good please give me the line number your getting errors at

EDIT: also remember the luxadmin code uses a special sign for its admin/vip chat. What your trying to make is a command based text system so its going to be different.

Heres an example of my admin chat:
pawn Код:
CMD:a(playerid,params[])
{
    if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 1+ admin!");
    new text[128];
    if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,-1,"Usage: /a [text]");
    format(gString,SOS,"[A.Chat] %s[%d]: %s",pInfo[playerid][Nick],playerid,text);
    SendMessageToRAdmins(0xFF00FF, gString);
    printf("[A.Chat] %s[%d]: %s",pInfo[playerid][Nick],playerid,text);
    return 1;
}
stock SendMessageToRAdmins(color,const msg[])
{
   foreach(Player, i) {
        if(pInfo[i][pAdmin] >= 1 && pInfo[i][Logged] == 1)
        {
            SendClientMessage(i,color,msg);
        }
   }
}
//===========================================
//OnPlayerText
    if(text[0] == '.' && pInfo[playerid][pAdmin] >= 1)
    {
        format(msg,sizeof(msg),"[A.Chat] %s[%d]: %s",pInfo[playerid][Nick],playerid,text[1]);
        SendMessageToRAdmins(0xFF00FF, msg);
        return 0;
    }
    if(text[0] == '.' && pInfo[playerid][Helpers] == 1)
    {
        format(msg,sizeof(msg),"[H.Chat] %s[%d]: %s",pInfo[playerid][Nick],playerid,text[1]);
        SendMessageToHelpers(COLOR_MEDIUMAQUA, msg);
        SendMessageToRAdmins(COLOR_MEDIUMAQUA, msg);
        return 0;
    }
Reply
#3

But i want them all in the same
not all combined how would i make each one by itself?
Reply
#4

Quote:
Originally Posted by Tass007
Посмотреть сообщение
But i want them all in the same
not all combined how would i make each one by itself?
Are you looking towards an OnPlayerText type of admin chat such as: "Player 1: [A.Chat] . Hi" where teh player uses a "." for his chat. Or do you want a command based chat sys where the admin uses "/a Hi" to chat.
Reply
#5

/a Hi
Reply
#6

remeber this is untested so if it doesn't work just reply here.
pawn Код:
CMD:a(playerid,params[])
{
    if(pInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_ORANGE, "[*] You're not a level 1+ admin!");
    new text[128], string[128], level[128];
    if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,-1,"Usage: /a [text]");
    switch(pInfo[playerid][pAdmin])
    {
        case 1: level = "VIP (1)";
        case 2: level = "MOD (2)";
        case 3: level = "ADMIN (3)";
        case 4: level = "ADMIN (4)";
        case 5: level = "ADMIN (5)";
        case 6: level = "ADMIN (6)";
        case 7: level = "OWNER (7)";
    }
    format(gString,SOS,"[A.Chat] %s %s[%d]: %s",level, pInfo[playerid][Nick],playerid,text);
    for(new i=0; i<MAX_PLAYERS; i++) {
        if(pInfo[i][pAdmin] >= 1)
        {
            SendClientMessage(i,0xFF00FF,string);
        }
    }
    printf("[A.Chat] %s[%d]: %s",pInfo[playerid][Nick],playerid,text);
    return 1;
}
Reply
#7

I'm going out for lunch so I will check it later
Reply
#8

It doesn't work i get errors but i wanted to have like /o for owner chat but it goes into admin chat but shows as [Owner] or if you do /a it comes up like [Admin] ect..Is there any way i can do that?
Reply
#9

I fixed it
pawn Код:
CMD:v(playerid, params[]) {
    if(AccInfo[playerid][Level] >=1){
        new string[128]; format(string, sizeof(string), "[VIP Chat] %s: %s", PlayerName2(playerid), params[0] );
        MessageToAdmins(orange,string);
        SaveIn("AdmChatLog",string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be a VIP to use this command");
    return 1;}
CMD:o(playerid, params[]) {
    if(AccInfo[playerid][Level] >=10){
        new string[128]; format(string, sizeof(string), "[Owner Chat] %s: %s", PlayerName2(playerid), params[0] );
        MessageToAdmins(orange,string);
        SaveIn("AdmChatLog",string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be a level 10 to use this command");
    return 1;}
CMD:a(playerid, params[]) {
    if(AccInfo[playerid][Level] >=4){
        new string[128]; format(string, sizeof(string), "[Admin Chat] %s: %s", PlayerName2(playerid), params[0] );
        MessageToAdmins(orange,string);
        SaveIn("AdmChatLog",string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be a level 4 to use this command");
    return 1;}
CMD:m(playerid, params[]) {
    if(AccInfo[playerid][Level] >=3){
        new string[128]; format(string, sizeof(string), "[Moderator Chat] %s: %s", PlayerName2(playerid), params[0] );
        MessageToAdmins(orange,string);
        SaveIn("AdmChatLog",string);
    } else return SendClientMessage(playerid,red,"ERROR: You need to be a level 3 to use this command");
    return 1;}
CMD:msay(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 3)
    {
        if(isnull(params)) return
        Inter_SendClientMessage(playerid, LIGHTBLUE2, "Usage: /msay [Text] ") &&
        Inter_SendClientMessage(playerid, orange, "Function: Will send specified message as Admin!");
        new string[128];
        format(string, sizeof(string), "|- Moderator %s: %s", PlayerName2(playerid), params[0]);
        return Inter_SendClientMessageToAll(LIGHTBLUE,string);
    }
    else return ErrorMessages(playerid, 7);
}
CMD:vsay(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 1)
    {
        if(isnull(params)) return
        Inter_SendClientMessage(playerid, LIGHTBLUE2, "Usage: /vsay [Text] ") &&
        Inter_SendClientMessage(playerid, orange, "Function: Will send specified message as Admin!");
        new string[128];
        format(string, sizeof(string), "|- VIP %s: %s", PlayerName2(playerid), params[0]);
        return Inter_SendClientMessageToAll(LIGHTBLUE,string);
    }
    else return ErrorMessages(playerid, 7);
}
CMD:osay(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 10)
    {
        if(isnull(params)) return
        Inter_SendClientMessage(playerid, LIGHTBLUE2, "Usage: /osay [Text] ") &&
        Inter_SendClientMessage(playerid, orange, "Function: Will send specified message as Admin!");
        new string[128];
        format(string, sizeof(string), "|- Owner %s: %s", PlayerName2(playerid), params[0]);
        return Inter_SendClientMessageToAll(LIGHTBLUE,string);
    }
    else return ErrorMessages(playerid, 7);
}
CMD:asay(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 4)
    {
        if(isnull(params)) return
        Inter_SendClientMessage(playerid, LIGHTBLUE2, "Usage: /asay [Text] ") &&
        Inter_SendClientMessage(playerid, orange, "Function: Will send specified message as Admin!");
        new string[128];
        format(string, sizeof(string), "|- Admin %s: %s", PlayerName2(playerid), params[0]);
        return Inter_SendClientMessageToAll(LIGHTBLUE,string);
    }
    else return ErrorMessages(playerid, 7);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)