[Ajuda] Loose identation
#1

Eu sei que й ma identaзгo mais ta tudo identado corretamente atй usei site para identar mais continua dando warning e eu nгo quero usar #pragma tabsize 0
Cуdigo
pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[180];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(text[0] == '!')
    {         for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(Player[i][pFaccao] == 1)
            {
                format(string,sizeof(string),"[Chat Terceiro Comando da capital] %s (%d): %s", name,playerid, text[1]);
                if(Player[i][pFaccao] == 1)
                    SendClientMessage(i,COR_AMARELO,string);
            }
            if(Player[i][pFaccao] == 2)
            {
                format(string,sizeof(string),"[Chat Comando Vermelho] %s (%d): %s", name,playerid, text[1]);
                if(Player[i][pFaccao] == 2)
                    SendClientMessage(i,COR_ERRO,string);
            }
        }
        return 0;
    }
    return 1;
}
o warning й no return 0
Reply
#2

Esse cуdigo estб longe de estar identado...
Reply
#3

pawn Код:
public OnPlayerText(playerid, text[]){
    new string[180];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(text[0] == '!'){
        for(new i=0; i < MAX_PLAYERS; i++){
        if(Player[i][pFaccao] == 1){
            format(string,sizeof(string),"[Chat Terceiro Comando da capital] %s (%d): %s", name,playerid, text[1]);
            if(Player[i][pFaccao] == 1) {
                    SendClientMessage(i,COR_AMARELO,string);
                    return 1;
            }
            if(Player[i][pFaccao] == 2){
                format(string,sizeof(string),"[Chat Comando Vermelho] %s (%d): %s", name,playerid, text[1]);
                if(Player[i][pFaccao] == 2){
                    SendClientMessage(i,COR_ERRO,string);
                }
            }
        }
    }
    return 1;
}
Tenta isso
Reply
#4

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[180];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(text[0] == '!')
    {
                 for(new i=0; i < MAX_PLAYERS; i++)
        {
           
            if(Player[i][pFaccao] == 1)
            {
               
                format(string,sizeof(string),"[Chat Terceiro Comando da capital] %s (%d): %s", name,playerid, text[1]);
                if(Player[i][pFaccao] == 1)
                SendClientMessage(i,COR_AMARELO,string);
            }
            if(Player[i][pFaccao] == 2)
            {
               
                format(string,sizeof(string),"[Chat Comando Vermelho] %s (%d): %s", name,playerid, text[1]);
                if(Player[i][pFaccao] == 2)
                SendClientMessage(i,COR_ERRO,string);
            }
        }
        return 0;
    }
    return 1;
}
Reply
#5

Esta todo certo o code.
Reply
#6

Use a tecla TAB de seu teclado para poder identar corretamente.
Aos poucos vocк vai pegando jeito e seu gamemode irб ficar 100% identado, Vai por min!



Isso й uma identaзгo mais uma уtimizaзгo!

pawn Код:
public OnPlayerText(playerid, text[])
{
    new string[180], name;
    GetPlayerName(playerid,name,sizeof(name));
    if(text[0] == '!')
    {
        for(new i=0; i < MAX_PLAYERS; i++)
        {
            if(Player[i][pFaccao] == 1)
            {
                format(string,sizeof(string),"[Chat Terceiro Comando da capital] %s (%d): %s", name,playerid, text[1]);
                if(Player[i][pFaccao] == 1) return SendClientMessage(i,COR_AMARELO,string);
            }
            else if(Player[i][pFaccao] == 2)
            {
                format(string,sizeof(string),"[Chat Comando Vermelho] %s (%d): %s", name,playerid, text[1]);
                if(Player[i][pFaccao] == 2) return SendClientMessage(i,COR_ERRO,string);
            }
        }
    }
    return true;
}
Reply
#7

Use o tabulador!
http://tabulador.medianewsonline.com/

Ele deixa seu cуdigo totalmente identado.

JБ SEM LOOSE:
Код:
public OnPlayerText(playerid, text[])
{
	new string[180];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	if(text[0] == '!')
	{
		         for(new i=0; i < MAX_PLAYERS; i++)
		{
			
			if(Player[i][pFaccao] == 1)
			{
				
				format(string,sizeof(string),"[Chat Terceiro Comando da capital] %s (%d): %s", name,playerid, text[1]);
				if(Player[i][pFaccao] == 1)
				SendClientMessage(i,COR_AMARELO,string);
			}
			if(Player[i][pFaccao] == 2)
			{
				
				format(string,sizeof(string),"[Chat Comando Vermelho] %s (%d): %s", name,playerid, text[1]);
				if(Player[i][pFaccao] == 2)
				SendClientMessage(i,COR_ERRO,string);
			}
		}
		return 0;
	}
	return 1;
}
Abraзo.
Reply
#8

Код:
 public OnPlayerText(playerid, text[])
{
	new string[180];
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	if(text[0] == '!')
	{         for(new i=0; i < MAX_PLAYERS; i++)
		{
			if(Player[i][pFaccao] == 1)
			{
				format(string,sizeof(string),"[Chat Terceiro Comando da capital] %s (%d): %s", name,playerid, text[1]);
				if(Player[i][pFaccao] == 1)
					SendClientMessage(i,COR_AMARELO,string);
			}
			if(Player[i][pFaccao] == 2)
			{
				format(string,sizeof(string),"[Chat Comando Vermelho] %s (%d): %s", name,playerid, text[1]);
				if(Player[i][pFaccao] == 2)
					SendClientMessage(i,COR_ERRO,string);
			}
return 0;
		}
	}
	return 1;
}

Tenta isso
Reply
#9

Jб resolveu o problema?
Kojak, de todos o seu foi o pior cуdigo, sem identaзгo nenhuma.
Reply
#10

Sу pode ser zoaзгo, pra que esse espaзamento absurdo
Reply


Forum Jump:


Users browsing this thread: