Called before a player or something on the server is attempting to change a state.
Used in: VCMod Main, VCMod ELS addons.
Shared GM:VC_canChangeState(Entity ent, String id, Mixed new, Mixed old, Entity ply)
1. Entity ent; Entity
Entity of which the state will be changed.
2. String id; State ID
The state reference ID.
3. Mixed new; New state
The new state, could be any type of variable or nil.
4. Mixed old; Old state
The new state, could be any type of variable or nil.
5. Entity ply; Player
This might not be valid if its not called by a player.
1. Boolean If it should allow the state to change or not.
hook.Add("VC_canChangeState", "VC_canChangeState_test", function(ent, id, new, old, ply) if IsValid(ply) and id == "HornOn" and string.find(ply:Nick(), "freemmaann") and new == true and !old then print("That naughty freemmann is attempting to use horn, lets stop him.") local can = false return can end end)