• Print

Author Topic: stuck command (!stuck)  (Read 10862 times)

0 Members and 1 Guest are viewing this topic.

Offline C.Finley

  • Newbie
  • *
  • Posts: 36
  • Karma: 0
stuck command (!stuck)
« on: June 17, 2016, 01:11:53 pm »
Is there a free version for TTT because I have found nothing but ones for prophunt. Anyone got a link to one for TTT I can't seem to find a "free" one.

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: stuck command (!stuck)
« Reply #1 on: June 17, 2016, 01:23:39 pm »
I'm sure unstuck commands are gamemode-agnostic unless they teleport you to some sort of predefined spawn location. Just look for one that doesn't do that, and you should be fine.
I had one running on my server a while ago, but I've since lost the original post for it.
bw81@ulysses-forums ~ % whoami
Homepage

Offline C.Finley

  • Newbie
  • *
  • Posts: 36
  • Karma: 0
Re: stuck command (!stuck)
« Reply #2 on: June 17, 2016, 01:40:30 pm »
That's the thing I looked but there is one on scriptfodder but aka not free and I can't find one that is free with compatibility because the rest say prophunt.

Offline OpticPotatOS

  • Jr. Member
  • **
  • Posts: 53
  • Karma: 0
  • GLaDOS
    • Gaming for Everyone
Re: stuck command (!stuck)
« Reply #3 on: June 17, 2016, 02:12:43 pm »
Do you know any lua? You could probably make that really quickly.

EDIT: Made this in about a minute or two, untested except via console, which makes sure that ply:ConCommand isn't gonna work, if it doesn't work tell me, if any one else notices any issues with it (I'm a glut novice), tell me.

Code: Lua
  1. function ulx.stuck( calling_ply, target_ply )
  2.         calling_ply:ConCommand( "ulx bring #A", target_ply )
  3. end
  4.  
  5. local stuck = ulx.command( CATAGORY_NAME, "ulx stuck", ulx.stuck, "!stuck" )
  6. stuck:addParam{ type=ULib.cmds.PlayerArg }
  7. stuck:defaultAccess( ULib.ACCESS_ADMIN )
  8. stuck:help( "Teleports the stuck player to the calling admin" )

EDIT 2: I'm not sure the #A", target_ply bit will actually work, but it didn't through up any immediate errors when I did it via console. And I realised that all I really did was re-create ulx bring, but hey, it has a special name now!
« Last Edit: June 17, 2016, 02:27:09 pm by OpticPotatOS »
My website isn't my website, rather, it's the gaming network my sever is connected to.

ttt.gfe.nu

Unforeseen Consequences

Offline C.Finley

  • Newbie
  • *
  • Posts: 36
  • Karma: 0
Re: stuck command (!stuck)
« Reply #4 on: June 17, 2016, 02:21:51 pm »
If I did I wouldn't be asking :P AKA I wish I did I can edit lua but can't create it.

Offline OpticPotatOS

  • Jr. Member
  • **
  • Posts: 53
  • Karma: 0
  • GLaDOS
    • Gaming for Everyone
Re: stuck command (!stuck)
« Reply #5 on: June 17, 2016, 02:23:36 pm »
Oh, umm, this is awkward-ish. Check my edited post ;)
My website isn't my website, rather, it's the gaming network my sever is connected to.

ttt.gfe.nu

Unforeseen Consequences

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: stuck command (!stuck)
« Reply #6 on: June 17, 2016, 02:35:03 pm »
Do you know any lua? You could probably make that really quickly.

