[Ajuda] 4 Erros
#1

Erros:
Code:
..\scriptfiles\Corridas\corrida.pwn(11) : warning 213: tag mismatch
..\scriptfiles\Corridas\corrida.pwn(11) : warning 213: tag mismatch
..\scriptfiles\Corridas\corrida.pwn(11) : warning 213: tag mismatch
..\scriptfiles\Corridas\corrida.pwn(22) : error 029: invalid expression, assumed zero
..\scriptfiles\Corridas\corrida.pwn(23) : error 001: expected token: ";", but found "{"
..\scriptfiles\Corridas\corrida.pwn(29) : warning 202: number of arguments does not match definition
..\scriptfiles\Corridas\corrida.pwn(29) : warning 202: number of arguments does not match definition
..\scriptfiles\Corridas\corrida.pwn(29) : warning 202: number of arguments does not match definition
..\scriptfiles\Corridas\corrida.pwn(36) : warning 225: unreachable code
..\scriptfiles\Corridas\corrida.pwn(36) : error 029: invalid expression, assumed zero
..\scriptfiles\Corridas\corrida.pwn(37) : error 001: expected token: ";", but found "{"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Cуdigo
PHP Code:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#define winner_money 10000
new CheckPoints[1][3] =
{
    {
956.1308,-969.3929,38.4609}
};
new 
Player_CheckPoint[MAX_PLAYERS];
new 
bool:IsRaceRunning false;
new 
WinnerName[MAX_PLAYER_NAME];
new 
stringwin[64];
public 
OnGameModeInit()
{
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
Player_CheckPoint[i] = 0;
            
SetPlayerRaceCheckpoint(i,0,CheckPoints[0][0],CheckPoints[0][1],CheckPoints[0][2],9.7);
            
IsRaceRunning true;
        }
    }
    return 
