ULX

Author Topic: Help with command  (Read 1908 times)

0 Members and 1 Guest are viewing this topic.

Offline (TG) PotLuck

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Help with command
« on: July 29, 2016, 10:37:51 AM »
I am trying to figure out how to make a player run a console command when they use a certain ULX command. I recently got a server hopper addon so players can switch between servers in my community, but it only has a console command to open the GUI. I need them to be able to type !servers and it makes them run the console command "serverhopper". Please help. I have no clue how to setup this code.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Help with command
« Reply #1 on: July 29, 2016, 10:40:18 AM »
http://wiki.garrysmod.com/page/Player/ConCommand

if you're doing it in an ULX command structure, it would likely be this:

target_ply:ConCommand("serverhopper")

But target_ply could be whatever the player object in your command code is.

Feel free to post what you come up with here and we'll help you out.