ULX

Author Topic: Rect stretching  (Read 2330 times)

0 Members and 1 Guest are viewing this topic.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Rect stretching
« on: May 13, 2006, 11:53:03 PM »
I am working on a shield for my halo game mode, but having problems.
I have a script that gives you back the amount of health you lost until your shield runs out, then it takes health. The problem is, I can't get a shield bar to shrink as you lose shield, it only grows to the right, where I want it to shrink to the left.

shield = 100
function onTakeDamage(ent,inf,att,dam)
    if shield > 0 then
        shield = shield - dam
        local health = _PlayerInfo( ent, "health" );
        _PlayerSetHealth(ent, health + dam )
        local down = shield/10000
        local B = 0.22 - down
        _Msg(shield.." "..B.."\n")
 
        _GModRect_Start( "effects/laserplane" );
        _GModRect_SetPos( 0.02, .79, B, 0.07 );
        _GModRect_SetColor( 255, 255, 255, 255 );
        _GModRect_SetTime( 99999, 0, 0 );
        _GModRect_Send( playerid, 2 );
        else
    end
end
 
function rem(playerid)
    _GModRect_HideAll( playerid );
end
« Last Edit: May 13, 2006, 11:54:54 PM by Golden-Death »


Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Rect stretching
« Reply #1 on: May 13, 2006, 11:56:55 PM »
I'll look at this when it's not 1 AM...  :-X
Experiencing God's grace one day at a time.