• 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 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 #15 on: February 02, 2015, 04:41:18 pm »
ulx.fancyLogAdmin( calling_ply, "#A teleported #T to the sit", target_ply)
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 #16 on: February 02, 2015, 04:48:45 pm »
Where do I put this?

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 #17 on: February 03, 2015, 11:24:39 am »
At the end of the function.
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 #18 on: February 03, 2015, 03:04:57 pm »
This is my full code...

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. local CATEGORY_NAME = "Teleport"
  8. function ulx.sit( calling_ply, target_ply )
  9.  
  10.  
  11.         if not calling_ply:IsValid() then
  12.                 Msg( "You are the console, you can't teleport or teleport others since you can't see the world!\n" )
  13.                 return
  14.         end
  15.  
  16.         if ulx.getExclusive( target_ply, calling_ply ) then
  17.                 ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true )
  18.                 return
  19.         end
  20.  
  21.         if not target_ply:Alive() then
  22.                 ULib.tsayError( calling_ply, target_ply:Nick() .. " is dead!", true )
  23.                 return
  24.         end
  25.  
  26.         local t = {}
  27. --      t.start = calling_ply:GetPos() + Vector( 0, 0, 32 ) -- Move them up a bit so they can travel across the ground
  28.         t.endpos = calling_ply:GetPos() + calling_ply:EyeAngles():Forward() * 16384
  29.         t.filter = target_ply
  30.         if target_ply ~= calling_ply then
  31.                 t.filter = { target_ply, calling_ply }
  32.         end
  33.         local tr = util.TraceEntity( t, target_ply )
  34.  
  35.  
  36.         if target_ply:InVehicle() then
  37.                 target_ply:ExitVehicle()
  38.         end
  39.  
  40.         target_ply:SetPos( Vector( vector1, vector2, vector3 ) )
  41.         target_ply:SetPos( Angle( angle1, angle2, angle3 ) )
  42.  
  43.        
  44.         target_ply:SetLocalVelocity( Vector( 0, 0, 0 ) ) -- Stop!
  45.        
  46.         ulx.fancyLogAdmin( calling_ply, "#A teleported #T to the sit", target_ply )    
  47. end
  48. local sitc = ulx.command( CATEGORY_NAME, "ulx sit", ulx.sit, {"!sit", "!tps"} )
  49. sitc:addParam{ type=ULib.cmds.PlayerArg, ULib.cmds.optional }
  50. sitc:defaultAccess( ULib.ACCESS_ADMIN )
  51. sitc:help( "Teleports target to a sit." )
  52.  

The fancylog does not work!!!!!!!!! it does not say in the server #A teleported #T to the sit

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 #19 on: February 04, 2015, 09:37:30 am »
This is my full code...

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. local CATEGORY_NAME = "Teleport"
  8. function ulx.sit( calling_ply, target_ply )
  9.  
  10.  
  11.         if not calling_ply:IsValid() then
  12.                 Msg( "You are the console, you can't teleport or teleport others since you can't see the world!\n" )
  13.                 return
  14.         end
  15.  
  16.         if ulx.getExclusive( target_ply, calling_ply ) then
  17.                 ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true )
  18.                 return
  19.         end
  20.  
  21.         if not target_ply:Alive() then
  22.                 ULib.tsayError( calling_ply, target_ply:Nick() .. " is dead!", true )
  23.                 return
  24.         end
  25.  
  26.         local t = {}
  27. --      t.start = calling_ply:GetPos() + Vector( 0, 0, 32 ) -- Move them up a bit so they can travel across the ground
  28.         t.endpos = calling_ply:GetPos() + calling_ply:EyeAngles():Forward() * 16384
  29.         t.filter = target_ply
  30.         if target_ply ~= calling_ply then
  31.                 t.filter = { target_ply, calling_ply }
  32.         end
  33.         local tr = util.TraceEntity( t, target_ply )
  34.  
  35.  
  36.         if target_ply:InVehicle() then
  37.                 target_ply:ExitVehicle()
  38.         end
  39.  
  40.         target_ply:SetPos( Vector( vector1, vector2, vector3 ) )
  41.         target_ply:SetPos( Angle( angle1, angle2, angle3 ) )
  42.  
  43.        
  44.         target_ply:SetLocalVelocity( Vector( 0, 0, 0 ) ) -- Stop!
  45.        
  46.         ulx.fancyLogAdmin( calling_ply, "#A teleported #T to the sit", target_ply )    
  47. end
  48. local sitc = ulx.command( CATEGORY_NAME, "ulx sit", ulx.sit, {"!sit", "!tps"} )
  49. sitc:addParam{ type=ULib.cmds.PlayerArg, ULib.cmds.optional }
  50. sitc:defaultAccess( ULib.ACCESS_ADMIN )
  51. sitc:help( "Teleports target to a sit." )
  52.  

The fancylog does not work!!!!!!!!! it does not say in the server #A teleported #T to the sit

HELP

Okay, well first off, I would never use "~" to declare "not", generally it's obsolete, and most people I would say do not know that actually means "not".

Secondly, ONCE AGAIN, what does "SIT" mean?
Code: Lua
  1. sitc:help( "Teleports target to a sit." )
Even my bachelor's degree in Language Arts doesn't even help me. This entire script doesn't make sense to me at all, it literally just looks like a different version of !jailtp.
SO PLEASE TELL US NOW: What does this actually do, what is it supposed to do?! Yeah, we can read your code, and see what scriptly it is supposed to do, but to most of us it just looks like stuff written on a piece of paper. When you're requesting help, please, please, please, please, please, give some details of what its even supposed to do, so us people with imaginations can actually imagine it's initial goal.

