Author Topic: Cash System?  (Read 13002 times)

0 Members and 1 Guest are viewing this topic.

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Cash System?
« on: June 19, 2007, 06:03:07 PM »
If it would be possible, can you add a cash system? Like, everyone starts with 200 credits, and use commands like !give name ammount, and stuff like that.

The most important part, It would also be able to save the ammount of credits you have from restart to restart, by SteamID.

Also, SuperAdmins would be able to use commands like !reward name ammount to create cash out of thin air.

The reson for this, is that the resource distribution mod makes it possible to sell resources, or just take one resource and convert it to another. Due to this, a money system would be needed so that players can have something that they can hold from restart to restart. Sure, they can just trade in resources alone, but a server crash, or connection failure, could erase all that hard work.

Further more, I hold many fun events on the server, be it arena style deathmatches, races, or other events, and the rewards are typically things like, an admin only swep, 10,000 health, or other things like that. People don't participate in these events much, because they know that they will lose their prize relativly quickly.

With this, I can award stuff like 10,000 credits to the grand winner of a racing tourament! Or other fun things like that.

While not nessicary to controlling a server, it can certainly increase the popularity of a server.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Cash System?
« Reply #1 on: June 19, 2007, 06:42:36 PM »
Yeah, perhaps I could work on something like this if I get bored :P


Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Cash System?
« Reply #2 on: June 19, 2007, 07:48:07 PM »
Oh, please! The guys on the server are ESTATIC! Im already writing down money awards I owe people.

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Cash System?
« Reply #3 on: June 19, 2007, 08:06:04 PM »
Oh yeah, and a !steal name ammount command for superadmins. Basically, you can say "If you don't stop minging around, I'll take back that money!"

Of course, it's not 100% needed. You can always cexec them into saying !give tomatosoup 10000

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Cash System?
« Reply #4 on: June 20, 2007, 12:36:40 PM »
Don't most RP mods do this already?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Cash System?
« Reply #5 on: June 20, 2007, 06:20:43 PM »
No, atleast, there not controlled enough.

And they don't save between restarts, which is exactly what I requested.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Cash System?
« Reply #6 on: June 20, 2007, 07:34:15 PM »
I'll probably work on this today methinks.


Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Cash System?
« Reply #7 on: June 20, 2007, 09:13:44 PM »
The majority is done, wasn;t too hard. I like coding :)
So far, I have it storing and loading cash, saved by steam id.

I started working on allowing people to add cash to other players, but ran into a small roadblock.
It works like this:
!gcash give golden 10

New problem: ply:SteamID() seems to return nill at times. Because it sucks major butt.
« Last Edit: June 20, 2007, 11:57:57 PM by Golden-Death »


Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Cash System?
« Reply #8 on: June 21, 2007, 06:11:34 AM »
No problem with the !gcash give thing, even if it's like !scash steal, and !acash award.

Offline TomatoSoup

  • Newbie
  • *
  • Posts: 40
  • Karma: 3
Re: Cash System?
« Reply #9 on: June 21, 2007, 09:01:58 AM »
Also needs a !money command, something that will show you how much cash you have.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Cash System?
« Reply #10 on: June 21, 2007, 03:03:49 PM »
Nice Golden-death.

TomotoSoup, I'm thinking most/all commands will be prefixed with gcash (I could be wrong)
!gcash give
!gcash take
!gcash help

Right Golden-death?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Cash System?
« Reply #11 on: June 21, 2007, 04:44:06 PM »
righto. If I can ever fix the steamid problem


Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Cash System?
« Reply #12 on: June 21, 2007, 10:14:52 PM »
Made a lot of progress so far. One thing you have to realize tho, is that money is entirely pointless without stuff to use it on.

I'm guessing you just wanted to have players be able to buy sweps? Because everything you want to use the money for has to be coded.

Commands working perfectly atm:
!gcash take
!gcash award
!gcash list
!gcash help

!gcash give is having a problem comparing a number to a string.   :-\

Once that's solved, it's pretty much done. Oh, should I display the cash on the HUD permanently, or make a chat command to check it?
« Last Edit: June 21, 2007, 10:42:44 PM by Golden-Death »


Offline atomicspark

  • Full Member
  • ***
  • Posts: 196
  • Karma: 12
Re: Cash System?
« Reply #13 on: June 21, 2007, 11:59:06 PM »
No, atleast, there not controlled enough.

And they don't save between restarts, which is exactly what I requested.

There is a SQLite version of LightRP. It saves players' money, names, jobs, and teams--Even when they're gone! Find it here.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Cash System?
« Reply #14 on: June 22, 2007, 12:57:24 AM »
True, but I myself never was a fan of RP systems.

In any case.