Local variable shadows a variable at a perceding level
#1

Hey,

Why do I get these warnings?

Код:
warning 219: local variable "interior" shadows a variable at a preceding level
warning 219: local variable "interior" shadows a variable at a preceding level
warning 203: symbol is never used: "interior"
Code:

Код:
forward UnjailPlayer(playerid,Float:x,Float:y,Float:z,Float:a,interior);
public UnjailPlayer(playerid,Float:x,Float:y,Float:z,Float:a,interior)
{
	if(!playerDB[playerid][ikalintas]) return;
	SetPlayerPos(playerid,x,y,z);
	SetPlayerFacingAngle(playerid,a);
	SetPlayerInterior(playerid,interior);
	TogglePlayerControllable(playerid,true);
	SetPlayerWantedLevel(playerid,0);
	playerDB[playerid][ikalintas]=false;
	playerDB[playerid][kalejimo_laikas]=0;
}

stock JailPlayer(playerid,Float:x,Float:y,Float:z,Float:a,time,interior,Float:unX,Float:unY,Float:unZ,Float:unA,unInterior,bool:controlable)
{
	SetTimerEx("UnjailPlayer",time,0,"iffffi",playerid,unX,unY,unZ,unA,unInterior);
	SetPlayerInterior(playerid,interior);
	SetPlayerPos(playerid,x,y,z);
	SetPlayerFacingAngle(playerid,a);
	TogglePlayerControllable(playerid,controlable);
	SetPlayerWantedLevel(playerid,0);
	playerDB[playerid][ikalintas]=true;
}
Reply
#2

You have the variable interior, somewhere else, try rename the "interior" variable from those 2 functions to something else, like interior1 for the first function and interior2 for the second one. They might even shadow one another.
Reply
#3

Fixed.
Thanks for help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)