1;
}
public 
OnPlayerEnterRaceCheckpoint(playerid)
{
    if(
IsRaceRunning == true) { Player_CheckPoint[playerid]++; }
    
    if(
Player_CheckPoint[playerid] == && IsRaceRunning == true)
    {
        for(new 
0MAX_PLAYERSi++)
        {
            
DisablePlayerRaceCheckpoint(i);
        }
        
GetPlayerName(playerid,WinnerName,sizeof(WinnerName));
        
format(stringwin,sizeof(stringwin),"[RACE] The race is over, %s has won and achieved $%d!",WinnerName,winner_money);
        
SendClientMessageToAll(0xFF0000FF,stringwin);
        
GivePlayerMoney(playerid,winner_money);
        
IsRaceRunning false;
        return 
1;
    }
    return 
1;

Eu "chamei" o arquivo por meio de uma dialog:
PHP Code:
        case 2:
                {
            
#include "..\scriptfiles\Corridas\corrida.pwn"
                
}
                case 
3:
                {
                   
//Alguma coisa para o item 3
                   
return 1;
                } 
Nгo faзo ideia do que seja,se alguйm quiser me ajudar jб agradeзo
Meu discord: wooZ#0992
Reply
#2

Testa e me diz os erros que continuaram...

PHP Code:

// This is a comment 
// uncomment the line below if you want to write a filterscript 
//#define FILTERSCRIPT 

#include <a_samp> 

#define winner_money 10000 

new Float:CheckPoints[1][3] = 

    {
956.1308,-969.3929,38.4609
}; 

new 
    
Player_CheckPoint[MAX_PLAYERS],
    
bool:IsRaceRunning,
    
WinnerName[MAX_PLAYER_NAME],
    
stringwin[64]; 

public 
OnGameModeInit() 

    for(new 
0MAX_PLAYERSi++) 
    { 
        
Player_CheckPoint[i] = 0
        
SetPlayerRaceCheckpoint(i0CheckPoints[0][0], CheckPoints[0][1], CheckPoints[0][2], 0009.7); // No 0,0,0 vocк deverб colocar a cordenada do prуximo CP
        
IsRaceRunning true
    } 
    return 
1


public 
OnPlayerEnterRaceCheckpoint(playerid

    if(
IsRaceRunning == truePlayer_CheckPoint[playerid]++; 
     
    if(
Player_CheckPoint[playerid] == && IsRaceRunning == true
    { 
        for(new 
0MAX_PLAYERSi++) 
        { 
            
DisablePlayerRaceCheckpoint(i); 
        } 

        
GetPlayerName(playerid,WinnerName,sizeof(WinnerName)); 
        
format(stringwinsizeof(stringwin), "[RACE] The race is over, %s has won and achieved $%d!"WinnerNamewinner_money); 
        
SendClientMessageToAll(0xFF0000FFstringwin); 
        
GivePlayerMoney(playeridwinner_money); 
        
IsRaceRunning false
        return 
1
    } 
    return 
1

PHP Code:
case 2

    
SendRconCommand("reloadfs corrida");

case 
3

    
//....   

Reply
#3

Quote:
Originally Posted by Malandrin
View Post
Testa e me diz os erros que continuaram...

PHP Code:

// This is a comment 
// uncomment the line below if you want to write a filterscript 
//#define FILTERSCRIPT 
#include <a_samp> 
#define winner_money 10000 
new Float:CheckPoints[1][3] = 

    {
956.1308,-969.3929,38.4609
}; 
new 
    
Player_CheckPoint[MAX_PLAYERS],
    
bool:IsRaceRunning,
    
WinnerName[MAX_PLAYER_NAME],
    
stringwin[64]; 
public 
OnGameModeInit() 

    for(new 
0MAX_PLAYERSi++) 
    { 
        
Player_CheckPoint[i] = 0
        
SetPlayerRaceCheckpoint(i0CheckPoints[0][0], CheckPoints[0][1], CheckPoints[0][2], 0009.7); // No 0,0,0 vocк deverб colocar a cordenada do prуximo CP
        
IsRaceRunning true
    } 
    return 
1

public 
OnPlayerEnterRaceCheckpoint(playerid

    if(
IsRaceRunning == truePlayer_CheckPoint[playerid]++; 
     
    if(
Player_CheckPoint[playerid] == && IsRaceRunning == true
    { 
        for(new 
0MAX_PLAYERSi++) 
        { 
            
DisablePlayerRaceCheckpoint(i); 
        } 
        
GetPlayerName(playerid,WinnerName,sizeof(WinnerName)); 
        
format(stringwinsizeof(stringwin), "[RACE] The race is over, %s has won and achieved $%d!"WinnerNamewinner_money); 
        
SendClientMessageToAll(0xFF0000FFstringwin); 
        
GivePlayerMoney(playeridwinner_money); 
        
IsRaceRunning false
        return 
1
    } 
    return 
1

PHP Code:
case 2

    
SendRconCommand("reloadfs corrida");

case 
3

    
//....   

Nгo teve erro nenhum,mas a corrida nгo funcionou,creio que seja por que nгo й um filterscript e sim um mуdulo.
Depois que eu testei e a corrida nгo deu,eu deixei como mуdulo mesmo e continuaram os erros,mas sem os warnings:
Code:
..\scriptfiles\Corridas\corrida.pwn(20) : error 029: invalid expression, assumed zero
..\scriptfiles\Corridas\corrida.pwn(21) : error 001: expected token: ";", but found "{"
..\scriptfiles\Corridas\corrida.pwn(31) : warning 225: unreachable code
..\scriptfiles\Corridas\corrida.pwn(31) : error 029: invalid expression, assumed zero
..\scriptfiles\Corridas\corrida.pwn(32) : error 001: expected token: ";", but found "{"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Linha dos erros
PHP Code:
public OnGameModeInit()                  //linha 20
{                                                             //linha 21
    
for(new 0MAX_PLAYERSi++) 
    {
        
Player_CheckPoint[i] = 0;
        
SetPlayerRaceCheckpoint(i0CheckPoints[0][0], CheckPoints[0][1], CheckPoints[0][2], 0009.7); // No 0,0,0 vocк deverб colocar a cordenada do prуximo CP
        
IsRaceRunning true;
    }
    return 
1;
}
public 
OnPlayerEnterRaceCheckpoint(playerid)                            //linha 31
{                                                                                            //linha 32
    
if(IsRaceRunning == truePlayer_CheckPoint[playerid]++;
    if(
Player_CheckPoint[playerid] == && IsRaceRunning == true)
    {
        for(new 
0MAX_PLAYERSi++)
        {
            
DisablePlayerRaceCheckpoint(i);
        }
        
GetPlayerName(playerid,WinnerName,sizeof(WinnerName));
        
format(stringwinsizeof(stringwin), "[RACE] The race is over, %s has won and achieved $%d!"WinnerNamewinner_money);
        
SendClientMessageToAll(0xFF0000FFstringwin);
        
GivePlayerMoney(playeridwinner_money);
        
IsRaceRunning false;
        return 
1;
    }
    return 
1;

Obrigado por ter resolvido os warnings kk
Reply
#4

Quote:
Originally Posted by Noppet
View Post
Nгo teve erro nenhum,mas a corrida nгo funcionou,creio que seja por que nгo й um filterscript e sim um mуdulo.
Depois que eu testei e a corrida nгo deu,eu deixei como mуdulo mesmo e continuaram os erros,mas sem os warnings:
Code:
..\scriptfiles\Corridas\corrida.pwn(20) : error 029: invalid expression, assumed zero
..\scriptfiles\Corridas\corrida.pwn(21) : error 001: expected token: ";", but found "{"
..\scriptfiles\Corridas\corrida.pwn(31) : warning 225: unreachable code
..\scriptfiles\Corridas\corrida.pwn(31) : error 029: invalid expression, assumed zero
..\scriptfiles\Corridas\corrida.pwn(32) : error 001: expected token: ";", but found "{"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Linha dos erros
PHP Code:
public OnGameModeInit()                  //linha 20
{                                                             //linha 21
    
for(new 0MAX_PLAYERSi++) 
    {
        
Player_CheckPoint[i] = 0;
        
SetPlayerRaceCheckpoint(i0CheckPoints[0][0], CheckPoints[0][1], CheckPoints[0][2], 0009.7); // No 0,0,0 vocк deverб colocar a cordenada do prуximo CP
        
IsRaceRunning true;
    }
    return 
1;
}
public 
OnPlayerEnterRaceCheckpoint(playerid)                            //linha 31
{                                                                                            //linha 32
    
if(IsRaceRunning == truePlayer_CheckPoint[playerid]++;
    if(
Player_CheckPoint[playerid] == && IsRaceRunning == true)
    {
        for(new 
0MAX_PLAYERSi++)
        {
            
DisablePlayerRaceCheckpoint(i);
        }
        
GetPlayerName(playerid,WinnerName,sizeof(WinnerName));
        
format(stringwinsizeof(stringwin), "[RACE] The race is over, %s has won and achieved $%d!"WinnerNamewinner_money);
        
SendClientMessageToAll(0xFF0000FFstringwin);
        
GivePlayerMoney(playeridwinner_money);
        
IsRaceRunning false;
        return 
1;
    }
    return 
1;

Obrigado por ter resolvido os warnings kk
Esses erros provavelmente estгo aн por causa que vocк estб fazendo um mуdulo errado!

Vocк jamais deve utilizar "public" antes de uma callback nativa sendo ela um mуdulo, a menos que vocк tenha criado uma callback para usar em um timer, por exemplo.

Para resolver isso й simples baixa a livraria YSI, jogue tudo na pasta pawn/includes....

Link para download: https://github.com/pawn-lang/YSI-Includes

Apуs jogar tudo na pasta includes troque todos os "public" por "hook" APENAS CALLBACKS NATIVAS!
EX:
PHP Code:
public OnGameModeInit() // Jeito errado
hook OnGameModeInit() // Jeito certo 
Reply
#5

Quote:
Originally Posted by Malandrin
View Post
Esses erros provavelmente estгo aн por causa que vocк estб fazendo um mуdulo errado!

Vocк jamais deve utilizar "public" antes de uma callback nativa sendo ela um mуdulo, a menos que vocк tenha criado uma callback para usar em um timer, por exemplo.

Para resolver isso й simples baixa a livraria YSI, jogue tudo na pasta pawn/includes....

Link para download: https://github.com/pawn-lang/YSI-Includes

Apуs jogar tudo na pasta includes troque todos os "public" por "hook" APENAS CALLBACKS NATIVAS!
EX:
PHP Code:
public OnGameModeInit() // Jeito errado
hook OnGameModeInit() // Jeito certo 
Muito obrigado,mas o que eu coloco no #include para ele ler a YSI??
Reply
#6

PHP Code:
#include <YSI\y_hooks> 
Reply
#7

Quote:
Originally Posted by Malandrin
View Post
PHP Code:
#include <YSI\y_hooks> 
Code:
C:\Games\GTA San Andreas\pawno\include\YSI\..\YSI_Coding\..\YSI_Core\..\YSI_Storage\..\YSI_Internal\y_thirdpartyinclude.inc(138) : fatal error 111: user error: Please update "https://github.com/Zeex/amx_assembly" to get "deref()"


Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
@edit Eu resolvi isso,mas veio 2 warnings:

Code:
C:\Users\Eduardo Romeu Ebert\Desktop\Meu server\scriptfiles\Corridas\corrida.pwn(32) : warning 200: symbol "@yH_OnPlayerEnterRaceCheckpoint" is truncated to 31 characters
C:\Users\Eduardo Romeu Ebert\Desktop\Meu server\scriptfiles\Corridas\corrida.pwn(32) : warning 200: symbol "@yH_OnPlayerEnterRaceCheckpoint" is truncated to 31 characters
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#8

Й que o hook nгo permite uma callback com mais de 31 caracteres, como resolver:

Mude o OnPlayerEnterRaceCheckpoint para OnPlayerEnterRaceCP
Reply
#9

Quote:
Originally Posted by Malandrin
View Post
Й que o hook nгo permite uma callback com mais de 31 caracteres, como resolver:

Mude o OnPlayerEnterRaceCheckpoint para OnPlayerEnterRaceCP
Vlwwww,o mуdulo da corrida tб sem erro nenhum,mas quando compilo a GM aparece isso:

Code:
C:\Games\GTA San Andreas\pawno\include\YSI\..\YSI_Coding\..\YSI_Core\y_utils.inc(317) : warning 202: number of arguments does not match definition
C:\Games\GTA San Andreas\pawno\include\YSI\..\YSI_Coding\..\YSI_Core\y_utils.inc(330) : error 025: function heading differs from prototype
C:\Games\GTA San Andreas\pawno\include\YSI\..\YSI_Coding\..\YSI_Internal\y_unique.inc(103) : error 001: expected token: "-identifier-", but found "stock"
C:\Games\GTA San Andreas\pawno\include\YSI\..\YSI_Coding\..\YSI_Internal\y_unique\_000_to_099.inc(73) : error 001: expected token: "-identifier-", but found "stock"
..\scriptfiles\Corridas\corrida.pwn(21) : error 029: invalid expression, assumed zero
..\scriptfiles\Corridas\corrida.pwn(21) : error 017: undefined symbol "@yH_OnGameModeInit@002"
..\scriptfiles\Corridas\corrida.pwn(21) : error 017: undefined symbol "@yH_OnGameModeInit@002"
..\scriptfiles\Corridas\corrida.pwn(21) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)