Errores con /noac
#1

tengo un problema con mi server cuando pongo /noac debe bloquear el canal /a de chat de admin y no lo hace


if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, GRAY, "usa: (/a)dmin [admin chat]");
return 1;
}

new arank[64];
if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Moderador A Prueba (1)"; }
else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Moderador Guia(2)"; }
else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Administrador (3)"; }
else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Administrador Guia (4)"; }
else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Administrador Lider (5)"; }
else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Administrador SubDueсo (6)"; }
else if(PlayerInfo[playerid][pAdmin] == 7) { arank = "Administrador Dueсo (7)"; }
else { arank = "Rango Desconosido "; }

format(string, sizeof(string), "%s %s: %s", arank, sendername, result);//
if (PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 5)//
{
SendAdminMessage(0xFFB18CFF, string);
}
if (PlayerInfo[playerid][pAdmin] >= 5 && PlayerInfo[playerid][pAdmin] < 7)
{
SendAdminMessage(0xFF9797FF, string);
}
if (PlayerInfo[playerid][pAdmin] >= 7)
{
SendAdminMessage(0xFF9797FF, string);
}
printf("Admin %s: %s", sendername, result);
}
return 1;
}

asi lo tengo me podrian decir que hacer?
me pueden decir como solucionarlo?
Reply
#2

Que tenйs en el comando /noac ?
Reply
#3

if(strcmp(cmd, "/noadminchat", true) == 0 || strcmp(cmd, "/noac", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 7 && (!noa))
{
noa = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "AdmCmd7:[ADMINS] %s desactivу el canal Adminchat",sendername);
SendClientMessageToAll(COLOR_NEWS2,string);
}
else if (PlayerInfo[playerid][pAdmin] >= 7 && (noa))
{
noa = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "AdmCmd7:[ADMINS] %s activу el canal Adminchat",sendername);
SendClientMessageToAll(COLOR_NEWS2,string);
}
else
{
SendClientMessage(playerid, GRAY, " Comando Solo Para Admins 7 !");
}
}
return 1;
}
Reply
#4

Agrega esta restricciуn a tu comando /a
pawn Код:
if(noa) {
    SendClientMessage(playerid,-1,"** El canal de admins se encuentra bloqueado");
    return 1;
}
Reply
#5

el mensaje se manda igual
Reply
#6

Prueva asi!!!

pawn Код:
if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(noa)
{
SendClientMessage(playerid, GRAY, "** El canal de admins se encuentra bloqueado");
return 1;
}
if(!strlen(result))
{
SendClientMessage(playerid, GRAY, "usa: (/a)dmin [admin chat]");
return 1;
}

new arank[64];
if(PlayerInfo[playerid][pAdmin] == 1) { arank = "Moderador A Prueba (1)"; }
else if(PlayerInfo[playerid][pAdmin] == 2) { arank = "Moderador Guia(2)"; }
else if(PlayerInfo[playerid][pAdmin] == 3) { arank = "Administrador (3)"; }
else if(PlayerInfo[playerid][pAdmin] == 4) { arank = "Administrador Guia (4)"; }
else if(PlayerInfo[playerid][pAdmin] == 5) { arank = "Administrador Lider (5)"; }
else if(PlayerInfo[playerid][pAdmin] == 6) { arank = "Administrador SubDueсo (6)"; }
else if(PlayerInfo[playerid][pAdmin] == 7) { arank = "Administrador Dueсo (7)"; }
else { arank = "Rango Desconosido "; }

format(string, sizeof(string), "%s %s: %s", arank, sendername, result);//
if (PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] < 5)//
{
SendAdminMessage(0xFFB18CFF, string);
}
if (PlayerInfo[playerid][pAdmin] >= 5 && PlayerInfo[playerid][pAdmin] < 7)
{
SendAdminMessage(0xFF9797FF, string);
}
if (PlayerInfo[playerid][pAdmin] >= 7)
{
SendAdminMessage(0xFF9797FF, string);
}
printf("Admin %s: %s", sendername, result);
}
return 1;
}
Reply
#7

La restrigcion debes de ponerla al principio del comando, si la pones al final no hace efecto
pawn Код:
if(strcmp(cmd, "/admin", true) == 0 || strcmp(cmd, "/a", true) == 0)
{
    if(noa)
    {
        SendClientMessage(playerid, GRAY, "** El canal de admins se encuentra bloqueado");
        return 1;
    }
    //codigo del comando
Reply
#8

Pone los cуdigos pawn entre [ pawn] [ /pawn] (sin dejar espacios).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)