SA-MP Forums Archive
[Ajuda] erro ao compilar! - 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] erro ao compilar! (/showthread.php?tid=610689)



erro ao compilar! - daniel29 - 27.06.2016

eu estava editando uma FS e na hora de combilar deu esses erros:

pawn Код:
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(18) : error 017: undefined symbol "String"
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(18) : error 017: undefined symbol "String"
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : error 017: undefined symbol "RelogioUP"
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : warning 215: expression has no effect
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : error 001: expected token: ";", but found "]"
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : error 029: invalid expression, assumed zero
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.

a FS й essa:

PHP код:
#include <a_samp>
#include <DOF2>
#define LEVEL                  "Contas/%s.ini" //PASTA PARA SALVAR O LEVEL.
#define SEGUNDOSLEVEL          1800 //SEGUNDOS DESEJADOS
enum Info
{
    
pSegundos,
    
pLevel,
    
pScore
};
new 
PlayerInfo[MAX_PLAYERS][Info];
new 
segundos;
public 
OnPlayerSpawn(playerid)
{
    
format(String, sizeof String, "+UP %s", Convert(PlayerInfo[playerid][pSegundos]));
    
PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
    
PlayerInfo[playerid][pSegundos]--;
    
SetTimerEx("Contagem", 1000, 0, "d", playerid);
    return 
true;
}
forward Contagem(playerid);
public 
Contagem(playerid)
{
    if(
PlayerInfo[playerid][pSegundos] > 0)
    {
        
format(String, sizeof String, "+UP %s", Convert(PlayerInfo[playerid][pSegundos]));
        
PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
        
PlayerInfo[playerid][pSegundos]--;
        
SetTimerEx("Contagem", 1000, 0, "d",playerid);
    }else{
        
PlayerInfo[playerid][pSegundos] = SEGUNDOSScore;
        
ScoreUP(playerid);
        
SetTimerEx("Contagem", 1000, 0, "d", playerid);
    }
    return 
true;
}
public 
OnFilterScriptInit()
{
    
segundos = SetTimer("SegundoaMais",1000,1);
    return 
1;
}
public 
OnFilterScriptExit()
{
    
KillTimer(segundos);
    
DOF2_Exit();
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    new 
arquivo[34], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, playername, sizeof(playername));
    
format(arquivo, sizeof(arquivo), LEVEL, playername);
    if(
DOF2_FileExists(arquivo))
    {
        
DOF2_SetInt(arquivo, "Segundos", PlayerInfo[playerid][pSegundos]);
        
DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][pLevel]);
        
DOF2_SetInt(arquivo, "Score", GetPlayerScore(playerid));
        
DOF2_SaveFile();
    }
    else
    {
        
DOF2_CreateFile(arquivo);
        
DOF2_SetInt(arquivo, "Segundos", PlayerInfo[playerid][pSegundos]);
        
DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][pLevel]);
        
DOF2_SetInt(arquivo, "Score", GetPlayerScore(playerid));
        
DOF2_SaveFile();
    }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    new 
arquivo[34], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, playername, sizeof(playername));
    
format(arquivo, sizeof(arquivo), LEVEL, playername);
    
PlayerInfo[playerid][pSegundos] = DOF2_GetInt(arquivo, "Segundos");
    
PlayerInfo[playerid][pLevel] = DOF2_GetInt(arquivo, "Level");
    
SetPlayerScore(playerid, DOF2_GetInt(arquivo,"Score"));
    return 
1;
}
forward SegundoaMais();
public 
SegundoaMais()
{
    for(new 
i = 0; i < MAX_PLAYERS; i++)
    {
        
PlayerInfo[i][pSegundos] ++;
        if(
PlayerInfo[i][pSegundos] >= SEGUNDOSLEVEL)
        {
            
PlayerInfo[i][pSegundos] = 0;
            
LevelUP(i);
        }
    }
    return 
1;
}
LevelUP(playerid)
{
    
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
    
PlayerInfo[playerid][pLevel] ++;
    
GivePlayerMoney(playerid, 1000);
    
GameTextForPlayer(playerid, "~w~Level ~p~UP", 2000, 1);
    
SendClientMessage(playerid, 0xE60000FF, "-------------Parabйns----------------");
    
SendClientMessage(playerid, 0xFFFF00FF, "vocк acaba de upar +1 level!");
    
// COLOQUE AQUI AS FUNЗХES QUE DESEJA NO SEU "LEVEL UP"
}
Convert(number)
{
    new 
hours = 0, mins = 0, secs = 0, string[100];
    
hours = floatround(number / 3600);
    
mins = floatround((number / 60) - (hours * 60));
    
secs = floatround(number - ((hours * 3600) + (mins * 60)));
    new 
days = 0;
    if(
hours >= 24)
    {
        
days = floatround((hours/24), floatround_floor);
        
hours = hours % 24;
    }
    if(
days > 0)
    {
        
format(string, 100, "%d, %d:%d:%d:", days, hours, mins, secs);
    }
    else if(
hours > 0)
    {
        
format(string, 100, "%d:%d:%d", hours, mins, secs);
    }
    else
    {
        
format(string, 100, "%02d:%02d", mins, secs);
    }
    return 
string;
} 
algum pode editar e me mandar fazendo favor?
agradeзo desde ja!


