1. Post #1
    Reply With Quote Edit / Delete United Kingdom Show Events Lua King x 43Artistic x 9Dumb x 3Friendly x 3Winner x 2Optimistic x 2Zing x 2Late x 2Agree x 1Disagree x 1 (list)

  2. Post #2
    Gold Member

    April 2009
    721 Posts
    Looks good :)
    Reply With Quote Edit / Delete Denmark Show Events Agree Agree x 5Dumb Dumb x 2 (list)

  3. Post #3
    Friendly Member :3
    haydenbinkley's Avatar
    February 2009
    453 Posts
    Would this work on other gamemodes? Also How would I change the default key to something else?
    Reply With Quote Edit / Delete United States Show Events Dumb Dumb x 5Artistic Artistic x 1Informative Informative x 1Agree Agree x 1 (list)

  4. Post #4
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Yes, it should be gamemode independent. Change the key in sh_config.lua.
    Reply With Quote Edit / Delete United Kingdom Show Events Friendly x 2Useful x 2Optimistic x 1Dumb x 1Lua King x 1 (list)

  5. Post #5
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    Hey, if I wanted to make something admin buyable, how would I go about doing that? Also wonderful mod, easier to use then the other one.

    Thank's in advance.
    Reply With Quote Edit / Delete United States Show Events Funny Funny x 1 (list)

  6. Post #6
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Add a function under an items 'Functions', like so:

    Functions = {
    	CanPlayerBuy = function(ply)
    		if ply:IsAdmin() then
    			return true, ""
    		end
    		return false, "Only admins can buy this!"
    	end
    }
    

    Use that for now, and I'll add an option to make each item admin only.
    Reply With Quote Edit / Delete United Kingdom Show Events Friendly x 4Dumb x 3Lua King x 2Lua Helper x 1Funny x 1Agree x 1 (list)

  7. Post #7
    Slaaf van EternalFlamez.Ik wilde heel graag de laatste Indie Bundle, en ik kreeg deze kuttitel er gratis bij.
    Staneh's Avatar
    March 2010
    3,976 Posts
    Looking good. I might even use it.
    Reply With Quote Edit / Delete Netherlands Show Events Dumb x 3Winner x 1Agree x 1Informative x 1Disagree x 1 (list)

  8. Post #8
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    Add a function under an items 'Functions', like so:


    Use that for now, and I'll add an option to make each item admin only.
    Awesome, thank you!
    Reply With Quote Edit / Delete United States Show Events Optimistic Optimistic x 1Agree Agree x 1 (list)

  9. Post #9
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Updated. The headcrab hat is admin only as an example. Few things in the OP which I will add later.
    Reply With Quote Edit / Delete United Kingdom Show Events Useful Useful x 1Optimistic Optimistic x 1Lua King Lua King x 1 (list)

  10. Post #10
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    Add a function under an items 'Functions', like so:

    Functions = {
    	CanPlayerBuy = function(ply)
    		if ply:IsAdmin() then
    			return true, ""
    		end
    		return false, "Only admins can buy this!"
    	end
    }
    

    Use that for now, and I'll add an option to make each item admin only.
    Functions = {
        CanPlayerBuy = function( ply )
            return ply:IsAdmin(), ply:IsAdmin() and "" or "Only admins can buy this!"
        end
    }
    Reply With Quote Edit / Delete Netherlands Show Events Dumb x 5Lua King x 5Friendly x 2Funny x 1Lua Helper x 1 (list)

  11. Post #11
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Sexy.
    Reply With Quote Edit / Delete United Kingdom Show Events Funny Funny x 2Agree Agree x 2Lua King Lua King x 1Dumb Dumb x 1 (list)

  12. Post #12
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    [addons\pointmod\lua\sv_pointshop.lua:76] attempt to call method 'admin' (a nil value)
    I keep getting this error when trying to buy an admin only item...
    Reply With Quote Edit / Delete United States Show Events Late Late x 2 (list)

  13. Post #13
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Does your line 76 look like this?

    if item.AdminOnly and not ply:IsAdmin() then
    Reply With Quote Edit / Delete United Kingdom Show Events Agree Agree x 1 (list)

  14. Post #14
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    if item.AdminOnly and not ply:admin() then

    I'm using ulx, I don't know if that makes a difference.
    Reply With Quote Edit / Delete United States Show Events

  15. Post #15
    Gold Member
    Entoros's Avatar
    October 2008
    2,318 Posts
    On the inventory panel with all the items (the turtle, the frying pan, etc.) I wouldn't have every single item rotating at the same time -- it's a little overwhelming and doesn't serve much of a purpose. Rather, if you wanted to use that effect it would look better to make it so the item rotates whenever you hover over the item -- essentially, transform the rotation animation into a hover state.
    Reply With Quote Edit / Delete United States Show Events Friendly Friendly x 2 (list)

  16. Post #16
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    I figured it out!

    if item.AdminOnly and not ply:admin() then

    Should be
    if item.AdminOnly and not ply:IsAdmin() then

    OOOOhhh... I read yours wrong, that could've saved me loads of time... Now I feel dumb.

    Edit:

    Hey I am getting another error, when I buy something it says
    "[PS] -0 points!" and takes away all of my points. The item was worth 15, but it took away 21.
    Reply With Quote Edit / Delete United States Show Events Useful Useful x 3Dumb Dumb x 3 (list)

  17. Post #17
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Updated. See OP for new image. Also should have fixed DarkRP problems, if someone could test and let me know.

    If people have added the functions provided in this to their gamemode etc, please update them to include the PS_ prefix, for example, ply:GivePoints() is now ply:PS_GivePoints().
    Reply With Quote Edit / Delete United Kingdom Show Events Useful Useful x 2 (list)

  18. Post #18
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    Updated. See OP for new image. Also should have fixed DarkRP problems, if someone could test and let me know.

    If people have added the functions provided in this to their gamemode etc, please update them to include the PS_ prefix, for example, ply:GivePoints() is now ply:PS_GivePoints().
    For some reason I can't open the shop any more. I can still get points, but when I press F2 (the key I use) the shop won't even, I tried changing it to F3, and then F4, but it didn't work.
    Reply With Quote Edit / Delete United States Show Events

  19. Post #19
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    No errors?
    Reply With Quote Edit / Delete United Kingdom Show Events

  20. Post #20
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    No errors?
    None
    Reply With Quote Edit / Delete United States Show Events

  21. Post #21
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Strange. Could you try moving the addon folder and redownloading from svn to make sure its not corrupt or something?
    Reply With Quote Edit / Delete United Kingdom Show Events

  22. Post #22
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    Strange. Could you try moving the addon folder and redownloading from svn to make sure its not corrupt or something?
    Sure hold on...



    Well that sucks, guess it did. Hopefully I can move over all my items though...
    Reply With Quote Edit / Delete United States Show Events

  23. Post #23
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Very strange. I'm going to make it easier to add/remove items shortly, with a folder of files rather than a table in one file, so people can drag and drop items.
    Reply With Quote Edit / Delete United Kingdom Show Events

  24. Post #24
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    I was able to move over the items without any problems. I wonder what broke it. Anyways this update is pretty kickass. Like how the hats and stuff now spin when you hover over them instead of like before when they just spun.

    Nice job! Can't wait to see more updates.
    Reply With Quote Edit / Delete United States Show Events

  25. Post #25
    dooboo2's Avatar
    January 2010
    80 Posts
    Are we going to be able to do this:

    Functions = {
        Draw = function(self)
            self:DrawModel()
        end
    }
    
    Reply With Quote Edit / Delete United States Show Events

  26. Post #26
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    To draw for the item in the shop or in the world?
    Reply With Quote Edit / Delete United Kingdom Show Events

  27. Post #27
    ryanfilps's Avatar
    October 2007
    37 Posts
    Sweet ill give this a go on my server see if it works now :)
    Reply With Quote Edit / Delete United Kingdom Show Events

  28. Post #28
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    More errors, now when I try to buy something from the shop (I tried a clean install without changing anything, didn't work) I get this error where there is no limit on how many items:

    [addons\pointmod\lua\sv_pointshop.lua:100] attempt to call method 'GiveItem' (a nil value)

    And this when there is a limit on how many items you can own:

    addons\pointmod\lua\sv_pointshop.lua:90] attempt to call method 'NumItemsFromCategory' (a nil value)

    Here is the function for line 100:

    	ply:GiveItem(item_id, true)
    end)

    And for 90:
    	if category.NumAllowedItems and ply:NumItemsFromCategory(category) >= category.NumAllowedItems then -- More than would never happen, but just incase.
    		ply:PS_Notify('You can only have ' .. category.NumAllowedItems .. ' items from the ' .. category.Name .. ' category!')
    		return
    	end

    I should also note that this error prevents items from spawning/working.
    Reply With Quote Edit / Delete United States Show Events

  29. Post #29
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Fixed, thanks.
    Reply With Quote Edit / Delete United Kingdom Show Events Friendly Friendly x 1 (list)

  30. Post #30
    Working with MySQL?
    Reply With Quote Edit / Delete Germany Show Events Dumb Dumb x 1 (list)

  31. Post #31
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Not yet. Will do it tomorrow.
    Reply With Quote Edit / Delete United Kingdom Show Events

  32. Post #32
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    Hey I am still getting this error, when I buy something it says
    "[PS] -0 points!" and takes away all of my points. The item was worth 15, but it took away 21. It is doing this with all of the items. No error messages in console.
    Reply With Quote Edit / Delete United States Show Events

  33. Post #33
    isgarrysmodbroken.com
    _Undefined's Avatar
    November 2007
    1,082 Posts
    Try that, should be fixed, was a typo.
    Reply With Quote Edit / Delete United Kingdom Show Events Friendly Friendly x 1 (list)

  34. Post #34
    Gold Member
    quacles's Avatar
    December 2006
    930 Posts
    Try that, should be fixed, was a typo.
    Alright, it's fixed!
    Reply With Quote Edit / Delete United States Show Events

  35. Post #35
    tgp1994's Avatar
    August 2008
    1,177 Posts
    Can't wait for the MySQL capability :) Are you sure you don't want my script, _Undefined?
    Reply With Quote Edit / Delete United States Show Events

  36. Post #36
    Awesome, this is way better with mysql. Was waiting for gbps script, but it looks like he lost it in a hdd crash.
    Reply With Quote Edit / Delete Germany Show Events

  37. Post #37
    Gold Banana
    Banana Lord.'s Avatar
    May 2010
    5,271 Posts
    -snip-

    HURR, im dumb

    Edited:

    Timer error: @lua/includes/modules/glon.lua:381 expected string to decode! (Got type table)

    Just using the normal time-point system.
    Reply With Quote Edit / Delete United States Show Events

  38. Post #38
    Friendly Member :3
    haydenbinkley's Avatar
    February 2009
    453 Posts
    Anyone know how I could give me myself money or can you not?
    Reply With Quote Edit / Delete United States Show Events

  39. Post #39
    tgp1994's Avatar
    August 2008
    1,177 Posts
    Anyone know how I could give me myself money or can you not?
    ps_givemoney playername money, if I recall correctly.
    Reply With Quote Edit / Delete United States Show Events Disagree Disagree x 3 (list)

  40. Post #40
    Friendly Member :3
    haydenbinkley's Avatar
    February 2009
    453 Posts
    ps_givemoney playername money, if I recall correctly.
    Did not work.
    Reply With Quote Edit / Delete United States Show Events