rebel1324 / NutScript

A free role-play framework for Garry's Mod.
http://nutscript.net
MIT License
65 stars 31 forks source link

Check against CanPlayerJoinClass #333

Closed Stanstar22 closed 3 years ago

Stanstar22 commented 4 years ago

So we can deny access to a class via a hook other than having to do it within class files per each class

Will only deny access to class if we return a value of false.

Extremely useful for checking against a mass of classes instead of having to set a check in each class file

TovarischPootis commented 3 years ago

This allows this hook hook.Run("CanPlayerJoinClass", client, class, info) to be run externally apart from the class files themselves. Also, the hook just needs to return false to do its function, which is far simpler and convenient