SA-MP Forums Archive
Warning 219 : Local Variable "string" Help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Warning 219 : Local Variable "string" Help! (/showthread.php?tid=569597)



Warning 219 : Local Variable "string" Help! - ChuckyBabe - 01.04.2015

I'am Having this warning

Код:
C:\Users\Windows7\Desktop\Microsoft Corporation ©\Irish Verse\gamemodes\PRP-2.pwn(60119) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
With this code

Код:
TextDrawHideForPlayer(playerid, MainMenuTxtdraw[10]);
        TextDrawHideForPlayer(playerid, MainMenuTxtdraw[11]);
		ClearChatbox(playerid);
		new string[128];
		format(string, sizeof(string), "Welcome to Irish Verse Roleplay PH, %s.", GetPlayerNameEx(playerid));
		SendClientMessage(playerid, COLOR_NEWS, string);

		format(string, sizeof(string), "~w~Welcome~n~~y~%s", GetPlayerNameEx(playerid));
		GameTextForPlayer(playerid, string, 5000, 1);

		SendClientMessage(playerid, COLOR_YELLOW, "If you have any further questions, please use /newb. You can also /report if you see any rule-breakers.");
		SendClientMessage(playerid, COLOR_GREY, "Use /usecoupon to be a Gold Donator for 7 Days.");
		ShowPlayerDialogEx(playerid, DIALOG_REFUND2, DIALOG_STYLE_LIST,"Irish Verse Roleplay PH - \ages","Starter Refund","Read", "");

		new motdstring[128];
		format(motdstring, sizeof(motdstring), "News: %s", GlobalMOTD);
		SendClientMessage(playerid, COLOR_WHITE, motdstring);

		DeletePVar(playerid, "IsFrozen");

		TutorialProgress[playerid] = 0;
	}
}
How to fix it ? +1 Rep!


Re: Warning 219 : Local Variable "string" Help! - SequenceCuz - 01.04.2015

Delete that line or early line if you want

cuz you already define/new it


Re: Warning 219 : Local Variable "string" Help! - ChuckyBabe - 01.04.2015

+1 rep