..\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.
// 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 i = 0; i < MAX_PLAYERS; i++)
{
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] == 0 && IsRaceRunning == true)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
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;
}
case 2:
{
#include "..\scriptfiles\Corridas\corrida.pwn"
}
case 3:
{
//Alguma coisa para o item 3
return 1;
}
// 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 i = 0; i < MAX_PLAYERS; i++)
{
Player_CheckPoint[i] = 0;
SetPlayerRaceCheckpoint(i, 0, CheckPoints[0][0], CheckPoints[0][1], CheckPoints[0][2], 0, 0, 0, 9.7); // No 0,0,0 vocк deverб colocar a cordenada do prуximo CP
IsRaceRunning = true;
}
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
if(IsRaceRunning == true) Player_CheckPoint[playerid]++;
if(Player_CheckPoint[playerid] == 0 && IsRaceRunning == true)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
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;
}
case 2:
{
SendRconCommand("reloadfs corrida");
}
case 3:
{
//....
}
Testa e me diz os erros que continuaram...
PHP Code:
PHP 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.
public OnGameModeInit() //linha 20
{ //linha 21
for(new i = 0; i < MAX_PLAYERS; i++)
{
Player_CheckPoint[i] = 0;
SetPlayerRaceCheckpoint(i, 0, CheckPoints[0][0], CheckPoints[0][1], CheckPoints[0][2], 0, 0, 0, 9.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 == true) Player_CheckPoint[playerid]++;
if(Player_CheckPoint[playerid] == 0 && IsRaceRunning == true)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
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;
}
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. PHP Code:
|
public OnGameModeInit() // Jeito errado
hook OnGameModeInit() // Jeito certo
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:
|
#include <YSI\y_hooks>
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.
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.
Й que o hook nгo permite uma callback com mais de 31 caracteres, como resolver:
Mude o OnPlayerEnterRaceCheckpoint para OnPlayerEnterRaceCP |
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.