Sasu Posted March 26, 2013 Posted March 26, 2013 Why it isn't cancel event? function chatNil(message, messageType) if messageType == 0 then local playerAcc = getPlayerAccount(source) if (not playerAcc) then cancelEvent() end end end addEventHandler("onPlayerChat", root, chatNil)
PaiN^ Posted March 26, 2013 Posted March 26, 2013 Becuase there is always an account ( a guest account ) function chatNil(message, messageType) if messageType == 0 then local playerAcc = getPlayerAccount(source) if ( playerAcc and isGuestAccount(playerAcc)) then cancelEvent() end end end addEventHandler("onPlayerChat", root, chatNil)
Markeloff Posted March 26, 2013 Posted March 26, 2013 function chatNil(message, messageType) if messageType == 0 then if ( getPlayerAccount(source) and isGuestAccount(playerAcc)) then cancelEvent() end end end addEventHandler("onPlayerChat", root, chatNil)
Sasu Posted March 26, 2013 Author Posted March 26, 2013 (edited) playerAcc is not defined. OFF: another sasuke EDIT: function chatNil(message, messageType) if messageType == 0 then if ( getPlayerAccount(source) and isGuestAccount(playerAcc)) then cancelEvent() end end end addEventHandler("onPlayerChat", root, chatNil) I changed and it works. Thanks you and Pain. function chatNil(message, messageType) if messageType == 0 then if ( isGuestAccount(getPlayerAccount(source))) then cancelEvent() end end end addEventHandler("onPlayerChat", root, chatNil) Edited March 26, 2013 by Guest
TAPL Posted March 26, 2013 Posted March 26, 2013 I guess the output that comes in the chat is from the freeroam.
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