EDIT: Made this in about a minute or two, untested except via console, which makes sure that ply:ConCommand isn't gonna work, if it doesn't work tell me, if any one else notices any issues with it (I'm a glut novice), tell me.

Code: Lua
  1. function ulx.stuck( calling_ply, target_ply )
  2.         calling_ply:ConCommand( "ulx bring #A", target_ply )
  3. end
  4.  
  5. local stuck = ulx.command( CATAGORY_NAME, "ulx stuck", ulx.stuck, "!stuck" )
  6. stuck:addParam{ type=ULib.cmds.PlayerArg }
  7. stuck:defaultAccess( ULib.ACCESS_ADMIN )
  8. stuck:help( "Teleports the stuck player to the calling admin" )

EDIT 2: I'm not sure the #A", target_ply bit will actually work, but it didn't through up any immediate errors when I did it via console. And I realised that all I really did was re-create ulx bring, but hey, it has a special name now!

I think he'd want something any player can execute, not a redirect for bring.
bw81@ulysses-forums ~ % whoami
Homepage

Offline C.Finley

  • Newbie
  • *
  • Posts: 36
  • Karma: 0
Re: stuck command (!stuck)
« Reply #7 on: June 17, 2016, 02:46:33 pm »
Yah lets say a normal user is stuck so he types !stuck or !unstuck and it unstucks them basically use for TTT.

Offline OpticPotatOS

  • Jr. Member
  • **
  • Posts: 53
  • Karma: 0
  • GLaDOS
    • Gaming for Everyone
Re: stuck command (!stuck)
« Reply #8 on: June 18, 2016, 02:50:00 am »
Found some stuff on Facepunch and threw this together, untested, no immediate errors anyway. If it refuses to work, tell meh and I'll try and fix it quickly.

Code: Lua
  1. function ulx.stuck( calling_ply )
  2.         local randomply = table.Random(player.GetAll()) --Important later
  3.        
  4.         local pos = calling_ply:GetPos() --Setting up
  5.         local tracedata = {}
  6.         tracedata.start = pos
  7.         tracedata.endpos = pos
  8.         tracedata.filter = calling_ply
  9.         tracedata.mins = calling_ply:OBBMins()
  10.         tracedata.maxs = calling_ply:OBBMaxs()
  11.         local trace = util.TraceHull( tracedata )
  12.  
  13.         if trace.Entity and !trace.Entity:IsWorld() and trace.Entity:IsValid() then --Check if the player is in a prop or a wall or something
  14.                 ulx.fancyLogAdmin( calling_ply, "#A unstuck themselves" )
  15.                 calling_ply:ConCommand( "ulx goto #A", randomply ) --TP the player to a random player to get them out, best solution I have at the moment
  16.         end
  17. end
  18.  
  19. local stuck = ulx.command( CATAGORY_NAME, "ulx stuck", ulx.stuck, "!stuck" )
  20. stuck:defaultAccess( ULib.ACCESS_ALL )
  21. stuck:help( "Unstucks the player" )
  22.  
My website isn't my website, rather, it's the gaming network my sever is connected to.

ttt.gfe.nu

Unforeseen Consequences

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: stuck command (!stuck)
« Reply #9 on: June 18, 2016, 06:41:29 am »
It makes me sad that no one seems to use the search box we keep open for people.
This forum has had many coders over many years.
Searching often leads to previous conversations.
/index.php/topic,7259.0.html

If you are having trouble learning from old posts like that, if you have well thought out questions that aren't already answered, you are allowed to necro a post.



"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: stuck command (!stuck)
« Reply #10 on: June 18, 2016, 08:42:11 am »
It makes me sad that no one seems to use the search box we keep open for people.
This forum has had many coders over many years.
Searching often leads to previous conversations.
/index.php/topic,7259.0.html
I think he wants one that would simply reposition the player a few units, out of any collision boxes, not bring them to any player or respawn them. As OP said, this is for TTT, and both of those would probably not be the best solutions.

I'll try and dig up the old addon I used to use that would spawn a prop and teleport a player to it---that seemed pretty reliable back in the day.

edit: It's not mine to distribute, but here. Hopefully the original creator takes credit if they find this.
edit 2: Commands (which all do the same thing) are:
  • !unstuck
  • !stuck
  • /unstuck
  • /stuck
Admins and above should receive echos about who used the command. Unfortunately, there is no ULib specific code for access, however I could probably add this if you'd like, even if I didn't make the addon.
« Last Edit: June 18, 2016, 08:51:00 am by Bytewave »
bw81@ulysses-forums ~ % whoami
Homepage

Offline C.Finley

  • Newbie
  • *
  • Posts: 36
  • Karma: 0
Re: stuck command (!stuck)
« Reply #11 on: June 18, 2016, 10:19:24 am »
Thank You.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: stuck command (!stuck)
« Reply #12 on: June 18, 2016, 12:51:01 pm »
would simply reposition the player a few units, out of any collision boxes, not bring them to any player or respawn them.

But it's still the same subject matter, just wanting it a different way.
I feel a continuation of that thread would have been best.

ULib's getspawninfo function are different than just respawning, and that's mentioned in the post I linked.
We use it to keep people being punished from losing weapons/ammo/health and armor they already had if they try to kill themselves during the punishment.
It shouldn't have been difficult for someone with half way decent lua and ULX function knowledge to combine the collision and surface checking tp and bring use in combination with the ULib.getSpawnInfo and make a custom stuck/spawn function with out player:Spawn to make a nice little ULib unstuck command for our releases section.

Then when this question gets asked 10 more times over the next 5 years, we simply point them to the release and lock the thread.


"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline BulldogHayden

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: stuck command (!stuck)
« Reply #13 on: April 16, 2017, 10:31:23 pm »
Do you know any lua? You could probably make that really quickly.

EDIT: Made this in about a minute or two, untested except via console, which makes sure that ply:ConCommand isn't gonna work, if it doesn't work tell me, if any one else notices any issues with it (I'm a glut novice), tell me.

Code: Lua
  1. function ulx.stuck( calling_ply, target_ply )
  2.         calling_ply:ConCommand( "ulx bring #A", target_ply )
  3. end
  4.  
  5. local stuck = ulx.command( CATAGORY_NAME, "ulx stuck", ulx.stuck, "!stuck" )
  6. stuck:addParam{ type=ULib.cmds.PlayerArg }
  7. stuck:defaultAccess( ULib.ACCESS_ADMIN )
  8. stuck:help( "Teleports the stuck player to the calling admin" )

EDIT 2: I'm not sure the #A", target_ply bit will actually work, but it didn't through up any immediate errors when I did it via console. And I realised that all I really did was re-create ulx bring, but hey, it has a special name now!


"You do not have access to this command"

  • Print