• Print

Author Topic: How to run a ULX command whenever someone joins  (Read 6481 times)

0 Members and 1 Guest are viewing this topic.

Offline ryanlaw4

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
How to run a ULX command whenever someone joins
« on: February 13, 2014, 01:50:44 pm »
There is this guy that I hate with a passion. I want to use one of Cobalts commands, ULX Crash, on that person everytime he joins the server. Thank you.

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: How to run a ULX command whenever someone joins
« Reply #1 on: February 13, 2014, 02:00:06 pm »
hook.Add( "PlayerInitialSpawn", "lol", function( ply )
if ply:SteamID() == "his steamid" then
RunConsoleCommand( "ulx", "crash", ply:Nick() )
end )

Offline ryanlaw4

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
Re: How to run a ULX command whenever someone joins
« Reply #2 on: February 13, 2014, 02:27:21 pm »
Sorry for me sucking at lua, but where would I place this into? Or could I use lua run?

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: How to run a ULX command whenever someone joins
« Reply #3 on: February 13, 2014, 02:46:51 pm »
Sorry for me sucking at lua, but where would I place this into? Or could I use lua run?
anywhere in autorun/server

Offline ryanlaw4

  • Newbie
  • *
  • Posts: 14
  • Karma: 0
Re: How to run a ULX command whenever someone joins
« Reply #4 on: February 14, 2014, 09:02:25 am »
Can I use this as a luarun?

Offline Cobalt

  • Full Member
  • ***
  • Posts: 216
  • Karma: 44
  • http://steamcommunity.com/id/__yvl/
Re: How to run a ULX command whenever someone joins
« Reply #5 on: February 14, 2014, 12:42:54 pm »
Can I use this as a luarun?
Uh, I guess so, but it would go away when the map changes.

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: How to run a ULX command whenever someone joins
« Reply #6 on: February 15, 2014, 08:36:46 am »
What is the correct syntax if you want multiple ids?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: How to run a ULX command whenever someone joins
« Reply #7 on: February 15, 2014, 09:01:01 am »
Create a table like so:
Code: Lua
  1. t = { ["steamid 1"] = true, ["steamid 2"] = true, }

And check if it's in the table with:
Code: Lua
  1. if t[steamid] then ... end
Experiencing God's grace one day at a time.

  • Print