25.06.2011, 15:46
HEllo! I have a bug with the delagged HealthBar: it don't 'move'
the original one is moving
It's important, because it's under onplayerupdate
ORIGINAL ONE:
DELAGGED ONE:
the original one is moving
It's important, because it's under onplayerupdate
ORIGINAL ONE:
PHP код:
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Health >= 95)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[2]);
}
else if(Health >= 90 && Health < 95)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[3]);
}
else if(Health >= 85 && Health < 90)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[4]);
}
else if(Health >= 80 && Health < 85)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[5]);
}
else if(Health >= 75 && Health < 80)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[6]);
}
else if(Health >= 70 && Health < 75)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[8]);
}
else if(Health >= 65 && Health < 70)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[9]);
}
else if(Health >= 60 && Health < 65)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[10]);
}
else if(Health >= 55 && Health < 60)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[11]);
}
else if(Health >= 50 && Health < 55)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[12]);
}
else if(Health >= 45 && Health < 50)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[14]);
}
else if(Health >= 40 && Health < 45)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[15]);
}
else if(Health >= 35 && Health < 40)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[16]);
}
else if(Health >= 30 && Health < 35)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[17]);
}
else if(Health >= 25 && Health < 30)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[18]);
}
else
{
for(new i=0; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
}
DELAGGED ONE:
PHP код:
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Health >= 95)
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[2]);
}
switch(Health)
{
case 90..94:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[3]);
}
case 85..89:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[4]);
}
case 80..84:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[5]);
}
case 75..79:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[1]);
TextDrawShowForPlayer(playerid,HealthBar[6]);
}
case 70..74:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[8]);
}
case 65..69:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[9]);
}
case 60..64:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[10]);
}
case 55..59:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[11]);
}
case 50..54:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[7]);
TextDrawShowForPlayer(playerid,HealthBar[12]);
}
case 45..49:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[14]);
}
case 40..44:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[15]);
}
case 35..39:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[16]);
}
case 30..34:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[17]);
}
case 25..29:
{
for(new i=1; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
TextDrawShowForPlayer(playerid,HealthBar[13]);
TextDrawShowForPlayer(playerid,HealthBar[18]);
}
case 0..24:
{
for(new i=0; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
}
}