• Print

Author Topic: Help With Command  (Read 10645 times)

0 Members and 1 Guest are viewing this topic.

Offline Livaco

  • Full Member
  • ***
  • Posts: 133
  • Karma: -37
    • Livaco
Re: Help With Command
« Reply #15 on: April 03, 2015, 08:40:48 am »
last thing, how do I make a string? a error said that it expected a string instead of a table on line 17
Here To Help And Be Happy And Help :)

My Website
My Addons
PermaBanV1.0

Quote from:  Livaco on April 12 at 9:10:20 PM
I May Be Dum But Am Still Better Then The Rest

Livaco Products©

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Help With Command
« Reply #16 on: April 03, 2015, 09:50:24 am »
What's the line of code it's talking about?  The problem is you're simply giving something a table instead of a string by the sounds of it.  Most likely just something got mixed up.

Offline Livaco

  • Full Member
  • ***
  • Posts: 133
  • Karma: -37
    • Livaco
Re: Help With Command
« Reply #17 on: April 03, 2015, 10:27:09 am »
if u need the error code its
Code: [Select]
[ERROR] bad argument #1 to ULib.cmds.TranslateCommand:defaultAccess (string expected, got table)
  1. error - [C]:-1
   2. checkArg - addons/ulib/lua/ulib/shared/misc.lua:520
    3. defaultAccess - addons/ulib/lua/ulib/shared/commands.lua:1218
     4. unknown - addons/ulx/lua/ulx/modules/sh/livaco.lua:17
      5. include - [C]:-1
       6. unknown - addons/ulx/lua/ulx/cl_init.lua:17
        7. include - [C]:-1
         8. unknown - addons/ulx/lua/ulib/modules/ulx_init.lua:4
          9. include - [C]:-1
           10. unknown - addons/ulib/lua/ulib/cl_init.lua:23
            11. include - [C]:-1
             12. unknown - addons/ulib/lua/autorun/ulib_init.lua:5
Here To Help And Be Happy And Help :)

My Website
My Addons
PermaBanV1.0

Quote from:  Livaco on April 12 at 9:10:20 PM
I May Be Dum But Am Still Better Then The Rest

Livaco Products©

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Help With Command
« Reply #18 on: April 03, 2015, 10:46:07 am »
Aaron asked for the line of code not the error, show us the line it's talking about

Offline Livaco

  • Full Member
  • ***
  • Posts: 133
  • Karma: -37
    • Livaco
Re: Help With Command
« Reply #19 on: April 03, 2015, 10:48:15 am »
the line is

Code: Lua
  1. ban:defaultAccess{ ULib.ACCESS_ADMIN }
Here To Help And Be Happy And Help :)

My Website
My Addons
PermaBanV1.0

Quote from:  Livaco on April 12 at 9:10:20 PM
I May Be Dum But Am Still Better Then The Rest

Livaco Products©

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Help With Command
« Reply #20 on: April 03, 2015, 03:22:45 pm »
ULib.ACCESS_ADMIN is a string, however you have it inside of a table, which is why you're getting an error
If you had looked at any other command that comes with ULX you would see parenthesizes rather than the table-squiggly things
Change your line to look like this: ban:defaultAccess( ULib.ACCESS_ADMIN )

Edit:
Looks like you changed it at some point because last time you posted your code that line was correct, but at some point you changed it to a table
« Last Edit: April 03, 2015, 03:25:39 pm by Zmaster »

Offline Livaco

  • Full Member
  • ***
  • Posts: 133
  • Karma: -37
    • Livaco
Re: Help With Command
« Reply #21 on: April 03, 2015, 03:59:36 pm »
I switched back to the old one becuse it wasent popping up and I wil try it tomorrow thx
Here To Help And Be Happy And Help :)

My Website
My Addons
PermaBanV1.0

Quote from:  Livaco on April 12 at 9:10:20 PM
I May Be Dum But Am Still Better Then The Rest

Livaco Products©

Offline Livaco

  • Full Member
  • ***
  • Posts: 133
  • Karma: -37
    • Livaco
Re: Help With Command
« Reply #22 on: April 04, 2015, 03:25:43 am »
Its Still The Same This Time No Error Though. But When I Run The Command One Error Appears

Code: [Select]
[ERROR] addons/ulx/lua/ulx/xgui/commands.lua:168: attempt to index field 'type' (a nil value)
  1. obj - addons/ulx/lua/ulx/xgui/commands.lua:168
   2. func - addons/ulx/lua/ulx/modules/cl/xlib.lua:1080
    3. animQueue_call - addons/ulx/lua/ulx/modules/cl/xlib.lua:1061
     4. func - addons/ulx/lua/ulx/modules/cl/xlib.lua:1080
      5. animQueue_call - addons/ulx/lua/ulx/modules/cl/xlib.lua:1061
       6. animQueue_start - addons/ulx/lua/ulx/modules/cl/xlib.lua:1048
        7. setselected - addons/ulx/lua/ulx/xgui/commands.lua:85
         8. OnRowSelected - addons/ulx/lua/ulx/xgui/commands.lua:305
          9. OnClickLine - lua/vgui/dlistview.lua:497
           10. unknown - lua/vgui/dlistview_line.lua:93
