Problem with /ahelp command
#1

Hi guys.I have problem with a /ahelp command.I have 2 checks:

pawn Код:
if(UserStats[playerid][BetaAdmin] == 0 || UserStats[playerid][Admin] == 0) return SendClientMessage(playerid, COLOR_GREEN, NOACCESS);
If BetaAdmin = 1 but Admin = 0 it shows the NOACCESS message and the different if they aren't beta admins but they are admins again it shows the message not the dialog.Please help ^^

Regards,
S. Ignatov
Reply
#2

It should be an AND conditional, not an OR.

You're checking if BetaAdmin equals 0 OR Admin equals 0, which means if player is not admin OR player is not beta admin then send the error, and unless the player is both a BetaAdmin and an Admin it will pass.

You should check if BetaAdmin equals 0 AND Admin equals 0 to send the error, which means that neither conditions are met
Reply
#3

Thanks bro.Now i have another problem with another function.I wanna in my command /ismuted to show "AdminAction: [BG]MrTinder is muted.Reason: Спам" but at reason it shows my name.

This is the function:

pawn Код:
public GetMuteReason(playerid)
{
    new reason[32];
    if(UserStats[playerid][pMuted] == 1) { reason = "Спам"; }
    else if(UserStats[playerid][pMuted] == 2) { reason = "Псуване/Обиждане"; }
    else if(UserStats[playerid][pMuted] == 3) { reason = "Спам/Псуване/Обиждане"; }
    else if(UserStats[playerid][pMuted] == 4) { reason = "Оплакване във форума"; }
    return 1;
}
this is the command:

pawn Код:
CMD:ismuted(playerid, params[])
{
    new targetID, string[256];
    if(UserStats[playerid][Admin] < 1) return SendClientMessage(playerid, COLOR_GREEN, NOACCESS);
    if(sscanf(params, "u", targetID)) return SendClientMessage(playerid, COLOR_GREEN, "Използвай /ismuted [playerid]");
    if(UserStats[targetID][pMuted] == 0) return SendClientMessage(playerid, COLOR_GREEN, "Този играч не е заглушен");
    else
    {
        format(string, sizeof(string), "AdminAction: %s(ID %d) is muted.Reason: %s", GetName(targetID), targetID, GetMuteReason(targetID));
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    }
    return 1;
}
P.S; I sorry for the strange language ;d

Regards,
S. Ignatov
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)