SA-MP Forums Archive
issus - 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: issus (/showthread.php?tid=365015)



issus - BigBaws - 01.08.2012

CODE
Код:
if(issuerid != INVALID_PLAYER_ID)
	{
		new Float:Health,Float:Armour;
		GetPlayerHealth(playerid,Health);
		GetPlayerArmour(playerid,Armour);
		if(Health == 0)
		{
			SendDeathMessage(issuerid,playerid,weaponid);
		}
		else if(Armour > 0)
		{
			SetPlayerArmour(playerid,Armour+amount);
			GetPlayerArmour(playerid,Armour);
			SetPlayerArmour(playerid,Armour-Weapons[weaponid][ArmourDamage]);
		} else {
			SetPlayerHealth(playerid,Health+amount);
			GetPlayerHealth(playerid,Health);
			SetPlayerHealth(playerid,Health-Weapons[weaponid][Damage]);
		}
	}
Error : warning 219: local variable "Health" shadows a variable at a preceding level

Line : new Float:Health,Float:Armour;



Re: issus - Roko_foko - 01.08.2012

Код:
if(issuerid != INVALID_PLAYER_ID)
	{
		new Float:Health2,Float:Armour;
		GetPlayerHealth(playerid,Health2);
		GetPlayerArmour(playerid,Armour);
		if(Health2 == 0)
		{
			SendDeathMessage(issuerid,playerid,weaponid);
		}
		else if(Armour > 0)
		{
			SetPlayerArmour(playerid,Armour+amount);
			GetPlayerArmour(playerid,Armour);
			SetPlayerArmour(playerid,Armour-Weapons[weaponid][ArmourDamage]);
		} else {
			SetPlayerHealth(playerid,Health2+amount);
			GetPlayerHealth(playerid,Health2);
			SetPlayerHealth(playerid,Health2-Weapons[weaponid][Damage]);
		}
	}



Re: issus - farCry.xD - 01.08.2012

pawn Код:
Error : warning 219: local variable "Health" shadows a variable at a preceding level
this error show when you already have defined this line in your Script
Just change the name of the variable or delete it.