Author Topic: Disabling /drop to a certain job, need help!  (Read 1955 times)

0 Members and 1 Guest are viewing this topic.

Offline Rain

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Disabling /drop to a certain job, need help!
« on: July 04, 2017, 04:50:58 AM »
DarkRP Help,

I've ran into an issue, I'm currently in dev of my server and came across an issue, I have armory for government teams and the weapons are quite alot cheaper and the issue i have come across is that i cannot find a way to disable the /drop for specific teams! i have tried searching around for the last 2 days and have had no luck. I'm wondering if any of you god(s)(esses) can assist me in the pickle ive got myself in.

short story
- either lua code help to remove /drop for specific teams
- or lua code to make it so certain guns cannot be dropped by specific teams

My knowledge of lua is not that great and what im good at is editing lua not creating it! so please bare in mind thank you in advanced to any helpers!

Offline Rain

  • Newbie
  • *
  • Posts: 16
  • Karma: 0
Re: Disabling /drop to a certain job, need help!
« Reply #1 on: July 06, 2017, 06:47:29 AM »
So i have managed to try some things but no luck!

i have tried these 2 hooks but nothing is working, placing them in lua/autorun/server

// 1
hook.Add( "CanDropWeapon", "DisableCPDrops", function( _p, wep )
if _p:isCP() then return false
end )
// 2
hook.Add( "CanDropWeapon", "DisableCPDrop", function( _p, wep ) return false !_p:isCP()
end )

any help would be amazing thanks!

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given