• Print

Author Topic: ULX and TTT  (Read 4979 times)

0 Members and 1 Guest are viewing this topic.

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
ULX and TTT
« on: September 12, 2013, 03:03:41 am »
I think this probably can't be done but is there anyway I can change one of the lua files in the gamemode TTT to give only traitors or innocents access to a ULX command. For example, if a player spawns as a traitor, then he can use ulx jail?

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: ULX and TTT
« Reply #1 on: September 12, 2013, 04:06:26 am »
I'm not gonna be much of help, but why would you even let them use the jail command?
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: ULX and TTT
« Reply #2 on: September 12, 2013, 04:13:25 am »
I don't. I just used that as an example. It's the first ULX command that came to my mind.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULX and TTT
« Reply #3 on: September 12, 2013, 05:08:05 am »
It can be done, you'd just check which state a player is in before continuing to process the command. I'd recommend modifying it with one of the available hooks.
Experiencing God's grace one day at a time.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: ULX and TTT
« Reply #4 on: September 12, 2013, 05:15:23 am »
I don't. I just used that as an example. It's the first ULX command that came to my mind.

Ah, I see.

Well, the first thing you gotta do is to check the role (as Megiddo said), I have one way, if it's effective or not depends on if any of the lua pros agree:

Code: Lua
  1. function TraitorCommand()
  2.         for k, v in ipairs (player.GetAll()) do
  3.                 if v:IsRole(ROLE_TRAITOR) then
  4.                         --Insert command and stuff here.
  5.                 end
  6.         end
  7. end
  8.  

I made this on the fly (I'm sort of in class still), so you would either have to figure out the rest yourself/get help from someone else about the hooks and such that Megiddo posted about.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: ULX and TTT
« Reply #5 on: September 12, 2013, 06:03:40 am »
Thanks so much to both of you! I am not good with lua code at all and I will have to see if I can hire a coder to do this for me!
« Last Edit: September 12, 2013, 06:08:49 am by Storm »

  • Print