PDA

View Full Version : issus


BigBaws
01/08/2012, 04:54 PM
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;

Roko_foko
01/08/2012, 05:10 PM
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]);
}
}

farCry.xD
01/08/2012, 05:22 PM
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.