SA-MP Forums Archive
[Ajuda] Comando dando erro! - 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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Comando dando erro! (/showthread.php?tid=595043)



Comando dando erro! - jefrens - 27.11.2015

Pessoal, socorro!
Criei a seguinte public para um ChatBubble porйm estб dando erro e eu nгo consigo concertar.

Код:
public HeadCLATexto()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        new string[256], arquivo[40], name[MAX_PLAYER_NAME];
        GetPlayerName(i, name, 32);
        format(arquivo, 40, "cla/%s.ini", name);
        if(DOF2_FileExists(arquivo))
        {
            new bcla;
			bcla = DOF2_GetString(arquivo, "cla"); //O ERRO Й NESSA LINHA!
            format(string, sizeof string,"%s",bcla);
            SetPlayerChatBubble(i,string, 0x00FFFFFF, 100.0, 10000);
        }
    }
}
O erro й o seguinte na hora de compilar:

Код:
error 006: must be assigned to an array
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Sera que alguйm de уtimo coraзгo poderia ajudar?


Re: Comando dando erro! - Whoo - 27.11.2015

PHP код:
public HeadCLATexto()
{
    for(new 
i=0i<MAX_PLAYERSi++)
    {
        new 
string[256], arquivo[40], name[MAX_PLAYER_NAME];
        
GetPlayerName(iname32);
        
format(arquivo40"cla/%s.ini"name);
        if(
DOF2_FileExists(arquivo))
        {
            new 
bcla;
            
bcla DOF2_GetString(arquivo"cla"); //O ERRO Й NESSA LINHA!
            
format(stringsizeof string,"%s",bcla);
            
SetPlayerChatBubble(i,string0x00FFFFFF100.010000);
        }
    }
    return 
1;




Re: Comando dando erro! - cicinho - 27.11.2015

A variбvel bcla sу armazenaria inteiros por isso resultava em erro.
Код:
public HeadCLATexto()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        new string[256], arquivo[40], name[MAX_PLAYER_NAME];
        GetPlayerName(i, name, 32);
        format(arquivo, 40, "cla/%s.ini", name);
        if(DOF2_FileExists(arquivo))
        {
            format(string, sizeof string, "%s", DOF2_GetString(arquivo, "cla"));
            SetPlayerChatBubble(i,string, 0x00FFFFFF, 100.0, 10000);
        }
        return true;
    }
}



Re: Comando dando erro! - Thider - 27.11.2015

Porque nгo coloca direto?

PHP код:
SetPlayerChatBubble(i,DOF2_GetString(arquivo"cla"), 0x00FFFFFF100.010000);