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!

Doorway To Another Server [ ? ]

Discussion in 'Programming' started by Daze, May 28, 2013.

  1. Daze

    Daze Retired Support

    Hey C16,
    I've been brainstorming and have thought up an elaborate idea. Would it be possible to code in a prop, maybe a door, that if you open it will connect you to another server? For example, if would own a Metro server, there would be a door that leads to the surface. Once opened, you would connect to a passworded server which has a surface map. Just an idea, I'll mess around with lua a bit and post updates, tell me what you think!

    - Daze ;D
     
  2. SendLua the connect concommand. I think SendLua has little restrictions but I may be wrong.
     
  3. Daze

    Daze Retired Support

    Alright, sounds cool! I'll check it out when I get home, I think this could be a pretty cool thing if it actually works. Thanks!
     
  4. Daze

    Daze Retired Support

    Thanks, I'll be sure to let you guys know. Couldn't I just bind a command to a door prop and use it as an entity? Like "connect IP"?
     
  5. trurascalz

    trurascalz C16 Developer Legend

    Pretty sure something like ply:ConCommand("connect 123546612:12345") I did come across something like this ages ago, i just cannot find it
     
  6. Daze

    Daze Retired Support

    Ok cool
     
  7. I think that command is restricted.
     
  8. Arbiter329

    Arbiter329 Owner of Arc-Factory Roleplay

    Use this:

    Code:
    player:SendLua("LocalPlayer():ConCommand('connect <server ip> <password>')")
     
  9. Daze

    Daze Retired Support

    Thanks! Still new to lua, where would I put that line? Do I make a plugin for it?
     
  10. Depends on what you want to do with it.
    If you want it to activate when a player uses it, use this.

    Code:
    function Schema:PlayerUse(player, entity)
    	player:SendLua("LocalPlayer():ConCommand('connect <server ip> <password>')")
    
     
  11. Daze

    Daze Retired Support

    And I put that in which .lua file? In the schema? and how do I specify which prop would use it? Somewhat stupid idea, but, say I were to try and make it a command to use on door props?
     
  12. gamemodes\cwhl2rp\schema\entities\entities\cw_ <entity>\shared.lua
     
  13. No need for LocalPlayer(). Just use RunConsoleCommand.

    Also, connect uses arguments, therefore must have a comma.
     
  14. Arbiter329

    Arbiter329 Owner of Arc-Factory Roleplay

    No, it doesn't need a comma. (I've tested this code, it works)
     
  15. Didn't work for me, but then again I used RunConsoleCommand, which is the proper way to go about doing this.
     
  16. sants1

    sants1 I'm an asshole. That's all.

    It'd be so much easier to implant this in a plugin, after you make the folder for
    cw_entity then make a shared Lua,

    Then paste that command in it, I still have no idea how to make it work with a prop.
     
  17. Daze

    Daze Retired Support

    Agreed, but I'd like to see it work first in general. I'm going to code this in for my server today.
     
  18. sants1

    sants1 I'm an asshole. That's all.

    [off topic] Daze, get on steam. We should work on this together.
     
  19. I already made this.

    Going to post it when I get home from school.
     
  20. sants1

    sants1 I'm an asshole. That's all.

    Thanks duck!

    :-*
     

Previous Readers (Total: 0)