"already defined"
#9

you must use "else" functions too, or just swap the code from lower-to-upper.

solution 1:
PHP код:
    if(phealth >= 100)
    {
      
SetPlayerColor(playeridCOLOR_GREEN);
    }
    else if(
phealth 65)
    {
      
SetPlayerColor(playeridCOLOR_YELLOW);
    }
    else if(
phealth 50)
    {
      
SetPlayerColor(playeridCOLOR_ORANGE);
    }
    else if(
phealth 40)
    {
      
SetPlayerColor(playeridCOLOR_RED);
    } 
solution 2:
PHP код:
    if(phealth 40)
    {
      
SetPlayerColor(playeridCOLOR_RED);
    }
    if(
phealth 50)
    {
      
SetPlayerColor(playeridCOLOR_ORANGE);
    }
    if(
phealth 65)
    {
      
SetPlayerColor(playeridCOLOR_YELLOW);
    }
    if(
phealth >= 100)
    {
      
SetPlayerColor(playeridCOLOR_GREEN);
    } 
choose one of them, both will work (1st is better)
Reply


Messages In This Thread
"already defined" - by ivndosos - 08.02.2018, 14:27
Re: "already defined" - by ISmokezU - 08.02.2018, 14:32
Re: "already defined" - by ivndosos - 08.02.2018, 14:34
Re: "already defined" - by ISmokezU - 08.02.2018, 14:36
Re: "already defined" - by ivndosos - 08.02.2018, 14:37
Re: "already defined" - by PepsiCola23 - 08.02.2018, 14:57
Re: "already defined" - by Mugala - 08.02.2018, 15:03
Re: "already defined" - by ivndosos - 08.02.2018, 15:10
Re: "already defined" - by Mugala - 08.02.2018, 15:14

Forum Jump:


Users browsing this thread: 1 Guest(s)