Results 1 to 6 of 6

Thread: Error - Stamina Time

  1. #1
    iBot User
    Join Date
    Jan 2014
    Posts
    118
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    30 Post(s)
    Reputation
    14
    Rep Power
    3

    Error - Stamina Time

    I have at my HUD this code of stamina time, but this code have some error. Could someone help me?

    Code:
    addtext('Stamina', x, y)
       addtext('- ', 120, y)
       if stamina >= 2400 then
          setfontcolor("green")
       else if stamina < 2400 and (stamina > 840) then
             setfontcolor("orange")
          else if stamina <= 840 then
             setfontcolor("red")
             end
          end
       end
       if RaphaelLibrary then
          addtext(time(stamina), 130, y)
       else
          addtext(stamina, 130, y)
       end
       y = y + 15
       setfontcolor("white")

  2. #2
    iBot User
    Join Date
    Aug 2012
    Posts
    805
    Mentioned
    18 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    38 Post(s)
    Reputation
    180
    Rep Power
    7
    did you specify x and y ?

    if not do it, cause I did and works

  3. #3
    iBot User
    Join Date
    Jan 2014
    Posts
    118
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    30 Post(s)
    Reputation
    14
    Rep Power
    3
    how can i do that?

  4. #4
    iBot User
    Join Date
    Aug 2012
    Posts
    805
    Mentioned
    18 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    38 Post(s)
    Reputation
    180
    Rep Power
    7
    PHP Code:
    local x 20
    local y 
    20

    addtext
    ('Stamina'xy)
       
    addtext('- '120y)
       if 
    stamina >= 2400 then
          setfontcolor
    ("green")
       else if 
    stamina 2400 and (stamina 840then
             setfontcolor
    ("orange")
          else if 
    stamina <= 840 then
             setfontcolor
    ("red")
             
    end
          end
       end
       
    if RaphaelLibrary then
          addtext
    (time(stamina), 130y)
       else
          
    addtext(stamina130y)
       
    end
       y 
    15
       setfontcolor
    ("white"
    change em if you want 'move' hud

  5. #5
    iBot User
    Join Date
    Jan 2014
    Posts
    118
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    30 Post(s)
    Reputation
    14
    Rep Power
    3
    Quote Originally Posted by shanp View Post
    PHP Code:
    local x 20
    local y 
    20

    addtext
    ('Stamina'xy)
       
    addtext('- '120y)
       if 
    stamina >= 2400 then
          setfontcolor
    ("green")
       else if 
    stamina 2400 and (stamina 840then
             setfontcolor
    ("orange")
          else if 
    stamina <= 840 then
             setfontcolor
    ("red")
             
    end
          end
       end
       
    if RaphaelLibrary then
          addtext
    (time(stamina), 130y)
       else
          
    addtext(stamina130y)
       
    end
       y 
    15
       setfontcolor
    ("white"
    change em if you want 'move' hud
    Don't function..
    Guys the code of the stamina who i posted is usefull but the stamina time are in minutes, and i want to show in hour.

  6. #6
    iBot User
    Join Date
    Aug 2012
    Posts
    805
    Mentioned
    18 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    38 Post(s)
    Reputation
    180
    Rep Power
    7
    PHP Code:
    local x 20
    local y 
    120

    addtext
    ('Stamina'xy)
       
    addtext('- '120y)
       if 
    stamina >= 2400 then
          setfontcolor
    ("green")
       else if 
    stamina 2400 and (stamina 840then
             setfontcolor
    ("orange")
          else if 
    stamina <= 840 then
             setfontcolor
    ("red")
             
    end
          end
       end
       addtext
    (math.floor(stamina/60)..":"..string.format("%02s", (stamina-60*math.floor(stamina/60))), 130y)
       
    15
       setfontcolor
    ("white"
    I check this, works in format hh:mm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •