ULX

Author Topic: Premium Features..  (Read 3260 times)

0 Members and 1 Guest are viewing this topic.

Offline Mindless

  • Newbie
  • *
  • Posts: 31
  • Karma: 1
Premium Features..
« on: February 07, 2013, 09:51:58 AM »
Right, i'm here seeking help and getting started in coding a premium system or features for players. Basically I need stuff like ex:

- Premium Tag
- Premium Chat (Only talk between premium members (# <msg)
- Annoucements on connection (First a message will appear in center of screen saying: "Welcome <name>" then after fifteen seconds it will say "Welcome back, <name>" to everyone.
- Extra Props = 100 more.

How would I start off making a system like this - i'm not a perfect coder and I want to know if its possible, and if anyone is willing to help. Yes this will Ulysses group system. But I would like commands such as:

ulx premium [name] [days]

Then after those 30 days it would expire and they wouldn't get it.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Premium Features..
« Reply #1 on: February 07, 2013, 02:30:39 PM »
Well, the best starting place to look for me was at existing code.
ULX already does the 'basic' two features below.
"premium' chat - Look for ULX's chat code, specifically function ulx.asay I think.
 Typing ulx asay <text> in console or @ <text> in chat will only type to those ULX groups who have operator/admin or superadmin (or inherit those)

Announcements - though we don't have a welcome back, upon join, ULX does offer a 'welcome' message.
I'm pretty sure it uses the PlayerSpawn hook.

As for the others, there are several chat tag discussions (and even a release I think) on the forum, and URS might be a good place to look at how he originally planned to go past prop limits.


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

Offline Mindless

  • Newbie
  • *
  • Posts: 31
  • Karma: 1
Re: Premium Features..
« Reply #2 on: February 07, 2013, 09:32:41 PM »
Well, the best starting place to look for me was at existing code.
ULX already does the 'basic' two features below.
"premium' chat - Look for ULX's chat code, specifically function ulx.asay I think.
 Typing ulx asay <text> in console or @ <text> in chat will only type to those ULX groups who have operator/admin or superadmin (or inherit those)

Announcements - though we don't have a welcome back, upon join, ULX does offer a 'welcome' message.
I'm pretty sure it uses the PlayerSpawn hook.

As for the others, there are several chat tag discussions (and even a release I think) on the forum, and URS might be a good place to look at how he originally planned to go past prop limits.

Where can I find the thing for ulx asay?

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Premium Features..
« Reply #3 on: February 08, 2013, 01:25:37 AM »
What do you mean by "find" ulx asay. Do you mean like how to use it, if that's the case than just type !menu or !xgui and go to Chat and ulx asay to use it. If you were talking about like the code to it, I saw it recently after looking through almost all of the ulx code (I don't think I saw it in ulib, I know for a fact it's not in there actually.), so I could possibly find it but I think it would be better and faster if Sticky, JamminR, or Megiddo to help you with that.  :p

Edit:
lol right before I was about to turn off both of my computers, I was like... wait why would I even suspect ulx asay would be in ulib, ulib is just for UCL..




Another thing I want to add is this too:

- Premium Tag
- Premium Chat (Only talk between premium members (# <msg)
- Annoucements on connection (First a message will appear in center of screen saying: "Welcome <name>" then after fifteen seconds it will say "Welcome back, <name>" to everyone.
- Extra Props = 100 more.

This is very much possible, and I think you could do it yourself, seeing as "you did create your very own" player join/leave and !join script (which i fixed :p), it wouldn't be that hard to do, just a lot of if statements in my head... ugh... if statements, anyways.


ulx premium [name] [days]

Then after those 30 days it would expire and they wouldn't get it.

This is the part that I feel a lot of people would get stuck at, because I mean I personally don't know how to do this, I would just try to find the banning script, and re modify it to this.
« Last Edit: February 08, 2013, 01:45:32 AM by chaos13125 »
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: Premium Features..
« Reply #4 on: February 08, 2013, 08:25:39 AM »
This is the part that I feel a lot of people would get stuck at, because I mean I personally don't know how to do this, I would just try to find the banning script, and re modify it to this.

You could save a list of users and the time they have left for premium in a text file, or you can even save them in the sv.db using SetPData and GetPData. (You will probably have to use timers.)
I cry every time I see that I am not a respected member of this community.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Premium Features..
« Reply #5 on: February 08, 2013, 09:52:21 AM »
You could save a list of users and the time they have left for premium in a text file, or you can even save them in the sv.db using SetPData and GetPData. (You will probably have to use timers.)


I can already see a lot of "thinks" visioning it... Well he could do that, but I doubt it will come to that. I also don't know a lot about the MySQL lite for Garry's mod
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Premium Features..
« Reply #6 on: February 08, 2013, 10:14:36 AM »
There's already an AutoPromote addon on here that can be used to temporarily set the group of someone to say "Promoted".

As for ulx asay, there's an access string "ulx seeasay" (or something like that) that if a group has access to it, they can see any asay chat. So, in a nutshell-- If a group has permission to the command "ulx asay" command, then they have permission to send messages to all users that are in groups that have access to "ulx seeasay".
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Premium Features..
« Reply #7 on: February 08, 2013, 02:51:26 PM »
getting started in coding
<clip>
What do you mean by "find" ulx asay?
I thought he was wanting to know how to code all this???
You two are gonna confuse the heck out of him.
Looking at XGUI or 'ulx help' from within the game won't help Mindless code one bit at this point in time.
He'd have to look at our actual coding to learn from it.

Mindless, you need to look at the actual lua files, looking for the function called ulx.asay.
If you don't know what to look for after that clue, well, you're really not near a starting point yet to even do your ideas... you need to 'learn' how lua functions/code work first. :)
« Last Edit: February 08, 2013, 02:54:22 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming