• Print

Author Topic: [ULX hates me]Help with a command AGAIN AGAIN  (Read 12349 times)

0 Members and 1 Guest are viewing this topic.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
[ULX hates me]Help with a command AGAIN AGAIN
« on: February 01, 2015, 04:13:19 pm »
Hello! i have made my own command that tp's a player to a sit ( or any selected location ) and it is not doing the tsay and its not in the ulx menu...

Here is the code/addon that i have...


Hope you can help THANKS

Offline JabbaTheWut

  • Newbie
  • *
  • Posts: 35
  • Karma: -3
  • The Noob.
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #1 on: February 01, 2015, 05:20:39 pm »
Im not a lua coder. As a matter of fact I suck. However what I do to fix problems where there isnt a direct fix is look at other scripts. For example, I was having trouble with a script so I looked at another script and borrowed some of the code and put it where I needed it and it fixed my problem.

So go in teleport.lua and chat.lua and look at how they have there chat thing is set up and try to work off that.
I might be one of the stupidest people you will ever meet.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #2 on: February 01, 2015, 05:33:58 pm »
Thats the bad thing.... I copied the teleport command and worked on it lol and it STILL does not work ;( wanna take a look?

Offline JabbaTheWut

  • Newbie
  • *
  • Posts: 35
  • Karma: -3
  • The Noob.
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #3 on: February 01, 2015, 05:48:17 pm »
Sure. the only reason I do that is because I dont know how to make code all that well. I can understand whats going on but thats it
I might be one of the stupidest people you will ever meet.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #4 on: February 01, 2015, 06:12:09 pm »
So you cant help me... lol its ok thanks for the ( somewhat ) help

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #5 on: February 01, 2015, 06:16:37 pm »
Alright, don't take this the wrong way. It's not ULX that hates you, it's your lua that hates you. Secondly, I don't understand what you're trying to do!?

What is a "sit"??

What does it even do, people need descriptions??

What exactly doesn't work??

Are there any errors??
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #6 on: February 01, 2015, 06:23:51 pm »
Your code without the beginning comments:

Code: Lua
  1. vector1         =       83.237251
  2. vector2         =       -414.578888
  3. vector3         =       -12223.580078
  4. angle1          =       1.759990
  5. angle2          =       150.339874
  6. angle3          =       0.000000
  7.  
  8. function ulx.sit( calling_ply, target_ply )
  9.  
  10.  
  11. --local vector = "2199.119385, -1950.238281, -12735.968750"                 --this is where you put the vector
  12. --local angle = "12.319997, -40.999668, 0.000000"                           --this is where you put the angle
  13.  
  14.  
  15.         if not calling_ply:IsValid() then
  16.                 Msg( "You are the console, you can't teleport or teleport others since you can't see the world!\n" )
  17.                 return
  18.         end
  19.  
  20.         if ulx.getExclusive( target_ply, calling_ply ) then
  21.                 ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true )
  22.                 return
  23.         end
  24.  
  25.         if not target_ply:Alive() then
  26.                 ULib.tsayError( calling_ply, target_ply:Nick() .. " is dead!", true )
  27.                 return
  28.         end
  29.  
  30.         local t = {}
  31. --      t.start = calling_ply:GetPos() + Vector( 0, 0, 32 ) -- Move them up a bit so they can travel across the ground
  32.         t.endpos = calling_ply:GetPos() + calling_ply:EyeAngles():Forward() * 16384
  33.         t.filter = target_ply
  34.         if target_ply ~= calling_ply then
  35.                 t.filter = { target_ply, calling_ply }
  36.         end
  37.         local tr = util.TraceEntity( t, target_ply )
  38.  
  39. --[[   
  40.         if target_ply == calling_ply and pos:Distance( target_ply:GetPos() ) < 64 then -- Laughable distance
  41.                 return
  42.         end
  43. ]]
  44.         if target_ply:InVehicle() then
  45.                 target_ply:ExitVehicle()
  46.         end
  47.  
  48.         target_ply:SetPos( Vector( vector1, vector2, vector3 ) )
  49.         target_ply:SetPos( Angle( angle1, angle2, angle3 ) )
  50.  
  51.         target_ply:SetLocalVelocity( Vector( 0, 0, 0 ) ) -- Stop!
  52.  
  53.         if target_ply ~= calling_ply then
  54.                 ulx.fancyLogAdmin( calling_ply, "#A teleported #T to the sit", target_ply ) -- We don't want to log otherwise
  55.         end
  56. end
  57. local sitc = ulx.command( CATEGORY_NAME, "ulx sit", ulx.sit, {"!sit"} )
  58. sitc:addParam{ type=ULib.cmds.PlayerArg, ULib.cmds.optional }
  59. sitc:defaultAccess( ULib.ACCESS_ADMIN )
  60. sitc:help( "Teleports target to a sit." )
  61.  

Question 1: Why is it not appearing in the ULX menu?
Answer: Look at Line 57 in your code:

Code: [Select]
57. local sitc = ulx.command( CATEGORY_NAME, "ulx sit", ulx.sit, {"!sit"} )
You are making the ULX Function call "CATEGORY_NAME" but nowhere have you defined the actual category name. To fix this, put at the top of your actual code:
Code: Lua
  1. local CATEGORY_NAME = "Sit"

Question 2: Please elaborate as to which tsay it is not calling.
Once you get to know me, you'll find you'll have never met me at all.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #7 on: February 01, 2015, 06:42:18 pm »
When I type !sit <name> it works but it does not say player teleported player to sit

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #8 on: February 01, 2015, 07:09:47 pm »
Oh you mean the FancyLog. Remove the if statement at the end.
Once you get to know me, you'll find you'll have never met me at all.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #9 on: February 02, 2015, 05:15:08 am »
I'll look at this tomorrow, see if I can help if I'm not busy, or this isn't answered yet. Though to be honest, I'd just comment out FanceLog "things", even me who makes ulx modules doesn't even really understand this.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #10 on: February 02, 2015, 07:11:16 am »
If I remove the fancy log won't that get rid of the whole thing? ( get rid of the tsay )
All i want is when the command is used the chat says so..

Thanks for all the help so far guys!
« Last Edit: February 02, 2015, 07:41:22 am by XxLMM13xX »

Offline JabbaTheWut

  • Newbie
  • *
  • Posts: 35
  • Karma: -3
  • The Noob.
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #11 on: February 02, 2015, 12:53:38 pm »
Also FYI !return doesnt work with this.
I might be one of the stupidest people you will ever meet.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #12 on: February 02, 2015, 12:56:12 pm »
What do you mean? return is not a thing i wanted to do.... i just want it to say in chat that i teleported someone to a sit...

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #13 on: February 02, 2015, 04:08:14 pm »
What do you mean?
He's saying that if you force someone to sit, and then later want to return them (or they want to return), ulx return command doesn't work.
But, take one challenge at a time.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #14 on: February 02, 2015, 04:18:40 pm »
Ok this is frustrating because i'm trying to make it say <caller> teleported <target> ti the sit. And it wint work... HELP!!!! And how would I do the return...

  • Print