Author Topic: PAC3 Model Restriction Help  (Read 158 times)

0 Members and 1 Guest are viewing this topic.

Offline Merlin

  • Newbie
  • *
  • Posts: 11
  • Karma: 0
PAC3 Model Restriction Help
« on: May 30, 2019, 01:32:19 PM »
I'm trying to make a restriction file similar to that of restricting the "PrePACEditorOpen" & "PACRankRestrict" hooks.

The hooks for spawning props via the PAC menu are "PlayerSpawnProp" & "pac_PlayerSpawnProp"

But i'm stumped on how to make the model function work.

This is what I have so far:

Code: Lua
  1. pac.AddHook("PlayerSpawnProp", "pac_PlayerSpawnProp", function(model)

Offline BlueNova

  • Full Member
  • ***
  • Posts: 110
  • Karma: 12
  • The most powerful force in the universe.
Re: PAC3 Model Restriction Help
« Reply #1 on: May 30, 2019, 10:02:48 PM »
Say you want only admins to be able to spawn props you could probably do something like this, assuming hooks in this addon are the same as regular hooks
Code: Lua
  1. pac.AddHook("PlayerSpawnProp", "pac_PlayerSpawnProp", function(ply, model) --Not sure if there is a ply parameter
  2.      if not ply:IsAdmin() then return false end
  3. end)
« Last Edit: May 30, 2019, 11:40:35 PM by BlueNova »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 7997
  • Karma: 375
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: PAC3 Model Restriction Help
« Reply #2 on: June 01, 2019, 03:59:18 PM »
Words of caution -
If PAC follows standard add hook format like Gmod
example =  addhook(real hook, UNIQUE, function)
and pac truly has a hook name called "pac_PlayerSpawnProp", I presume you couldn't use the same UNIQUE name.
Both examples above place pac_PlayerSpawnProp in what would/should be unique.
« Last Edit: June 01, 2019, 04:00:51 PM by JamminR »
The price one pays for pursuing any profession or calling is an intimate knowledge of its ugly side. - James Baldwin