Respuesta: erro ao compilar! - SammyJ - 27.06.2016

Quote:
Originally Posted by daniel29
Посмотреть сообщение
eu estava editando uma FS e na hora de combilar deu esses erros:

pawn Код:
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(18) : error 017: undefined symbol "String"
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(18) : error 017: undefined symbol "String"
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : error 017: undefined symbol "RelogioUP"
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : warning 215: expression has no effect
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : error 001: expected token: ";", but found "]"
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : error 029: invalid expression, assumed zero
C:\Users\Daniel\Desktop\^^\filterscripts\UP.pwn(19) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.

a FS й essa:

PHP код:
#include <a_samp>
#include <DOF2>
#define LEVEL                  "Contas/%s.ini" //PASTA PARA SALVAR O LEVEL.
#define SEGUNDOSLEVEL          1800 //SEGUNDOS DESEJADOS
enum Info
{
    
pSegundos,
    
pLevel,
    
pScore
};
new 
PlayerInfo[MAX_PLAYERS][Info];
new 
segundos;
public 
OnPlayerSpawn(playerid)
{
    
format(String, sizeof String, "+UP %s", Convert(PlayerInfo[playerid][pSegundos]));
    
PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
    
PlayerInfo[playerid][pSegundos]--;
    
SetTimerEx("Contagem", 1000, 0, "d", playerid);
    return 
true;
}
forward Contagem(playerid);
public 
Contagem(playerid)
{
    if(
PlayerInfo[playerid][pSegundos] > 0)
    {
        
format(String, sizeof String, "+UP %s", Convert(PlayerInfo[playerid][pSegundos]));
        
PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
        
PlayerInfo[playerid][pSegundos]--;
        
SetTimerEx("Contagem", 1000, 0, "d",playerid);
    }else{
        
PlayerInfo[playerid][pSegundos] = SEGUNDOSScore;
        
ScoreUP(playerid);
        
SetTimerEx("Contagem", 1000, 0, "d", playerid);
    }
    return 
true;
}
public 
OnFilterScriptInit()
{
    
segundos = SetTimer("SegundoaMais",1000,1);
    return 
1;
}
public 
OnFilterScriptExit()
{
    
KillTimer(segundos);
    
DOF2_Exit();
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    new 
arquivo[34], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, playername, sizeof(playername));
    
format(arquivo, sizeof(arquivo), LEVEL, playername);
    if(
DOF2_FileExists(arquivo))
    {
        
DOF2_SetInt(arquivo, "Segundos", PlayerInfo[playerid][pSegundos]);
        
DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][pLevel]);
        
DOF2_SetInt(arquivo, "Score", GetPlayerScore(playerid));
        
DOF2_SaveFile();
    }
    else
    {
        
DOF2_CreateFile(arquivo);
        
DOF2_SetInt(arquivo, "Segundos", PlayerInfo[playerid][pSegundos]);
        
DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][pLevel]);
        
DOF2_SetInt(arquivo, "Score", GetPlayerScore(playerid));
        
DOF2_SaveFile();
    }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    new 
arquivo[34], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, playername, sizeof(playername));
    
format(arquivo, sizeof(arquivo), LEVEL, playername);
    
PlayerInfo[playerid][pSegundos] = DOF2_GetInt(arquivo, "Segundos");
    
PlayerInfo[playerid][pLevel] = DOF2_GetInt(arquivo, "Level");
    
SetPlayerScore(playerid, DOF2_GetInt(arquivo,"Score"));
    return 
