/o Help
#1

Hello All,

I'm trying to do it so my /o(oc) when disabled admins can still use it..how could I?

The /o command is this

pawn Код:
}

CMD:ooc(playerid, params[]) {
    if(systemVariables[OOCStatus] == 1)
        return SendClientMessage(playerid, COLOR_GREY, "The OOC chat channel is currently disabled.");

    if(playerVariables[playerid][pOOCMuted] == 1)
        return SendClientMessage(playerid, COLOR_GREY, "You have been muted from the OOC chat channel.");

    if(!isnull(params)) {
        new
            playerName2[MAX_PLAYER_NAME];

        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

        format(szMessage, sizeof(szMessage), "(( %s says: %s ))", szPlayerName, params);

        foreach(Player, x) {
            if(playerVariables[x][pSeeOOC] == 1) {
                GetPlayerName(x, playerName2, MAX_PLAYER_NAME);
                if(strfind(szMessage, playerName2, true) == -1) {
                    format(szMessage, sizeof(szMessage), "(( %s says: %s ))", szPlayerName, params);
                    SendClientMessage(x, COLOR_LIGHT, szMessage);
                } else {
                    if(strfind(playerName2, szPlayerName, true) != -1) {
                        format(szMessage, sizeof(szMessage), "(( %s says: %s ))", szPlayerName, params);
                        SendClientMessage(x, COLOR_LIGHT, szMessage);
                    } else {
                        format(szMessage, sizeof(szMessage), "(( %s says: "EMBED_LIGHTRED"%s "EMBED_OOC"))", szPlayerName, params);
                        SendClientMessage(x, COLOR_LIGHT, szMessage);
                        PlayerPlaySound(x, 1057, 0, 0, 0);
                    }
                }
            }
        }
Reply
#2

Show us the ooc command.
Reply
#3

Sorry, added.
Reply
#4

Just for argument's sake we will say that the admin variable is just "Admin" And that anybody who isnt admin has level 0 (which is probably the case). Change the variable to whatever yours is

pawn Код:
CMD:ooc(playerid, params[]) {
    if(systemVariables[OOCStatus] == 1 && playerVariables[playerid][Admin] == 0)
        return SendClientMessage(playerid, COLOR_GREY, "The OOC chat channel is currently disabled.");

    if(playerVariables[playerid][pOOCMuted] == 1)
        return SendClientMessage(playerid, COLOR_GREY, "You have been muted from the OOC chat channel.");

    if(!isnull(params)) {
        new
            playerName2[MAX_PLAYER_NAME];

        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

        format(szMessage, sizeof(szMessage), "(( %s says: %s ))", szPlayerName, params);

        foreach(Player, x) {
            if(playerVariables[x][pSeeOOC] == 1) {
                GetPlayerName(x, playerName2, MAX_PLAYER_NAME);
                if(strfind(szMessage, playerName2, true) == -1) {
                    format(szMessage, sizeof(szMessage), "(( %s says: %s ))", szPlayerName, params);
                    SendClientMessage(x, COLOR_LIGHT, szMessage);
                } else {
                    if(strfind(playerName2, szPlayerName, true) != -1) {
                        format(szMessage, sizeof(szMessage), "(( %s says: %s ))", szPlayerName, params);
                        SendClientMessage(x, COLOR_LIGHT, szMessage);
                    } else {
                        format(szMessage, sizeof(szMessage), "(( %s says: "EMBED_LIGHTRED"%s "EMBED_OOC"))", szPlayerName, params);
                        SendClientMessage(x, COLOR_LIGHT, szMessage);
                        PlayerPlaySound(x, 1057, 0, 0, 0);
                    }
                }
            }
        }
Reply
#5

Thanks but I'm getting an error on this line for undefined symbol..what is it?

pawn Код:
CMD:seeooc(playerid, params[]) {
Reply
#6

Quote:
Originally Posted by Daniel_Davis
Посмотреть сообщение
Thanks but I'm getting an error on this line for undefined symbol..what is it?

pawn Код:
CMD:seeooc(playerid, params[]) {
Maybe your getting the error because your putting the command under OnPlayerCommandText.
Put in anywhere else in your gamemode
Reply
#7

Quote:
Originally Posted by Daniel_Davis
Посмотреть сообщение
Thanks but I'm getting an error on this line for undefined symbol..what is it?

pawn Код:
CMD:seeooc(playerid, params[]) {
Or u dont have #include <zcmd> at the top of ur script
Reply
#8

pawn Код:
CMD:ooc(playerid, params[]) {
   if(systemVariables[OOCStatus] == 1 && playerVariables[playerid][pAdminLevel] == 0)
        return SendClientMessage(playerid, COLOR_GREY, "The OOC chat channel is currently disabled.");

    if(playerVariables[playerid][pOOCMuted] == 1)
        return SendClientMessage(playerid, COLOR_GREY, "You have been muted from the OOC chat channel.");

    if(!isnull(params)) {
        new
            playerName2[MAX_PLAYER_NAME];

        GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

        format(szMessage, sizeof(szMessage), "(( %s says: %s ))", szPlayerName, params);

        foreach(Player, x) {
            if(playerVariables[x][pSeeOOC] == 1) {
                GetPlayerName(x, playerName2, MAX_PLAYER_NAME);
                if(strfind(szMessage, playerName2, true) == -1) {
                    format(szMessage, sizeof(szMessage), "(( %s says: %s ))", szPlayerName, params);
                    SendClientMessage(x, COLOR_LIGHT, szMessage);
                } else {
                    if(strfind(playerName2, szPlayerName, true) != -1) {
                        format(szMessage, sizeof(szMessage), "(( %s says: %s ))", szPlayerName, params);
                        SendClientMessage(x, COLOR_LIGHT, szMessage);
                    } else {
                        format(szMessage, sizeof(szMessage), "(( %s says: "EMBED_LIGHTRED"%s "EMBED_OOC"))", szPlayerName, params);
                        SendClientMessage(x, COLOR_LIGHT, szMessage);
                        PlayerPlaySound(x, 1057, 0, 0, 0);
                    }
                }
            }
        }
Tested on VX-RP and working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)