SA-MP Forums Archive
[Ajuda] Duvida - 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] Duvida (/showthread.php?tid=572750)



Duvida - VinnyScript - 01.05.2015

Antes o Comando estava para o ID do veiculo fiz algumas modificacoes para o Nome do Veiculo e adicionei todos os nomes dos veiculos em uma variavel chamada (PlayerVehicle) e sempre fica dando esse Warning

pode me ajudar ?

Код:
CMD:car(playerid, params[])
{
	new	Carro, Cor1, Cor2, engine, lights, alarm, doors, bonnet, boot, objective, PlayerVehicle;
	if(sscanf(params, "iii", Carro, Cor1, Cor2)) return Msg(playerid, CINZA, "[INFO]: Use /Car [ID] [cor1] [cor2]");
	new Float:X, Float:Y, Float:X1, Float:Y1, Float:Z, Float:A;
	PosicaoFrentePlayer(playerid, X, Y, 3);
	GetPlayerPos(playerid, X1, Y1, Z);
	GetPlayerFacingAngle(playerid, A);
	PlayerVehicle = AddStaticVehicle(Carro, X, Y, Z, A+90, Cor1, Cor2);
	CarrosCriados[TodosCarros] = PlayerVehicle;

	GetVehicleParamsEx(PlayerVehicle, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(PlayerVehicle, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_ON, alarm, doors, VEHICLE_PARAMS_OFF, VEHICLE_PARAMS_OFF, objective);

	TodosCarros ++;
	Msg(playerid, LARANJA, "[INFO]: Carro Criado com sucesso !");
	return 1;
}
Код:
warning 219: local variable "PlayerVehicle" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: Duvida - [BOPE]Seu._.Madruga - 01.05.2015

Nгo entendi cara, vocк quer que o carro seja criado usando o id do veнculo ou o nome?


Re: Duvida - VinnyScript - 01.05.2015

nome do veiculo


Re: Duvida - GabrielDias_Invision - 01.05.2015

PlayerVehicle jб existe e vc criou ela novamente dentro do comando, por isso esse warning.


Re: Duvida - VinnyScript - 01.05.2015

obrigado