Ulysses

General => Developers Corner => Topic started by: kinkadethegreat on May 10, 2015, 02:32:31 PM

Title: Pointshop
Post by: kinkadethegreat on May 10, 2015, 02:32:31 PM
Hey i want to have it so that my basic user group gets 5 points per 10 mins, but than I also want my members group to get 10 points per 5 mins. How could i go about making this work?
Title: Re: Pointshop
Post by: Zmaster on May 10, 2015, 03:38:49 PM
I'm 99% sure PS isn't that advanced in terms of timed point distribution, so you'd have to make it in your own script

I'd first start by disabling the giving of points over time in the PS configuration so you handle it all yourself

Then make a Lua file in garrysmod/lua/autorun/server

I'm assuming you don't know much about Lua considering this would be fairly easy, so if you want to figure it out yourself with some help, here's what you would use

(http://wiki.garrysmod.com/favicon.ico) timer.Create (http://wiki.garrysmod.com/page/timer/Create)
(http://wiki.garrysmod.com/favicon.ico) player.GetAll (http://wiki.garrysmod.com/page/player/GetAll)
(http://wiki.garrysmod.com/favicon.ico) Player:IsUserGroup (http://wiki.garrysmod.com/page/Player/IsUserGroup)
http://pointshop.burt0n.net/player-meta-functions/points#give-points (http://pointshop.burt0n.net/player-meta-functions/points#give-points)
And if you want to notify the player of the received points, use this:
http://pointshop.burt0n.net/player-meta-functions/utilities#notify (http://pointshop.burt0n.net/player-meta-functions/utilities#notify)
(I won't have that in my "cheat" code since I'm typing this on my phone and don't feel like working with net messages on this phone)

If you just wanna cheat it, here's how I would do it
http://pastebin.com/rgC4CmLx (http://pastebin.com/rgC4CmLx)
I only have the code for the user group points in that link, because, again, I'm on my phone