Phone Signal
#2

Use this code :
PHP код:
new tower GetClosestTower(playerid);
if(
tower == -1// No Signal
{
    
PlayerTextDrawSetString(playeridTextdraw2"~w~Phone Signal - ~r~I I I I I");
}
else
{
    new 
Float:dis GetPlayerDistanceFromPoint(playeridtInfo[tower][tower_Pos][0], tInfo[tower][tower_Pos][1], tInfo[tower][tower_Pos][2]);
    if(
dis tInfo[tower][tower_Signal] / // Bar One
    
{
        
PlayerTextDrawSetString(playeridTextdraw2"~w~Phone Signal - ~g~I ~r~I I I I");
    }
    else if(
dis tInfo[tower][tower_Signal] / 25 // Bar Two
    
{
        
PlayerTextDrawSetString(playeridTextdraw2"~w~Phone Signal - ~g~I I ~r~I I I");
    }
    else if(
dis tInfo[tower][tower_Signal] / 50// Bar Three
    
{
        
PlayerTextDrawSetString(playeridTextdraw2"~w~Phone Signal - ~g~I I I ~r~I I");
    }
    else if(
dis tInfo[tower][tower_Signal] / 100)
    {
        
PlayerTextDrawSetString(playeridTextdraw2"~w~Phone Signal - ~g~I I I I ~r~I"); // bar four
    
}
    else 
    {
        
PlayerTextDrawSetString(playeridTextdraw2"~w~Phone Signal - ~g~I I I I I"); // bar five
    
}

Your code wouldn't work as expected because if player is in range of tInfo[tower][tower_Signal] then he is also in range of tInfo[tower][tower_Signal] / any_natural_number because
x > x/natural_number.
Reply


Messages In This Thread
Phone Signal - by JaKe Elite - 21.12.2015, 10:23
Re: Phone Signal - by BroZeus - 21.12.2015, 10:38
Re: Phone Signal - by JaKe Elite - 21.12.2015, 10:45
Re: Phone Signal - by BroZeus - 21.12.2015, 11:12
Re: Phone Signal - by JaKe Elite - 21.12.2015, 11:32
Re: Phone Signal - by BroZeus - 21.12.2015, 12:11
Re: Phone Signal - by JaKe Elite - 21.12.2015, 12:24
Re: Phone Signal - by BroZeus - 21.12.2015, 14:21
Re: Phone Signal - by PrO.GameR - 21.12.2015, 14:39
Re: Phone Signal - by DRIFT_HUNTER - 21.12.2015, 14:45

Forum Jump:


Users browsing this thread: 3 Guest(s)