1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

HL2RP Some developing questions

Discussion in 'Development' started by Garry[LT], Jan 29, 2018.

  1. Garry[LT]

    Garry[LT] Clockwork Customer

    • Also i want create plugin, which with command could open specific link on Steam browser (example: the content page), but i don't know how to write code which opens the webpage on browser.
    • And i didn't understood the line in ration script: Clockwork.player: GiveCash(player, 60, "ration packet"), what that "ration packet" variable gives?
     
  2. Aberidius

    Aberidius Chief Technology Officer Staff Member Administrator Store Support

    I suggest you get a customer status by making a ticket on the store if you want official help.
    The things you mention is basic lua so i advice you to read the wiki for garrys mod.
     
    • Informative Informative x 1
  3. Garry[LT]

    Garry[LT] Clockwork Customer

    .
    Garry's mod wiki will be usefull, about status maybe next time.
     
  4. Aspect

    Aspect =) Legend Clockwork Customer

    Go to /garrysmod/lua/autorun and create a new lua file.
    Then paste this in:
    Code:
    hook.Add( "PlayerSay", "content", function( ply, text, public )
        if ( string.lower( text ) == "/content" ) then
            ply:SendLua([[gui.OpenURL("CONTENT LINK HERE")]])
            return ""
        end
    end )
    Make sure to replace the "CONTENT LINK HERE" with a link to your content pack.

    OR if you want to do it using a clockwork command, go to garrysmod/gamemodes/cwhl2rp/schema/commands and create a new lua file named something like "sh_content.lua".
    Then paste this in:
    Code:
    local COMMAND = Clockwork.command:New("Content");
    COMMAND.tip = "Open a Steam Browser Tab to our Server Content.";
    COMMAND.arguments = 1;
    
    -- Called when the command has been run.
    function COMMAND:OnRun(player, arguments)
    ply:SendLua([[gui.OpenURL("CONTENT LINK HERE")]])
    end;
    COMMAND:Register();
    Make sure to replace the "CONTENT LINK HERE" with a link to your content pack.

    The variable "Ration Packet" is, well, have you seen when you open a ration bag and on the top right of your screen it says something along the lines of "You have recieved 30 tokens from ration packet."? That "ration packet" is what it says on the text. So, for example if we change "ration packet" to "LOLMEME", it will say "You have recieved 30 tokens from LOLMEME."
     
    • Disagree Disagree x 1
    • Winner Winner x 1
  5. Garry[LT]

    Garry[LT] Clockwork Customer

    Thank you a lot! some things i knew how it's work...but mostly that was big help...THANK YOU! :oops:
     

Previous Readers (Total: 0)