Hi!
Could G1R:MP expose server-side hooks that let custom resources reject gameplay actions before their effects are applied?
According to the wiki, pickup, drop and damage events report completed changes.
For RP servers, public pre-action hooks would allow ownership checks, protected items and custom combat restrictions.
For example.:
_____________________________________________________
addEventHandler("onPlayerRequestPickup", root,
function(playerId, objectId)
-- Custom permission check
if not canPlayerTakeItem(playerId, objectId) then
cancelEvent()
end
end
)
_____________________________________________________
Similar hooks for dropping, equipping, consuming items and applying damage would be useful. Cancellation should prevent the action without requiring scripts to undo inventory or health changes afterward.
This would complement the existing native validation and completion events. Are public pre-action hooks planned?
Could G1R:MP expose server-side hooks that let custom resources reject gameplay actions before their effects are applied?
According to the wiki, pickup, drop and damage events report completed changes.
For RP servers, public pre-action hooks would allow ownership checks, protected items and custom combat restrictions.
For example.:
_____________________________________________________
addEventHandler("onPlayerRequestPickup", root,
function(playerId, objectId)
-- Custom permission check
if not canPlayerTakeItem(playerId, objectId) then
cancelEvent()
end
end
)
_____________________________________________________
Similar hooks for dropping, equipping, consuming items and applying damage would be useful. Cancellation should prevent the action without requiring scripts to undo inventory or health changes afterward.
This would complement the existing native validation and completion events. Are public pre-action hooks planned?