Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding Weight To An Item
#16
Sonire Wrote:
Code:
If GetPlayerCurWeight(Index) > GetPlayerMaxWeight(Index) Then Call PlayerMsg(Index, "You are over encumbered!", White)

Thats a key line of code for this system. If you want being over encumbered to carry penalties, that's pretty much how you would do it. I would probably take the above line of code and use it to determine whether a player can walk or not. Putting this in the appropriate sub would work:

Code:
If GetPlayerCurWeight(Index) > GetPlayerMaxWeight(Index) Then CanMove = False

Ty this is nice, works good...Smile my players can't walk if over encumbered... funny :twisted:

I now need another litle help. :roll:
I make a label(lblWeight) and a shape(shpWeight) to the inventory. I use this code:

Private Sub Label24_Click()
'Weight
lblWeight.Caption = GetPlayerMaxWeight & " / " & GetPlayerCurWeight
shpWeight.Width = (((GetPlayerMaxWeight / lblWeight.Width) / GetPlayerCurWeight / lblWeight.Width) * lblWeight.Width)
End Sub

But if i want to make my project, is says:

Argument not optional!

lblWeight.Caption = GetPlayerMaxWeight & " / " & GetPlayerCurWeight

Any tip :?: :roll:
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)