SA-MP Forums Archive
Errores con /noac - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Errores con /noac (/showthread.php?tid=337827)



Errores con /noac - matias_villalba - 28.04.2012

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?


Respuesta: Errores con /noac - Daniel-92 - 28.04.2012

Que tenйs en el comando /noac ?


Respuesta: Errores con /noac - matias_villalba - 28.04.2012

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;
}


Respuesta: Errores con /noac - Daniel-92 - 28.04.2012

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



Respuesta: Errores con /noac - matias_villalba - 28.04.2012

el mensaje se manda igual


Respuesta: Errores con /noac - Treyfus - 28.04.2012

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;
}



Respuesta: Errores con /noac - Daniel-92 - 28.04.2012

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



Respuesta: Errores con /noac - TiNcH010 - 29.04.2012

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