• Print

Author Topic: Problem with script  (Read 4271 times)

0 Members and 1 Guest are viewing this topic.

Offline ShadowTehAmazing

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Problem with script
« on: August 29, 2013, 10:43:22 am »
this was meant for Assmod im not sure how to make it work for ULX but can someone record this for ULX please

Code: Lua
  1. function killedTooMuch( att )
  2.        
  3.         if att:IsAdmin() then return false end
  4.         if shipdata[TEAM_RED].sinking||shipdata[TEAM_BLUE].sinking then return false end
  5.        
  6.         local kds = att.kd
  7.         if kds==2 then
  8.                
  9.                 att:PrintMessage(HUD_TALKCENTER, "You're team killing!")
  10.                
  11.         elseif kds>=5 then
  12.        
  13.                 if !starting then
  14.                        
  15.                         if ASS_VERSION then
  16.                                 ASS_BanPlayer( att, att:UniqueID( ), ( 7.5 * 60 ), "Automated temporary ban" )
  17.                         else
  18.                                 game.ConsoleCommand( "banid 7.5 "..tostring( att:UserID() ).." kick\n" )
  19.                         end
  20.                        
  21.                 end
  22.                
  23.         end
  24.        
  25. end

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Problem with script
« Reply #1 on: August 29, 2013, 04:42:14 pm »
This will work without ULX already, though you're missing the actual hooking piece.
Experiencing God's grace one day at a time.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2727
  • Karma: 430
    • |G4P| Gman4President
Re: Problem with script
« Reply #2 on: August 29, 2013, 08:49:02 pm »
You could also modify the ASSMod part for ULib if you wanted.

Code: [Select]
if ASS_VERSION then
ASS_BanPlayer( att, att:UniqueID( ), ( 7.5 * 60 ), "Automated temporary ban" )

into

Code: [Select]
if ULib then
ULib.kickban( att, 7.5 * 60, "Automated temporary ban" )



Here's your hook.
Code: [Select]
hook.Add( "PlayerDeath", "killedTooMuch", killedTooMuch)

And line one of your code will need to look like this:
Code: [Select]
function killedTooMuch( ply, _, att )
« Last Edit: August 29, 2013, 08:51:13 pm by MrPresident »

Offline ShadowTehAmazing

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Problem with script
« Reply #3 on: August 30, 2013, 06:42:11 am »
Oh my god thank you guys

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Problem with script
« Reply #4 on: August 30, 2013, 03:05:20 pm »
God's welcome.
You are too.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

  • Print