ULX

Author Topic: Tables Help  (Read 2210 times)

0 Members and 1 Guest are viewing this topic.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Tables Help
« on: April 29, 2015, 02:14:24 PM »
Alright so im working on a ulx bail system for DarkRP and i would like some help with the tables!

I have a ulx bail command working! when you do !bail <player> it unarrests them! I want the cops to use a command !setbail <name> <price> and then the player that does !bail has to pay that money... the problem is setting a table to get the setbail command to log the money to the player which i don't now how to do! Please help (im bad at tables :P)

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Tables Help
« Reply #1 on: May 02, 2015, 11:52:48 AM »
Could you explain a bit better what you're asking?
Why do you need a table for this?
bw81@ulysses-forums ~ % whoami
Homepage

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Tables Help
« Reply #2 on: May 02, 2015, 02:19:21 PM »
I'd imagine challenge to someone unfamiliar with tables being grasping the idea to begin with.
No matter where you store the bails (by file or only by memory), it can be hard to grasp.
Say, for example, bail_amounts = { <ply1>.bail_amount = 100, <ply2>.bail_amount = 150, <ply>.bail_amount = 75 }
Where <ply#> could be any unique identifier.
Not everyone is fortunate enough to understand the complex layering tables can do.
bail_amounts{2} would be 150 of course, but, not everyone may understand why.
Unfortunately, I'm not patient enough to teach.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: Tables Help
« Reply #3 on: May 02, 2015, 02:21:59 PM »
I have a friend willing to teach me so i'm good! Thanks tho!