New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent People from buying equipment #1327

Merged
merged 2 commits into from Jan 19, 2017

Conversation

Projects
None yet
6 participants
@GamefreakDE
Contributor

GamefreakDE commented Jan 18, 2017

Added new hook "TTTCanOrderEquipment" to prevent people from buying equipment.
Open for any suggestions.

@robotboy655 robotboy655 added the TTT label Jan 18, 2017

@markusmarkusz

This comment has been minimized.

Contributor

markusmarkusz commented Jan 18, 2017

Something like TTTCanOrderEquipment might be better. (Consistence with other hooks like TTTCanIdentifyCorpse, etc.)

@svdm svdm merged commit fbd01f7 into Facepunch:master Jan 19, 2017

@GamefreakDE GamefreakDE deleted the GamefreakDE:preorderedequip branch Jan 20, 2017

@Facepunch Facepunch deleted a comment from windowsok Jul 10, 2017

@Kamshak

This comment has been minimized.

Contributor

Kamshak commented Nov 1, 2017

Can this be fixed to use

if hook.Run("TTTCanOrderEquipment", ply, id, is_item) == false then return end

That way you could add specific logic and not return anything for items you don't want to handle (so that other addons also get a chance to change the result)

@sannysc

This comment has been minimized.

Contributor

sannysc commented Nov 1, 2017

The behavior you described is already supported. If you don't want to deal with the item, then don't return anything, and the hook system will move on to the next listener. It is only when you return something other than nil does the hook stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment