Admin Command Help?
#1

I have two types of commands
Here's one set
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;
}
And the second code
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]);
        IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, string);
        #if ADM_CHAT_LOG == true
        SaveIn("AdmChatLog",string);
        #endif
        return 0;
    }
I would like the first code converted into the second code could anyone help me in doing so?
Reply
#2

BUMP
Reply
#3

pawn Код:
if(text[0] == '$' && AccInfo[playerid][Level] >= 2)
    {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"Owner Chat: %s: %s",string,text[1]);
        MessageToOwners(green,string);
        GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"9Owner Chat: %s: %s",string,text[1]);
        IRC_GroupSay(gGroupID4, IRC_ADMINCHANNEL, string);
        #if ADM_CHAT_LOG == true
        SaveIn("AdmChatLog",string);
        #endif
        return 0;
    }
just change the levels and stuff the text should work fine.
i don't even get why you need our help when you have 2 codes like that already all you need to change it text and 1 number?
Reply
#4

Because when I tryed doing it it complete failed
Reply
#5

And I don't want it as a symbol I want it as a cmd like /o and /v
Reply
#6

so what exactly is it you want? im not following you here, you want them into symbols or into cmds?
Reply
#7

I will give you a code with symbols (In the second code you used different admin variables so i will use the admin variables of the second code..)

pawn Код:
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;
    }
    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]);
        IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, string);
        #if ADM_CHAT_LOG == true
        SaveIn("AdmChatLog",string);
        #endif
        return 0;
    }
    if(text[0] == '}' && AccInfo[playerid][Level] >= 2)
    {
        new string[128];
        GetPlayerName(playerid, string, sizeof(string));
        format(string, 128, "Mod Chat: %s: %s", string, text[1]);
        MessageToAdmins(green, string);
        new name[128];
        new string2[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(string2, 128, "IRC Mod Chat: %s: %s", name, text[1]);
        IRC_GroupSay(gGroupID2, IRC_ADMINCHANNEL, string2);
        #if ADM_CHAT_LOG == true
        SaveIn("AdminChatLog", string2);
        return 0;
    }
    if(text[0] == '{' && AccInfo[playerid][Level] >= 7)
    {
        new oname[25];
        GetPlayerName(playerid, oname, sizeof(oname));
        new ostirng[128];
        format(ostring, 128, "Owner Chat: %s: %s", oname, text[1]);
        MessageToAdmins(green, ostring);
    }
Reply
#8

No i want the symbol code converted into the cmd like /o...
Reply
#9

BUMP
Please help me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)