1;
}
forward SegundoaMais();
public 
SegundoaMais()
{
    for(new 
i = 0; i < MAX_PLAYERS; i++)
    {
        
PlayerInfo[i][pSegundos] ++;
        if(
PlayerInfo[i][pSegundos] >= SEGUNDOSLEVEL)
        {
            
PlayerInfo[i][pSegundos] = 0;
            
LevelUP(i);
        }
    }
    return 
1;
}
LevelUP(playerid)
{
    
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
    
PlayerInfo[playerid][pLevel] ++;
    
GivePlayerMoney(playerid, 1000);
    
GameTextForPlayer(playerid, "~w~Level ~p~UP", 2000, 1);
    
SendClientMessage(playerid, 0xE60000FF, "-------------Parabйns----------------");
    
SendClientMessage(playerid, 0xFFFF00FF, "vocк acaba de upar +1 level!");
    
// COLOQUE AQUI AS FUNЗХES QUE DESEJA NO SEU "LEVEL UP"
}
Convert(number)
{
    new 
hours = 0, mins = 0, secs = 0, string[100];
    
hours = floatround(number / 3600);
    
mins = floatround((number / 60) - (hours * 60));
    
secs = floatround(number - ((hours * 3600) + (mins * 60)));
    new 
days = 0;
    if(
hours >= 24)
    {
        
days = floatround((hours/24), floatround_floor);
        
hours = hours % 24;
    }
    if(
days > 0)
    {
        
format(string, 100, "%d, %d:%d:%d:", days, hours, mins, secs);
    }
    else if(
hours > 0)
    {
        
format(string, 100, "%d:%d:%d", hours, mins, secs);
    }
    else
    {
        
format(string, 100, "%02d:%02d", mins, secs);
    }
    return 
string;
} 
algum pode editar e me mandar fazendo favor?
agradeзo desde ja!
Coloque esta...
PHP код:
#include <a_samp>
#include <DOF2>
#define LEVEL                  "Contas/%s.ini" //PASTA PARA SALVAR O LEVEL.
#define SEGUNDOSLEVEL          1800 //SEGUNDOS DESEJADOS
enum Info
{
    
pSegundos,
    
pLevel,
    
pScore
};
new 
PlayerInfo[MAX_PLAYERS][Info];
new 
segundos,
    
RelogioUP[MAX_PLAYERS],
    
String[128]
;
public 
OnPlayerSpawn(playerid)
{
    
format(String, sizeof String, "+UP %s", Convert(PlayerInfo[playerid][pSegundos]));
    
PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
    
PlayerInfo[playerid][pSegundos]--;
    
SetTimerEx("Contagem", 1000, 0, "d", playerid);
    return 
true;
}
forward Contagem(playerid);
public 
Contagem(playerid)
{
    if(
PlayerInfo[playerid][pSegundos] > 0)
    {
        
format(String, sizeof String, "+UP %s", Convert(PlayerInfo[playerid][pSegundos]));
        
PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
        
PlayerInfo[playerid][pSegundos]--;
        
SetTimerEx("Contagem", 1000, 0, "d",playerid);
    }else{
        
PlayerInfo[playerid][pSegundos] = SEGUNDOSScore;
        
ScoreUP(playerid);
        
SetTimerEx("Contagem", 1000, 0, "d", playerid);
    }
    return 
true;
}
public 
OnFilterScriptInit()
{
    
segundos = SetTimer("SegundoaMais",1000,1);
    return 
1;
}
public 
OnFilterScriptExit()
{
    
KillTimer(segundos);
    
DOF2_Exit();
    return 
1;
}
public 
OnPlayerDisconnect(playerid)
{
    new 
arquivo[34], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, playername, sizeof(playername));
    
format(arquivo, sizeof(arquivo), LEVEL, playername);
    if(
DOF2_FileExists(arquivo))
    {
        
DOF2_SetInt(arquivo, "Segundos", PlayerInfo[playerid][pSegundos]);
        
DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][pLevel]);
        
DOF2_SetInt(arquivo, "Score", GetPlayerScore(playerid));
        
DOF2_SaveFile();
    }
    else
    {
        
DOF2_CreateFile(arquivo);
        
DOF2_SetInt(arquivo, "Segundos", PlayerInfo[playerid][pSegundos]);
        
DOF2_SetInt(arquivo, "Level", PlayerInfo[playerid][pLevel]);
        
DOF2_SetInt(arquivo, "Score", GetPlayerScore(playerid));
        
DOF2_SaveFile();
    }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    new 
arquivo[34], playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, playername, sizeof(playername));
    
format(arquivo, sizeof(arquivo), LEVEL, playername);
    
PlayerInfo[playerid][pSegundos] = DOF2_GetInt(arquivo, "Segundos");
    
PlayerInfo[playerid][pLevel] = DOF2_GetInt(arquivo, "Level");
    
SetPlayerScore(playerid, DOF2_GetInt(arquivo,"Score"));
    return 
