tzn Posted July 1 Share Posted July 1 Hello, why is the message sent by the player not canceled? local chatRadius = 20 function onPlayerChatSendMessageToNearbyPlayers(messageText, messageType) local normalMessage = (messageType == 0) if (not normalMessage) then return false end local playerName = getPlayerName(source) local playerX, playerY, playerZ = getElementPosition(source) local playerInterior = getElementInterior(source) local playerDimension = getElementDimension(source) local nearbyPlayers = getElementsWithinRange(playerX, playerY, playerZ, chatRadius, "player", playerInterior, playerDimension) -- get nearby players within given radius local messageToOutput = playerName..": "..messageText outputChatBox(messageToOutput, nearbyPlayers, 255, 255, 255, true) cancelEvent() end addEventHandler("onPlayerChat", root, onPlayerChatSendMessageToNearbyPlayers) Link to comment
Moderators IIYAMA Posted July 1 Moderators Share Posted July 1 12 hours ago, tzn said: Hello, why is the message sent by the player not canceled? Most likely because of another resource. Use the AddDebugHook function on outputChatBox, to figure out which one. (this function shows you where a MTA function is called or event is triggered) Link to comment
tzn Posted July 5 Author Share Posted July 5 On 02/07/2024 at 02:29, IIYAMA said: Скорее всего из-за другого ресурса. Используйте функцию AddDebugHook на outputChatBox, чтобы выяснить, какой именно. (эта функция показывает, где вызывается функция MTA или запускается событие) Thank you very much! It turns out that the problem was in the playercolors resource 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now