1. Post #1

    December 2010
    111 Posts
    I use a custom revision of the WIP Pointshop revision 61. I am trying to do two things.
    First I want only "owner" ranked person to be able to manipulate points. There are two owners, myself and another.
    Secondly I want to make the premade admin only function (that makes some items in the shop admin only) to be admin AND vip only. I have 3 VIP ranks. VIP, VIP mod, and VIP admin.

    Here is my code for setting points. it was set to ply:IsAdmin(), but i changed it to the following:

    Code:
    concommand.Add("ps_setpoints", function(ply, cmd, args)
    	-- Set Points
    	if not ply:GetUserGroup() == "owner" then return end
    Heres the code for admin only items

    Code:
    	if item.AdminOnly and not ply:IsAdmin() and not ply:GetUserGroup() == "vip" and not ply:GetUserGroup() == "vip admin" and not ply:GetUserGroup() == "vip mod" then
    		ply:PS_Notify('Only admins and VIPs can buy this item!')
    		return
    	end
    I then tested this myself by going in game and switching my ranks around with rcon.
    With all ranks, even "regulars" and user, I could buy the VIP/Admin only items, and could still set points as any rank

    Anyone see the issue here? Thanks everyone!

    (User was banned for this post ("Wrong section, still not learning" - Gran PC))
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  2. Post #2
    Gold Member
    Donkie's Avatar
    July 2009
    1,252 Posts
    Debug it!
    Do print(ply:GetUserGroup()). What does it give you?
    Reply With Quote Edit / Delete Windows Vista Sweden Show Events

  3. Post #3

    December 2010
    111 Posts
    I'm not sure how to degub with that command. I used:" ulx rcon lua_run(_cl) print(ply:GetUserGroup()) "
    but it returned with nothing.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 1 (list)

  4. Post #4
    Gold Member
    Donkie's Avatar
    July 2009
    1,252 Posts
    Test the stuff you code on singleplayer, then use the lua_run commands directly, and not through ulx rcon.
    Oh and, I ment that you should put that inside the code, and not through lua_run
    Reply With Quote Edit / Delete Windows Vista Sweden Show Events

  5. Post #5
    Juze's Avatar
    November 2011
    57 Posts
    rcon lua_run print(ply:GetUserGroup())
    ulx rcon lua_run print(ply:GetUserGroup())
    ulx luarun print(ply:GetUserGroup())

    They all work, makes more sense to me than doing in singleplayer.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events