• Print

Author Topic: How to make it so freeze is disabled if being whipped?  (Read 4537 times)

0 Members and 1 Guest are viewing this topic.

Offline JohnnyAppleseed

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
How to make it so freeze is disabled if being whipped?
« on: October 24, 2015, 11:18:29 am »
Hello everyone! I run a darkrp server, and I would like to figure out how to make it so that if a player is being whipped, they can't be frozen?
Code: [Select]
if v.whipped then
ULib.tsayError( calling_ply, v:Nick() .. " is being whipped!", true )
v:Unlock()
v.frozen = nil
ulx.clearExclusive( v )
end
that's what we've tried. But it doesn't work!

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: How to make it so freeze is disabled if being whipped?
« Reply #2 on: October 27, 2015, 03:27:13 pm »
Just tested it, but its not right, and it is all that I could think of atm >_> Sorry.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: How to make it so freeze is disabled if being whipped?
« Reply #3 on: October 29, 2015, 08:13:25 am »
I'm not sure where you guys are putting that code, but you're going to need to modify the freeze command itself. Just put a check at the top for v.whipped and print a message and return to prevent them from being frozen. It's not a good idea to overwrite the default ULX files because any changes will be lost when you update, so instead you should make a separate addon with a duplicate of the freeze command with your custom changes.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

  • Print