13.06.2017, 23:17
A problem I made a function with a health and kevlar textdraw and is not working
When i add it to the server its show 0
How to fix it?
When i add it to the server its show 0
How to fix it?
pawn Код:
forward HealthTimer();
public HealthTimer()
{
foreach(Player, i)
{
if(GetPlayerState(i)==PLAYER_STATE_SPAWNED) SetBarValues(i);
}
}
stock SetBarValues(playerid)
{
new Float:hp,Float:ap;
GetPlayerHealth(playerid,hp);
GetPlayerArmour(playerid,ap);
ShowBars(playerid);
switch(floatround(hp,floatround_round))
{
case 0:
{
SetHealthValue(playerid,0);
}
case 1..10:
{
SetHealthValue(playerid,1);
}
case 11..20:
{
SetHealthValue(playerid,2);
}
case 21..30:
{
SetHealthValue(playerid,3);
}
case 31..40:
{
SetHealthValue(playerid,4);
}
case 41..50:
{
SetHealthValue(playerid,5);
}
case 51..60:
{
SetHealthValue(playerid,6);
}
case 61..70:
{
SetHealthValue(playerid,7);
}
case 71..80:
{
SetHealthValue(playerid,8);
}
case 81..90:
{
SetHealthValue(playerid,9);
}
case 91..100:
{
SetHealthValue(playerid,10);
}
}
switch(floatround(ap,floatround_round))
{
case 0:
{
SetArmourValue(playerid,0);
}
case 1..10:
{
SetArmourValue(playerid,1);
}
case 11..20:
{
SetArmourValue(playerid,2);
}
case 21..30:
{
SetArmourValue(playerid,3);
}
case 31..40:
{
SetArmourValue(playerid,4);
}
case 41..50:
{
SetArmourValue(playerid,5);
}
case 51..60:
{
SetArmourValue(playerid,6);
}
case 61..70:
{
SetArmourValue(playerid,7);
}
case 71..80:
{
SetArmourValue(playerid,8);
}
case 81..90:
{
SetArmourValue(playerid,9);
}
case 91..100:
{
SetArmourValue(playerid,10);
}
}
return 1;
}