1. Post #1
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts


    Somebody linked me to a version of my old WIP: PointShop that someone had hacked together to make it work for Garry's Mod 13. The code annoyed me so much that my OCD kicked in and it made me finish off the one I'd started during the beta.

    It's working in SP and MP as far as I can see, let me know if there are problems and I'll fix them up. Post suggestions if you like but no promises I'll do any of them.

    Features

    - Recoded from scratch.
    - Item equipping/holstering.
    - Updated GUI.
    - Item customisation (colors only for now).
    - Admin tab for managing players points.
    - Items removed on death or TTT spectate mode, and given back when you spawn again (OnHolster and OnEquip).
    - New item file layout for easier editing and creating.
    - Points given over time (configure in sh_config.lua).

    Media









    Download / Install

    GitHub - https://github.com/adamdburton/pointshop

    Zip - https://github.com/adamdburton/point...ive/master.zip

    Clone or extract the pointshop repo or pointshop-master folder to your addons folder.

    MySQL Synchronisation

    I was originally selling this but I'm just too kind. Anyone who bought it has been refunded. This requires the MySQLOO module installing and a MySQL server that your gameserver(s) can connect to.

    Be VERY cautious letting people set the MySQL stuff up for you. If your MySQL database is set up to allow connections from anywhere (either on purpose or by accident), anyone with the connection details will be able to connect to it. If you get someone to do it for you, make sure you change the password once it's all working.

    GitHub - https://github.com/adamdburton/pointshop-mysql

    Zip - https://github.com/adamdburton/point...ive/master.zip

    Clone or extract the pointshop-mysql repo or pointshop-mysql-master folder to your addons folder and then edit the mysql.lua file with your database info.

    Extra Items

    This is a repository of extra items for PointShop that I or others have made, and are separate to the main repository to keep it clean from models and materials. PM me if you have an item you'd like including. If you're having problems with clients downloading, move the models and materials to the root garrysmod folder, merging them into the existing ones.

    GitHub - https://github.com/adamdburton/pointshop-extras

    Zip - https://github.com/adamdburton/point...ive/master.zip

    Add this as another legacy addon in your addons folder.

    Custom Items

    If you create custom items, make sure the filenames of the lua files don't have spaces or capital letters. The item names can be anything you wish.

    The positions for each item were found with trail and error. There isn't a program to find them for you.

    Item property/function documentation: http://pointshop.burt0n.net/items

    Problems / Suggestions

    Please make sure you're on the latest version before reporting errors.

    Post any issues with the PointShop code (not your custom items) on GitHub: https://github.com/adamdburton/pointshop/issues

    If you have custom items and they're not working, it's not my problem, but feel free to post them here and me or someone else may help you.

    DO NOT ADD ME ON STEAM TO ASK QUESTIONS OR ASK ME TO MAKE SOMETHING, POST IN THE THREAD!

    Donate

    If you would like to support development and make sure I keep this updated with fixes and new features, donating some of your money to me will go a long way to doing that. Receiving donations really inspires me to work more.



    Thanks

    These are people who have helped out with PointShop. Let me know if I've missed you off.

    Matt- - Bug hunting/fixing, code optimisation and a few features!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Lua King x 47Winner x 4Agree x 3Funny x 3Friendly x 3Lua Helper x 2Dumb x 2Informative x 1Artistic x 1Optimistic x 1Useful x 1 (list)

  2. Post #2
    lolipop1113's Avatar
    January 2012
    98 Posts
    Nice thanks !
    Reply With Quote Edit / Delete Canada Show Events Agree Agree x 2 (list)

  3. Post #3
    SWAG KING 2014
    Lebofly's Avatar
    November 2008
    666 Posts
    AWESOME!
    Could you add a timer to give out points every 5 minutes or so?
    Reply With Quote Edit / Delete Windows 8 Australia Show Events Dumb Dumb x 5Agree Agree x 4Zing Zing x 1 (list)

  4. Post #4
    sadow200's Avatar
    August 2010
    27 Posts
    how would i make it so after a amount of time players will gain points?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 7Zing Zing x 1 (list)

  5. Post #5
    It's time to unban Banshee Friend
    Dennab
    April 2011
    5,915 Posts
    There still has to be a better way to put on new hats without just halfassing it every time.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 4 (list)

  6. Post #6
    Heisenberg
    Neddy's Avatar
    March 2005
    4,316 Posts
    Couple of bugs : Trails don't remove on death, Trails don't seem to re-equip on respawn (same with hats i think?) It like acts like its already equiped so you have to holster it then reequip it,

    Otherwise ! Great work

    Edit:

    You can also equip trails when your dead. Also, Is it possible to make the trails update live? Instead of having to wait a whole round ? ( Not sure if this only effects TTT. Maybe as a cvar?)
    Reply With Quote Edit / Delete Windows 7 Show Events Useful Useful x 1 (list)

  7. Post #7
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    Thanks for the reports, looking into them now.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  8. Post #8
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    Couple of bugs : Trails don't remove on death, Trails don't seem to re-equip on respawn (same with hats i think?) It like acts like its already equiped so you have to holster it then reequip it,

    Otherwise ! Great work

    Edit:

    You can also equip trails when your dead. Also, Is it possible to make the trails update live? Instead of having to wait a whole round ? ( Not sure if this only effects TTT. Maybe as a cvar?)
    Right, think I've fixed the problems. I've tested on a dedi server too and it all seems ok. Updated workshop.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Winner Winner x 2Informative Informative x 1 (list)

  9. Post #9

    November 2012
    40 Posts
    I created a workshop.vdf file in \garrysmod of my server.
    The contents of the file are as follows:

    "addons"
    {
    "1" "110131096" // Point Shop
    }


    Though when I press f3 (I also tried all the other function keys just in case, even though it says f3 on the workshop page), the pointshop doesn't appear. Am I missing a step in the installation process. I've restarted the server as well as changed maps since the .vdf was added.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  10. Post #10
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    I created a workshop.vdf file in \garrysmod of my server.
    The contents of the file are as follows:

    "addons"
    {
    "1" "110131096" // Point Shop
    }


    Though when I press f3 (I also tried all the other function keys just in case, even though it says f3 on the workshop page), the pointshop doesn't appear. Am I missing a step in the installation process. I've restarted the server as well as changed maps since the .vdf was added.
    I've just tested this and it seems to work. After restarting the server, do you get a file called ds_110131096.gma in the addons folder on the server? If not, your workshop.vdf file might be dodgy. Try this one: http://puu.sh/1uPD5
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1Disagree Disagree x 1 (list)

  11. Post #11
    SWAG KING 2014
    Lebofly's Avatar
    November 2008
    666 Posts
    Have you added the giving of points once a duration of time has passed?
    Reply With Quote Edit / Delete Windows 8 Australia Show Events Dumb Dumb x 3 (list)

  12. Post #12
    RockstarC's Avatar
    November 2012
    175 Posts
    Nice, The new update for the shop won't open on my server
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Informative Informative x 1Dumb Dumb x 1 (list)

  13. Post #13

    October 2012
    14 Posts
    Do you plan on releasing it in a .zip or something? I'm quite a fan of this pointshop, being one of the only working ones, but I to have the actual files.
    Reply With Quote Edit / Delete Windows Vista United States Show Events Dumb Dumb x 1 (list)

  14. Post #14
    itkuitkzhji's Avatar
    April 2012
    92 Posts
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Informative Informative x 1 (list)

  15. Post #15

    November 2012
    40 Posts
    So, I still wasn't able to open your pointshop, but I decided I wanted to add something else to my workshop.vdf file, so I made a row for it and kept the pointshop. Upon doing this, the pointshop now works (though the second addon didn't install now >.<) Now I was just wondering how to get/give points, I tried the command from your old pointshop but that didn't work.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  16. Post #16
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    So, I still wasn't able to open your pointshop, but I decided I wanted to add something else to my workshop.vdf file, so I made a row for it and kept the pointshop. Upon doing this, the pointshop now works (though the second addon didn't install now >.<) Now I was just wondering how to get/give points, I tried the command from your old pointshop but that didn't work.
    I've just pushed a new version with an admin tab for setting/giving/taking points :)
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Winner Winner x 4Friendly Friendly x 1 (list)

  17. Post #17

    November 2012
    40 Posts
    Awesome. Is it up on workshop yet? If so I don't think my files are auto updating and I'll have to fix it
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  18. Post #18
    RockstarC's Avatar
    November 2012
    175 Posts
    Awesome. Is it up on workshop yet? If so I don't think my files are auto updating and I'll have to fix it
    Make sure you subscribe to the workshop
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  19. Post #19

    November 2012
    40 Posts
    Make sure you subscribe to the workshop
    I am subscribed, the workshop.vdf file just seems screwy
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  20. Post #20
    SWAG KING 2014
    Lebofly's Avatar
    November 2008
    666 Posts
    -Snip-
    Reply With Quote Edit / Delete Windows 8 Australia Show Events Informative Informative x 1 (list)

  21. Post #21

    November 2012
    40 Posts
    It's been working well now thanks _Undefined :D Is there a way to make it so only superadmin can access the admin tab?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  22. Post #22
    Gold Member

    December 2011
    125 Posts
    I get spammed this in errors,

    [ERROR] lua/cl_pointshop.lua:95: attempt to index local 'attach' (a nil value)
    1. fn - lua/cl_pointshop.lua:95
    2. unknown - addons/ulib/lua/ulib/shared/hook.lua:168


    [ERROR] lua/cl_pointshop.lua:95: attempt to index local 'attach' (a nil value)
    1. fn - lua/cl_pointshop.lua:95
    2. unknown - addons/ulib/lua/ulib/shared/hook.lua:168


    Not to mention could you upload just the add-on on media fire or something?
    I prefer it over this new system.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  23. Post #23
    I call in friends to rate KatNotDinner dumb (lol)
    nick_9_8's Avatar
    December 2011
    1,651 Posts
    Could you make an admin command which gives points to a STEAM ID so that when they join the points are credited?

    That way donation systems and that sorta bullshit can be done.
    Reply With Quote Edit / Delete Australia Show Events

  24. Post #24
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    Could you make an admin command which gives points to a STEAM ID so that when they join the points are credited?

    That way donation systems and that sorta bullshit can be done.
    It can be done but I aren't going to do it unless you pay me. I've been generous enough to the community now.
    Reply With Quote Edit / Delete United Kingdom Show Events Agree x 6Dumb x 2Useful x 1Optimistic x 1Funny x 1Winner x 1 (list)

  25. Post #25
    I call in friends to rate KatNotDinner dumb (lol)
    nick_9_8's Avatar
    December 2011
    1,651 Posts
    Fair enough. You are a generous soul :D
    Reply With Quote Edit / Delete Australia Show Events

  26. Post #26

    September 2012
    52 Posts
    Looks great for a start. few thing i like to see before i add to my sever.
    1. access to the admin menu for superadmins only (sure theres a simple fix for this i could do myself)
    2. Playermodel Tab
    3. few extra stuff such as the armor from the old version as guide lines for new custom content. - Not too important

    i have tryed merging code from the old pointshop into this one for player models with half success, the tab is there with the models on view however they do not work, tryed adding the function from the new items however that came up with a error.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  27. Post #27
    I call in friends to rate KatNotDinner dumb (lol)
    nick_9_8's Avatar
    December 2011
    1,651 Posts
    Lol for 1. Find where it says IsAdmin() and change it to IsSuperAdmin().

    Also, I don't know if you're reading this thread with a blindfold, but read his post just above mine.
    Reply With Quote Edit / Delete Australia Show Events

  28. Post #28

    September 2012
    52 Posts
    the second part of your post was unessary. at no point did undefined say he was stopping development of this addon. there for giving him some info on what people would like to see has no negative sides. i did not demand him to add these features.
    and also it does say in his main post to post suggestions. so i think if anyone is reading this with a blindfold it would be you.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  29. Post #29

    November 2012
    40 Posts
    Lol for 1. Find where it says IsAdmin() and change it to IsSuperAdmin().

    Also, I don't know if you're reading this thread with a blindfold, but read his post just above mine.
    He may also be a noob like me and not know how to get to that portion of the files to edit it since it's on steam workshop :P
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  30. Post #30

    September 2012
    52 Posts
    you can download a unpacker to open the workshop files. I use gmad and it has never faulted me, sorry i cant provide a link as i downloaded a while ago. however it will be on the forums somewhere.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  31. Post #31
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    Sneak peek!

    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Lua King Lua King x 6Artistic Artistic x 1Optimistic Optimistic x 1Winner Winner x 1 (list)

  32. Post #32
    Gold Member
    Crap-Head's Avatar
    May 2010
    409 Posts
    Would be a pretty neat feature if you added an option to switch to use TMySQL4 instead of using sv.db to save data in.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Artistic Artistic x 1 (list)

  33. Post #33
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    Would be a pretty neat feature if you added an option to switch to use TMySQL4 instead of using sv.db to save data in.
    I'll look into this.
    Reply With Quote Edit / Delete United Kingdom Show Events

  34. Post #34

    September 2012
    52 Posts
    When will That Update Be Ready? Look Forward to the extra's.

    Also how do you get the pos of hats right, do you use a program or just guess then adjust?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  35. Post #35
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    Just pushed the new update.

    + Trail color customisation.
    + Playermodels.

    Edited:

    Also how do you get the pos of hats right, do you use a program or just guess then adjust?
    Guesswork. Although all the current ones were done for the old version.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  36. Post #36

    September 2012
    52 Posts
    Ah ok< nice work on the update. can use on my server to replace the old one.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  37. Post #37

    October 2012
    110 Posts
    How could i make it so for example after 5 minutes a user would gain 5 points?
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  38. Post #38
    CoderHire
    _Undefined's Avatar
    November 2007
    1,466 Posts
    How could i make it so for example after 5 minutes a user would gain 5 points?
    local delay_in_minutes = 5 -- How many minutes between giving points?
    local points_to_give = 5 -- How many points to give
    
    
    hook.Add('PlayerInitialSpawn', 'PS_PointsTimer', function(ply)
    	timer.Create('PS_Timer_' .. ply:UniqueID(), delay_in_minutes * 60, 0, function()
    		ply:PS_GivePoints(points_to_give)
    		ply:PS_Notify("You've been given " .. points_to_give .. " for playing on the server!")
    	end)
    end)
    
    
    hook.Add('PlayerDisconnected', 'PS_PointsTimer_PlayerDisconnected', function(ply)
    	if timer.Exists('PS_Timer_' .. ply:UniqueID()) then
    		timer.Destroy('PS_Timer_' .. ply:UniqueID())
    	end
    end)
    
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1Lua Helper Lua Helper x 1 (list)

  39. Post #39

    October 2012
    110 Posts
    Where do i put this?
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Winner Winner x 2 (list)

  40. Post #40
    We Are No Idiots
    Aide's Avatar
    March 2010
    4,644 Posts
    local delay_in_minutes = 5 --  How many minutes between giving points?
    local points_to_give = 5 -- How many points to give
    
    hook.Add('PlayerInitialSpawn', 'PS_PointsTimer', function(ply)
    	timer.Create('PS_Timer_' .. ply:UniqueID(), delay_in_minutes * 60, 0, function()
    		ply:PS_GivePoints(points_to_give)
    		ply:PS_Notify("You've been given " .. points_to_give .. " for playing on the server!")
    	end)
    end)
    
    Where's timer.Destroy? What you gonna do when the player leaves and it spams errors.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 3Informative Informative x 1 (list)