28.04.2012, 00:17
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?
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?