Author Topic: !strip <player>  (Read 11126 times)

0 Members and 2 Guests are viewing this topic.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
!strip <player>
« on: August 11, 2007, 08:50:10 PM »
There have been plenty of times when simply stripping the weapons from an abusive player might solve some issues or whatever. I noticed how COnna had included a command to strip a player of all their weapons including their tool gun with SAT and I was wondering if this could be added to ULX. I think it is a needed addition to the best admin mod out there.

Please consider it.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: !strip <player>
« Reply #1 on: August 11, 2007, 09:36:42 PM »
Here is the command, put that in ulx/lua/ulx/fun.lua

Code: [Select]
function ulx.cc_stripweapons( ply, command, argv, args )
if #argv < 1 then
ULib.tsay( ply, ulx.LOW_ARGS )
return
end

local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
if not targets then
ULib.tsay( ply, err )
return
end

for _, v in ipairs( targets ) do
ulx.logUserAct( ply, v, "#A stripped #T's weapons" )
v:StripWeapons()
end
end
ulx.concommand( "strip", ulx.cc_stripweapons, "<user(s)> - Strips user(s)'s weapons.", ULib.ACCESS_ADMIN, "!strip", _, ulx.ID_PLAYER_HELP )

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: !strip <player>
« Reply #2 on: August 11, 2007, 09:55:42 PM »
Heh, don't you love how easy it is to add stuff to ULX? :D That whole code block was template except for one line.

Maybe we should work on making it even more module and robust. :)
Experiencing God's grace one day at a time.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: !strip <player>
« Reply #3 on: August 11, 2007, 10:06:48 PM »
Yes it's very easy to add things, for those who have a minimum of knowledge :)

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: !strip <player>
« Reply #4 on: August 12, 2007, 12:09:34 AM »
Thankyou very much for your help guys.. I appreciate it a lot.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: !strip <player>
« Reply #5 on: August 12, 2007, 12:17:08 AM »
All you people take mah old plugin ideas and stick em in ULX. /shakefist


Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: !strip <player>
« Reply #6 on: August 12, 2007, 07:07:43 AM »
Here is the command, put that in ulx/lua/ulx/fun.lua

I believe this is bad practice. Any changes you make would get overwritten during an update by us.
Meg, perhaps we should make a 'modules' folder for ULX?
ULib has a modules folder that will load code placed there after ULib loads...but there is no quick easy place to put functions/code that will load after ULX. I could see someone placing a bit of code there that should work with ULX, and it try to load first before ULX is loaded.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: !strip <player>
« Reply #7 on: August 12, 2007, 07:10:03 AM »
All you people take mah old plugin ideas and stick em in ULX. /shakefist

:P
We didn't include it in ULX.
Another member like yourself made a contribution. :D
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: !strip <player>
« Reply #8 on: August 12, 2007, 12:19:02 PM »
:P
We didn't include it in ULX.
Another member like yourself made a contribution. :D

This time.

;)


Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: !strip <player>
« Reply #9 on: August 12, 2007, 12:27:49 PM »
And now ULX is modularized! :D

Check out SVN if you wanna see it.
Experiencing God's grace one day at a time.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: !strip <player>
« Reply #10 on: August 12, 2007, 01:25:38 PM »
And now ULX is modularized! :D

Check out SVN if you wanna see it.

Hmm, what that mean exactly ?

Another question related to :
I believe this is bad practice. Any changes you make would get overwritten during an update by us.

Can i create a new file and place my commands in it (without bugs like commands not showing in ulx help), so this is not deleted when there is a svn update ?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: !strip <player>
« Reply #11 on: August 12, 2007, 01:29:10 PM »
With the new module system, you can just stick your commands in a separate file under the 'module' folder.
Experiencing God's grace one day at a time.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: !strip <player>
« Reply #12 on: August 12, 2007, 02:04:22 PM »
Ok, tested, works :)

Also i saw you did so commands are sorted alphabetically (ulx help), thanks.

But (sorry wrong place):
Code: [Select]
ULX version 3.20 (BETA) SVN revision 40 loaded.
Timer Error: base.lua:166: bad argument #1 to 'ipairs' (table expected, got nil)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: !strip <player>
« Reply #13 on: August 12, 2007, 07:06:55 PM »
Ok, tested, works :)

Also i saw you did so commands are sorted alphabetically (ulx help), thanks.

But (sorry wrong place):
Code: [Select]
ULX version 3.20 (BETA) SVN revision 40 loaded.
Timer Error: base.lua:166: bad argument #1 to 'ipairs' (table expected, got nil)

Hmm interesting. Either the ULX callback isn't working or something's seriously screwed up. Was this error on a listen server? Do you get it each time?
Experiencing God's grace one day at a time.

Offline jrarmas

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: !strip <player>
« Reply #14 on: September 27, 2013, 11:02:01 PM »
I have an issue when i insert the like
" function ulx.cc_stripweapons( ply, command, argv, args )
   if #argv < 1 then
      ULib.tsay( ply, ulx.LOW_ARGS )
      return
   end

   local targets, err = ULib.getUsers( argv[ 1 ], _, true, ply ) -- Enable keywords
   if not targets then
      ULib.tsay( ply, err )
      return
   end

   for _, v in ipairs( targets ) do
      ulx.logUserAct( ply, v, "#A stripped #T's weapons" )
      v:StripWeapons()
   end
end
ulx.concommand( "strip", ulx.cc_stripweapons, "<user(s)> - Strips user(s)'s weapons.", ULib.ACCESS_ADMIN, "!strip", _, ulx.ID_PLAYER_HELP )"

i load up my server and it boots me (to main menu) saying "Too many lua errors"

PLEASE HELP!