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 problems with /Forums code

Discussion in 'Development' started by Garry[LT], Feb 5, 2018.

  1. Garry[LT]

    Garry[LT] Clockwork Customer

    I used the code for it from this:
    And my code doesn't open the link...when i write /Forums it drops this: Forums <none>!
    This is my code (but nothing new added):
    Code:
    local COMMAND = Clockwork.command:New("Forums");
    COMMAND.tip = "Open a Steam Browser Tab to our Community Forum.";
    COMMAND.arguments = 1;
    
    -- Called when the command has been run.
    function COMMAND:OnRun(player, arguments)
    ply:SendLua([[gui.OpenURL("http://wiki.garrysmod.com/page/Main_Page")]])
    end;
    COMMAND:Register();
     
  2. Vented

    Vented Guest

    Try this:
    Code:
    local COMMAND = Clockwork.command:New("Forums");
    COMMAND.tip = "Open a Steam Browser Tab to our Community Forum.";
    
    -- Called when the command has been run.
    function COMMAND:OnRun(player)
    ply:SendLua([[gui.OpenURL("http://wiki.garrysmod.com/page/Main_Page")]])
    end;
    COMMAND:Register();
     
    • Winner Winner x 1
  3. Viz

    Viz Legend Clockwork Customer

    'ply' needs to be 'player' as well.

    Code:
    local COMMAND = Clockwork.command:New("Forums");
    COMMAND.tip = "Open a Steam Browser Tab to our Community Forum.";
    
    -- Called when the command has been run.
    function COMMAND:OnRun(player)
    player:SendLua([[gui.OpenURL("http://wiki.garrysmod.com/page/Main_Page")]])
    end;
    COMMAND:Register();
     
    • Like Like x 1
    • Winner Winner x 1
  4. Aspect

    Aspect =) Legend Clockwork Customer

    Oh snap.
    Thanks for correcting that. :D
     
  5. Garry[LT]

    Garry[LT] Clockwork Customer

    Thanks guys, it works like a bee...
     

Previous Readers (Total: 0)