It Only Appears When I Try The Command Not Anay Other Time
« Last Edit: April 04, 2015, 03:29:04 am by Livaco »
Here To Help And Be Happy And Help :)

My Website
My Addons
PermaBanV1.0

Quote from:  Livaco on April 12 at 9:10:20 PM
I May Be Dum But Am Still Better Then The Rest

Livaco Products©

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Help With Command
« Reply #23 on: April 04, 2015, 03:56:10 am »
Post your CURRENT code please
Once you get to know me, you'll find you'll have never met me at all.

Offline Livaco

  • Full Member
  • ***
  • Posts: 133
  • Karma: -37
    • Livaco
Re: Help With Command
« Reply #24 on: April 04, 2015, 04:11:46 am »
Code: Lua
  1. local CATEGORY_NAME = "Livaco"
  2.  
  3. function ulx.ipban( calling_ply, target_ply, reason )
  4.         if target_ply:IsBot() then
  5.                 ULib.tsayError( calling_ply, "cannot ban a bot", false)
  6.                 return
  7.         end
  8.        
  9.         ULib.kickban( target_ply, reason, calling_ply )
  10.        
  11.         ulx.fancyLogAdmin( calling_ply, target_ply )
  12.        
  13. end
  14. local ban = ulx.command( CATEGORY_NAME, "ulx ipban", ulx.ipban, "!ipban" )
  15. ban:addParam(  type=ULib.cmds.Playerarg )
  16. ban:addParam( type=ULib.cmds.StringArg, hint="reason", ULib.cmds.optional, ULib.cmds.takeRestOfLine, completes=ulx.common_kick_resons )
  17. ban:defaultAccess( ULib.ACCESS_ADMIN )
  18. ban:help( "Permenentley Bans A Target" )
« Last Edit: April 04, 2015, 04:39:26 am by Livaco »
Here To Help And Be Happy And Help :)

My Website
My Addons
PermaBanV1.0

Quote from:  Livaco on April 12 at 9:10:20 PM
I May Be Dum But Am Still Better Then The Rest

Livaco Products©

Offline Livaco

  • Full Member
  • ***
  • Posts: 133
  • Karma: -37
    • Livaco
Re: Help With Command
« Reply #25 on: April 04, 2015, 04:47:03 am »
Ok I Fixed The Last Error Last Error I Think.
A Error Is Saying I Need To Add A ) Near The = In Line 0
1. Theirs No Line 0 But I Am Asuming That It Means Line 1
2. Its For The
Code: Lua
  1. local CATEGORY_NAME = "Livaco"
Code: [Select]
[ERROR] addons/ulx/lua/ulx/modules/sh/livaco.lua:15: ')' expected near '='
  1. unknown - addons/ulx/lua/ulx/modules/sh/livaco.lua:0
Now When I Add It On Ether Side Its Says That Its Unexpected
1. I Did What It Told Me To Do
The Code On What It Looks Like Is
Code: Lua
  1. local CATEGORY_NAME =) "Livaco"
Code: [Select]
[ERROR] addons/ulx/lua/ulx/modules/sh/livaco.lua:1: unexpected symbol near ')'
  1. unknown - addons/ulx/lua/ulx/modules/sh/livaco.lua:0
Here To Help And Be Happy And Help :)

My Website
My Addons
PermaBanV1.0

Quote from:  Livaco on April 12 at 9:10:20 PM
I May Be Dum But Am Still Better Then The Rest

Livaco Products©

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: Help With Command
« Reply #26 on: April 04, 2015, 05:46:47 am »
I want you to read this again, and correct yourself.

Code: [Select]
[ERROR] addons/ulx/lua/ulx/modules/sh/livaco.lua:15: ')' expected near '='
  1. unknown - addons/ulx/lua/ulx/modules/sh/livaco.lua:0

As well, fix your spelling and capitalization. Proofread your code, as Mr President said, dont ask us to write it for you.

HINT: IT INVOLVES LINES 15 AND 16
Once you get to know me, you'll find you'll have never met me at all.

Offline Livaco

  • Full Member
  • ***
  • Posts: 133
  • Karma: -37
    • Livaco
Re: Help With Command
« Reply #27 on: April 04, 2015, 06:00:18 am »
The Command Now Works Thx. I Will Give You Guys Credit When I Relese It.
Here To Help And Be Happy And Help :)

My Website
My Addons
PermaBanV1.0

Quote from:  Livaco on April 12 at 9:10:20 PM
I May Be Dum But Am Still Better Then The Rest

Livaco Products©

  • Print