So now that I'm done with my rant, as for your facnelogadmin thing not working. Try moving it all the way to the top like this:
 
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. local CATEGORY_NAME = "Teleport"
  8. function ulx.sit( calling_ply, target_ply )
  9.  
  10.         ulx.fancyLogAdmin( calling_ply, "#A teleported #T to the sit", target_ply )    
  11.  
  12.         if not calling_ply:IsValid() then
  13.                 Msg( "You are the console, you can't teleport or teleport others since you can't see the world!\n" )
  14.                 return
  15.         end
  16.  
  17.         if ulx.getExclusive( target_ply, calling_ply ) then
  18.                 ULib.tsayError( calling_ply, ulx.getExclusive( target_ply, calling_ply ), true )
  19.                 return
  20.         end
  21.  
  22.         if not target_ply:Alive() then
  23.                 ULib.tsayError( calling_ply, target_ply:Nick() .. " is dead!", true )
  24.                 return
  25.         end
  26.  
  27.         local t = {}
  28. --      t.start = calling_ply:GetPos() + Vector( 0, 0, 32 ) -- Move them up a bit so they can travel across the ground
  29.         t.endpos = calling_ply:GetPos() + calling_ply:EyeAngles():Forward() * 16384
  30.         t.filter = target_ply
  31.         if target_ply ~= calling_ply then
  32.                 t.filter = { target_ply, calling_ply }
  33.         end
  34.         local tr = util.TraceEntity( t, target_ply )
  35.  
  36.  
  37.         if target_ply:InVehicle() then
  38.                 target_ply:ExitVehicle()
  39.         end
  40.  
  41.         target_ply:SetPos( Vector( vector1, vector2, vector3 ) )
  42.         target_ply:SetPos( Angle( angle1, angle2, angle3 ) )
  43.  
  44.  
  45.         target_ply:SetLocalVelocity( Vector( 0, 0, 0 ) ) -- Stop!
  46.  
  47. end
  48. local sitc = ulx.command( CATEGORY_NAME, "ulx sit", ulx.sit, {"!sit", "!tps"} )
  49. sitc:addParam{ type=ULib.cmds.PlayerArg, ULib.cmds.optional }
  50. sitc:defaultAccess( ULib.ACCESS_ADMIN )
  51. sitc:help( "Teleports target to a sit." )

Obviously do not leave it at the top if you find out what the problem is, but put it on the top to make sure the entire code is actually be executed correctly. You have some return ends, meaning that it may not be getting past the return end. People who actually try to problem solve, usually use "print" (I use "MsgN" because I see no difference) to see if there code is being executed to the next line of code. So I'll suggest to you to do the same, but instead of putting "print", use fancylogadmin and use it as a test.
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 #20 on: February 04, 2015, 01:21:34 pm »
Quote
Secondly, ONCE AGAIN, what does "SIT" mean?
Code: Lua
sitc:help( "Teleports target to a sit." )
Even my bachelor's degree in Language Arts doesn't even help me. This entire script doesn't make sense to me at all, it literally just looks like a different version of !jailtp.
SO PLEASE TELL US NOW: What does this actually do, what is it supposed to do?! Yeah, we can read your code, and see what scriptly it is supposed to do, but to most of us it just looks like stuff written on a piece of paper. When you're requesting help, please, please, please, please, please, give some details of what its even supposed to do, so us people with imaginations can actually imagine it's initial goal.

This command basically is like a warp command.. ( might change name ) a sit is like a place that in like DarkRP maybe or some other gamemode a admin will take a person to talk to them. ( gamer slang )

BASIC REASON: Teleports a player to a set location



Also the code is based off the tp command from ULX i just changed the cross hair to a set vector

I ALSO GOT THE CODE TO WORK
i put the code at the beginning and it worked thanks for ALL the help!

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 #21 on: February 04, 2015, 02:59:09 pm »
I ALSO GOT THE CODE TO WORK
i put the code at the beginning and it worked thanks for ALL the help!

It shouldn't STAY at the top though.
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 #22 on: February 04, 2015, 10:11:49 pm »
Obviously do not leave it at the top if you find out what the problem is, but put it on the top to make sure the entire code is actually be executed correctly. You have some return ends, meaning that it may not be getting past the return end. People who actually try to problem solve, usually use "print" (I use "MsgN" because I see no difference) to see if there code is being executed to the next line of code. So I'll suggest to you to do the same, but instead of putting "print", use fancylogadmin and use it as a test.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: [ULX hates me]Help with a command AGAIN AGAIN
« Reply #23 on: February 05, 2015, 07:51:01 am »
Okay, well first off, I would never use "~" to declare "not", generally it's obsolete, and most people I would say do not know that actually means "not".

Slightly off-topic, but I would have to disagree. Garry added the "not" keyword (along with a couple others), and it does not exist in the lua standard- only '~' does. If you tried to move your lua experience to a non-gmod lua project (WoW?), then you'd be shooting yourself in the foot each time you tried to use 'not'.

If someone doesn't know that "~" means not, then they haven't read the basics in the lua manual, which SHOULD be a must for anyone wanting to learn the language.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

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 #24 on: February 05, 2015, 08:33:44 am »
If someone doesn't know that "~" means not, then they haven't read the basics in the lua manual, which SHOULD be a must for anyone wanting to learn the language.

My post was only Garry's Mod lua related. I understand that the tilde "~" is universal in some languages to not or opposite. Though, I mean, when do you ever see "~" in most people's code or gamemode. I had read a post (if I find it I'll link it) on facepunch, saying that the "tilde" is very missed when overviewing code, and to stop using it when you're trying to declare "not", and to use "!" or the actual word. So since then I had said the same thing, and never used "~".
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

  • Print