[Ajuda] warning 219: local variable "playerid" shadows a variable at a preceding level
#1

Instalei um mapa da бrea 51 com e deu esse erro

pawn Код:
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(49) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(78) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5416) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5512) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5519) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5531) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5555) : warning 219: local variable "playerid" shadows a variable at a preceding level
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


7 Warnings.
Sу apуs eu instalar um mapa com

pawn Код:
RemoveBuildingForPlayer(playerid
e jб botei
pawn Код:
new playerid;
nas news... estranho todos as warning que aparece como erro, sгo as publics
Reply
#2

em qual public vocк estб colocando ? se for na OnGameModeInt, nгo vai funcionar porque ela nгo tem o parвmetro playerid, coloque na OnPlayerConnect que vai funcionar.
Reply
#3

LOOOOOOOOOOOOOOOOOOL

@topic

Jamais declare playerid, seja global ou local, playerid й uma variбvel de cada funзгo nativa do samp.
Remova essa var playerid global e coloque a funзгo RemoveBuildingForPlayer na callback OnPlayerConnect
Reply
#4

Movi as partes de removebuilin... para onplayerconect e deu esse erro

pawn Код:
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(49) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(76) : warning 217: loose indentation
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(328) : warning 217: loose indentation
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(331) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5419) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5515) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5522) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5534) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5558) : warning 219: local variable "playerid" shadows a variable at a preceding level
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(5640) : warning 203: symbol is never used: "playerid"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


10 Warnings.
Reply
#5

warning = aviso
error = erro
Logo vc estб tendo avisos e nгo erros.
Remova a variбvel playerid
Reply
#6

pawn Код:
C:\Users\Familia\Desktop\Servidor\gamemodes\GM.pwn(302) : warning 217: loose indentation
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
~
Porйm estбs assim
pawn Код:
RemoveBuildingForPlayer(playerid, 669, -155.0938, 2711.2344, 61.8438, 0.25);
    RemoveBuildingForPlayer(playerid, 1308, -150.2734, 2700.0781, 61.1484, 0.25);
    RemoveBuildingForPlayer(playerid, 16094, 191.1406, 1870.0391, 21.4766, 0.25);
//HQ EXЙRCITO
jogadoresOnline++;
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid , AZUL,"                     ");
SendClientMessage(playerid, 0xDF0016FF, "============================BRASIL MATA MATA NOVA GERAЗГO================================");
SendClientMessage(playerid, 0xFF7403FF, "Seja bem vindo ao servidor, visite nosso fуrum e fique por dentro das noticias e novidades ");
SendClientMessage(playerid, 0xFF7403FF, "Escolha sua classe, e vocк serб redirecionado para o respawn de sua base, junto com seus membros");
SendClientMessage(playerid, 0xFF7403FF, "Nгo esqueзa de ler as regras para nгo sofrer nenhum tipo de puniзгo /regras");
SendClientMessage(playerid, 0xFF7403FF, "Tenha um bom Jogo!");
SendClientMessage(playerid, 0xDF0016FF, "============================BRASIL MATA MATA NOVA GERAЗГO================================");
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "[SERVER] Player %s Conectado", pname);
SendClientMessageToAll(BRANCO, string);
return 1;
}
Reply
#7

Код:
	RemoveBuildingForPlayer(playerid, 669, -155.0938, 2711.2344, 61.8438, 0.25);
	RemoveBuildingForPlayer(playerid, 1308, -150.2734, 2700.0781, 61.1484, 0.25);
	RemoveBuildingForPlayer(playerid, 16094, 191.1406, 1870.0391, 21.4766, 0.25);
	//HQ EXЙRCITO
	jogadoresOnline++;
	TextDrawShowForPlayer(playerid, Textdraw0);
	TextDrawShowForPlayer(playerid, Textdraw1);
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid , AZUL,"                     ");
	SendClientMessage(playerid, 0xDF0016FF, "============================BRASIL MATA MATA NOVA GERAЗГO================================");
	SendClientMessage(playerid, 0xFF7403FF, "Seja bem vindo ao servidor, visite nosso fуrum e fique por dentro das noticias e novidades ");
	SendClientMessage(playerid, 0xFF7403FF, "Escolha sua classe, e vocк serб redirecionado para o respawn de sua base, junto com seus membros");
	SendClientMessage(playerid, 0xFF7403FF, "Nгo esqueзa de ler as regras para nгo sofrer nenhum tipo de puniзгo /regras");
	SendClientMessage(playerid, 0xFF7403FF, "Tenha um bom Jogo!");
	SendClientMessage(playerid, 0xDF0016FF, "============================BRASIL MATA MATA NOVA GERAЗГO================================");
	new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(string, sizeof(string), "[SERVER] Player %s Conectado", pname);
	SendClientMessageToAll(BRANCO, string);
	return 1;
}
Reply
#8

Mano posso ti dar uma dica? A maioria dos seus erros que vocк posta sгo bobos que vocк pode resolver fбcil, digamos sempre que tu ver Loose Indentation ou quase sempre й erro por falta de Tab entгo:

Loose Indentation = Vocк esqueceu de dar tab, nessas linhas.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)