1;
}
forward SegundoaMais();
public 
SegundoaMais()
{
    for(new 
i = 0; i < MAX_PLAYERS; i++)
    {
        
PlayerInfo[i][pSegundos] ++;
        if(
PlayerInfo[i][pSegundos] >= SEGUNDOSLEVEL)
        {
            
PlayerInfo[i][pSegundos] = 0;
            
LevelUP(i);
        }
    }
    return 
1;
}
LevelUP(playerid)
{
    
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
    
PlayerInfo[playerid][pLevel] ++;
    
GivePlayerMoney(playerid, 1000);
    
GameTextForPlayer(playerid, "~w~Level ~p~UP", 2000, 1);
    
SendClientMessage(playerid, 0xE60000FF, "-------------Parabйns----------------");
    
SendClientMessage(playerid, 0xFFFF00FF, "vocк acaba de upar +1 level!");
    
// COLOQUE AQUI AS FUNЗХES QUE DESEJA NO SEU "LEVEL UP"
}
Convert(number)
{
    new 
hours = 0, mins = 0, secs = 0, string[100];
    
hours = floatround(number / 3600);
    
mins = floatround((number / 60) - (hours * 60));
    
secs = floatround(number - ((hours * 3600) + (mins * 60)));
    new 
days = 0;
    if(
hours >= 24)
    {
        
days = floatround((hours/24), floatround_floor);
        
hours = hours % 24;
    }
    if(
days > 0)
    {
        
format(string, 100, "%d, %d:%d:%d:", days, hours, mins, secs);
    }
    else if(
hours > 0)
    {
        
format(string, 100, "%d:%d:%d", hours, mins, secs);
    }
    else
    {
        
format(string, 100, "%02d:%02d", mins, secs);
    }
    return 
string;
} 



Re: erro ao compilar! - Cleyson - 27.06.2016

Tem coisas muito simples de resolver.
Poderia ter postado em dъvidas curtas, ou somente traduzido os erros para portuguкs.
Vocк iria ver como й tгo simples.
Simbolo indefinido "string", ou seja sу falta vc declarar as variбveis.


Re: erro ao compilar! - daniel29 - 27.06.2016

continua dando esse erro! :/

pawn Код:
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(22) : warning 213: tag mismatch
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(37) : warning 213: tag mismatch
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(41) : error 017: undefined symbol "SEGUNDOSScore"
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(42) : error 017: undefined symbol "ScoreUP"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.



Respuesta: erro ao compilar! - SammyJ - 27.06.2016

Vocк tem que postar os codigo (linhas) dos erros.


Re: Respuesta: erro ao compilar! - daniel29 - 27.06.2016

Quote:
Originally Posted by glederson
Посмотреть сообщение
Vocк tem que postar os codigo (linhas) dos erros.
Erros:
pawn Код:
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(22) : error 017: undefined symbol "PlayerTextDrawSetString"
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(37) : error 017: undefined symbol "PlayerTextDrawSetString"
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(41) : error 017: undefined symbol "SEGUNDOSScore"
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(42) : error 017: undefined symbol "ScoreUP"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
linhas:
PHP код:
(22)     PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
(
37)     PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
(
41)     PlayerInfo[playerid][pSegundos] = SEGUNDOSScore;
(
42)     ScoreUP(playerid); 



Re: erro ao compilar! - F1N4L - 27.06.2016

Atualize suas includes e declare a variбvel SEGUNDOSScore e a funзгo ScoreUP(playerid)


Respuesta: Re: Respuesta: erro ao compilar! - SammyJ - 27.06.2016

Quote:
Originally Posted by daniel29
Посмотреть сообщение
Erros:
pawn Код:
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(22) : error 017: undefined symbol "PlayerTextDrawSetString"
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(37) : error 017: undefined symbol "PlayerTextDrawSetString"
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(41) : error 017: undefined symbol "SEGUNDOSScore"
C:\Users\Daniel\Desktop\^^\filterscripts\UP2.pwn(42) : error 017: undefined symbol "ScoreUP"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
linhas:
PHP код:
(22)     PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
(
37)     PlayerTextDrawSetString(playerid, RelogioUP[playerid], String);
(
41)     PlayerInfo[playerid][pSegundos] = SEGUNDOSScore;
(
42)     ScoreUP(playerid); 
PHP код:
new PlayerText:RelogioUP[MAX_PLAYERS]; 
Os Outros erros e de variaveis nгo definidas ou criadas.


Re: Respuesta: Re: Respuesta: erro ao compilar! - F1N4L - 27.06.2016

Quote:
Originally Posted by glederson
Посмотреть сообщение
PHP код:
new PlayerText:RelogioUP[MAX_PLAYERS]; 
Os Outros erros e de variaveis nгo definidas ou criadas.
O erro nгo й na variбvel RelogioUP, se fosse acusaria a variбvel, no entanto, estб acusando a funзгo nativa.
O que pode estar ocasionando isso й, possivelmente, um erro dele, pois nos primeiros erros nгo constavam erros na funзгo nativa. Ou ele fez algo errado ou as variбveis estгo desatualizadas....