General > Developers Corner

Pointshop

(1/1)

kinkadethegreat:
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?

Zmaster:
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

timer.Create
player.GetAll
Player:IsUserGroup
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
(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
I only have the code for the user group points in that link, because, again, I'm on my phone

Navigation

[0] Message Index

Go to full version