Como va el codigo?
#1

Hola pasa que estoy haciendo que al tener un comando activado para los admins al hablar se les aсada el prefijo sobre su rango, y me funciona todo perfect pero no puedo hacerlo calzar para que al estar muteado por un admin con /mutear id, no pueda hablar... no se si me explico

Код:
if(Informacion[playerid][RangoEnElChat] == 1)
   	{
   		if(Informacion[playerid][Nivel] == 1)
 		{
	    new string[140];
 	 	GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [MODERADOR A PRUEBA] [PRINCIPIANTE] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_AZUL, string);
		}
		else if(Informacion[playerid][Nivel] == 2)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [MODERADOR A PRUEBA] [MASTER] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_AZUL, string);
		}
		else if(Informacion[playerid][Nivel] == 3)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [MODERADOR GLOBAL] [PRINCIPIANTE] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_VERDE, string);
		}
		else if(Informacion[playerid][Nivel] == 4)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [MODERADOR GLOBAL] [MASTER] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_VERDE, string);
		}
		else if(Informacion[playerid][Nivel] == 5)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [ADMINISTRADOR] [PRINCIPIANTE] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_ROJO, string);
		}
		else if(Informacion[playerid][Nivel] == 6)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [ADMINISTRADOR] [MASTER] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_ROJO, string);
		}
  		else if(Informacion[playerid][Muteado] == 1)
		{
		    SendClientMessage(playerid, -1, "{375FFF}[ERROR]: {FFFFFF}Estas muteado, no puedes hablar! apela a un miembro del staff con el comando {375FFF}[/DUDA]");
			return 0;
		}
    }
	else
	{
	    new Chat[128];
		format(Chat, sizeof(Chat),"[%d]: %s", playerid, text);
		SendPlayerMessageToAll(playerid, Chat);
		SetPlayerChatBubble(playerid, text, 0x1111FFAA, 100.0, 10000);
	}
Reply
#2

En primer lugar te recomiendo usar un interruptor en el cуdigo.

No estoy seguro pero prueba asн..

Код:
if(Informacion[playerid][RangoEnElChat] == 1)
   	{
                 if(Informacion[playerid][Muteado] == 1)
		{
		    SendClientMessage(playerid, -1, "{375FFF}[ERROR]: {FFFFFF}Estas muteado, no puedes hablar! apela a un miembro del staff con el comando {375FFF}[/DUDA]");
			return 0;
		}
   		if(Informacion[playerid][Nivel] == 1)
 		{
	    new string[140];
 	 	GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [MODERADOR A PRUEBA] [PRINCIPIANTE] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_AZUL, string);
		}
		else if(Informacion[playerid][Nivel] == 2)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [MODERADOR A PRUEBA] [MASTER] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_AZUL, string);
		}
		else if(Informacion[playerid][Nivel] == 3)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [MODERADOR GLOBAL] [PRINCIPIANTE] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_VERDE, string);
		}
		else if(Informacion[playerid][Nivel] == 4)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [MODERADOR GLOBAL] [MASTER] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_VERDE, string);
		}
		else if(Informacion[playerid][Nivel] == 5)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [ADMINISTRADOR] [PRINCIPIANTE] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_ROJO, string);
		}
		else if(Informacion[playerid][Nivel] == 6)
		{
		new string[140];
 		GetPlayerName(playerid,string,sizeof(string));
		format(string, sizeof(string), "|| [ADMINISTRADOR] [MASTER] || %s [%d]: {FFFFFF}%s",string,playerid,text);
		SendClientMessageToAll(COLOR_ROJO, string);
		}
    }
	else
	{
	    new Chat[128];
		format(Chat, sizeof(Chat),"[%d]: %s", playerid, text);
		SendPlayerMessageToAll(playerid, Chat);
		SetPlayerChatBubble(playerid, text, 0x1111FFAA, 100.0, 10000);
	}
Reply
#3

Veo algo en el cуdigo, mandarб el error del mensaje de muteo solo si tiene la variable RangoEnElChat activada en 1, pruebo y te aviso.
Reply
#4

Solo si tiene la variable 'RangoEnElChat' y 'Muteado' en '1'
Reply
#5

Si amigo, probй y paso lo mismo que te dije, no se como hacer calzar el Rangoenchat y el muteado para que no se mezclen xd
Reply
#6

Tu quieres que pueda hablar aunque este muteado?
Reply
#7

їPara que quieres combinar esos dos if?

Bastarнa nada mбs con poner en OnPlayerText:

Код:
if(Informacion[playerid][Muteado] == 1)return SendClientMessage(playerid, -1, "Usted estб muteado por haber cometido alguna falta");
Solamente dejalo afuera de ese If de rango... no entiendo para que lo quieres asн, explicate...
Reply
#8

Romero837 tiene razуn....

para que usas tanto esto? si con una vez basta
PHP код:
GetPlayerName(playerid,string,sizeof(string)); 
Un nick no supera los 24 caracteres

PHP код:
new string[140]; 
Reply
#9

Jajaj gracias a todos, ese codigo es una real shit estaba probando
PD: Tiene 140 el string porque aparte de detectar el nombre, manda el mensaje a todos
PD2: No es que lo quiera asi, si no que no se me ocurria como hacerlo xD
Reply
#10

No me referia a que estaba chico, el limite son 144 no 140.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)