#1

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;
Reply
#2

Код:
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]);
		}
	}
Reply
#3

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)