ULX

Recent Posts

Pages: 1 ... 4 5 [6] 7 8 ... 10
51
In addition to using "pl" or "ply" (the latter usually being the most common), one note I will mention as to why the original doesn't work is because "Player" in the global namescape refers to Global.Player which is a function (hence the error mentioning "a function value"). The wiki page for GM:PlayerSpawn takes a "Player player" parameter, which can be confusing for those new to Lua. The capitalized "Player" in this case is referring to something that belongs to the Player "class" (quote because Lua has class-like structures but does not technically have classes). However, the engine automatically passes an object that is a part of that class for use within the hook (but the name, like all variables, can be just about anything).
52
Time seems to fly differently for you, given October 2019 was only 3 years ago.

If I may share my own, I've been listening to this song non-stop: https://youtu.be/HPdHkHslFIU
53
General Chat & Help and Support / ulx motd error
« Last post by Mike H. 2L-247 on July 08, 2022, 04:21:25 PM »
steam went down last night and when it cam back i have gotten that error using ulx.. the problem is i unsubscribed then redsubbed and i keep getting that error its a settings thing just not sure how to fix it
54
Not within ULX, no.
55
General Chat & Help and Support / Solved
« Last post by [SR] Devaso on June 26, 2022, 04:20:54 PM »
Problem Solved
Post can be Deleted
56
Releases / Re: Player Chat Tags [2.58v]
« Last post by [GL] David on June 21, 2022, 12:54:28 AM »
When I /advert and // (/ooc) It will not show the [Advert] or [OOC]!\

Is there a fix for this?
57
General Chat & Help and Support / Chat indicators Images to text
« Last post by Shotz on June 12, 2022, 05:13:01 AM »
Would anyone know how to change the chat Indicators to text instead of an image?

Code: [Select]
local function drawIndicator(ply)
    if not ply:IsTyping() then
        if ply.indicator then
            ply.indicator:Remove()
            ply.indicator = nil
        end
        return
    end

    local indicator = ply.indicator
    if not IsValid(indicator) then
        indicator = ClientsideModel("models/extras/info_speech.mdl", RENDERGROUP_OPAQUE)
        if not IsValid(indicator) then return end -- In case the non networked entity limit is hit (still prints a red error message, but doesn't spam client console with lua errors)
        ply.indicator = indicator
    end
    indicator:SetNoDraw(true)
    indicator:SetModelScale(0.6)

    local ragdoll = ply:GetRagdollEntity()
    if IsValid(ragdoll) then
        local maxs = ragdoll:OBBMaxs()
        indicator:SetPos(ragdoll:GetPos() + Vector(0, 0, maxs.z) + Vector(0, 0, 12))
    else
        indicator:SetPos(ply:GetPos() + Vector(0, 0, 72 * ply:GetModelScale()) + Vector(0, 0, 12))
    end

    local curTime = CurTime()
    local angle = indicator:GetAngles()
    angle.y = (angle.y + (360 * (curTime - (indicator.lastDraw or 0)))) % 360
    indicator:SetAngles(angle)
    indicator.lastDraw = curTime

    indicator:SetupBones()
    indicator:DrawModel()
end

hook.Add("PostPlayerDraw", "DarkRP_ChatIndicator", drawIndicator)
hook.Add("CreateClientsideRagdoll", "DarkRP_ChatIndicator", function(ent, ragdoll)
    if not ent:IsPlayer() then return end

    local oldRenderOverride = ragdoll.RenderOverride -- Just in case - best be safe
    ragdoll.RenderOverride = function(self)
        if ent:IsValid() then
            drawIndicator(ent)
        end

        if oldRenderOverride then
            oldRenderOverride(self)
        else
            self:DrawModel()
        end
    end
end)

-- CSEnts aren't GC'd.
-- https://github.com/Facepunch/garrysmod-issues/issues/1387
gameevent.Listen("player_disconnect")
hook.Add("player_disconnect", "DarkRP_ChatIndicator", function(data)
    local ply = Player(data.userid)

    if not IsValid(ply) then return end -- disconnected while joining

    if ply.indicator then
        ply.indicator:Remove()
        ply.indicator = nil
    end
end)

58
General Chat & Help and Support / Re: ULX Group help
« Last post by Shotz on June 10, 2022, 01:28:04 AM »
This is the code I need to use to restrict pac3 to certain groups:
Code: [Select]
-- add/change rank names here in the same format
local ranks = {
["pac3"] = true,
["owner"] = true,
["admins"] = true,
["superadmin"] = true,
}
    CustomCheckFailMsg = "Donators only",
hook.Add("PrePACEditorOpen", "PACRankRestrict", function(ply)
if not ranks[ply:GetUserGroup()] then
              return false,"Insufficient rank to use PAC."
        end
end)

I want to make it so if they buy PAC3 Package they have it permanently so when they buy another package it doesn't get removed.
59
General Chat & Help and Support / Re: ULX Group help
« Last post by iViscosity on June 10, 2022, 12:52:42 AM »
What do you mean you need to make a group for them to use PAC? If you're using something like Pointshop, you shouldn't need to make a new group iirc. If you're using your own custom shop, just use something like CheckGroup or IsUserGroup
60
General Chat & Help and Support / ULX Group help
« Last post by Shotz on June 10, 2022, 12:26:05 AM »
So, me and my friend have a store for our GMOD server. We want to make PAC3 buyable but to do that we need to make a group. The issue is, if someone buys a package that doesn't have PAC3 included they will be removed from that group and no longer have PAC3. What can I do? Is there anyway to make them have permanent features after buying?
Pages: 1 ... 4 5 [6] 7 8 ... 10