Can Help Me Fix This Warning
#1

I get This warning

Код:
D:\SAMP\pawno\include\dutils.inc(368) : warning 219: local variable "str1" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warnings.
This Is My GM
Код:
public OnPlayerSpawn(playerid)
{
	SetPlayerInterior(playerid,0);
	SetPlayerVirtualWorld(playerid, 0);
	SetPlayerHealth(playerid,100);
	SetPlayerArmour(playerid,100);
	SetPlayerPos(playerid,984.2, 2415.4, 13.9);
	SetPlayerFacingAngle(playerid,146.2062);
	GivePlayerMoney(playerid, 500000);
	if(dm2minigame[playerid] == 1)
	{
 	new rand = random(3);
	if(rand == 0) SetPlayerPos(playerid, -2234.71, 2403.64, 2.24);
	else if(rand == 1) SetPlayerPos(playerid, -2197.81, 2401.98, 4.45);
	else SetPlayerPos(playerid, -2227.19, 2350.17, 5.58);
 	SetPlayerVirtualWorld(playerid, WORLD_DM2);
  	GivePlayerWeapon(playerid,24,9000); //De
	GivePlayerWeapon(playerid,34,9000); //Snip
	}
 	if(dmMinigame[playerid] == 1)
	{
 	new rand = random(3);
	if(rand == 0) SetPlayerPos(playerid,229.8495,140.8090,1003.0234);
	else if(rand == 1) SetPlayerPos(playerid,300.3968,171.5821,1007.1719);
	else SetPlayerPos(playerid,196.3825,168.4234,1003.0234);
	SetPlayerInterior(playerid,3);
	SetPlayerVirtualWorld(playerid,WORLD_DM);
 	GivePlayerWeapon(playerid,24,9000); // 368 line
	GivePlayerWeapon(playerid,25,9000);
	GivePlayerWeapon(playerid,34,9000);
	}
	return 1;
}
Reply
#2

The line you stated is not in your gamemode/filterscript, it's in the dutils.inc file.

D:\SAMP\pawno\include\dutils.inc(36 : warning 219: local variable "str1" shadows a variable at a preceding level

The warning you see means, that you have 2 variables (global or local) with the same name, existing at the same time.

I guess some include you included before dutils.inc uses the same variable name somewhere.
Or in your script, but thats not likely since the warning popped up at the includes.

So, search for "str1" in your script, if you find it, change it to str2 or any other name.
If it's not in your script, open "dutils.inc" and look for "new str1[...];" and change the name of ALL str1 vars you find.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)