Sasu Posted March 26, 2013 Share 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) Link to comment
PaiN^ Posted March 26, 2013 Share 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) Link to comment
iPrestege Posted March 26, 2013 Share Posted March 26, 2013 What you are trying to do ._. Link to comment
Sasu Posted March 26, 2013 Author Share Posted March 26, 2013 Cancel event if the Player isnt logged in. Link to comment
Markeloff Posted March 26, 2013 Share 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) Link to comment
Sasu Posted March 26, 2013 Author Share 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 Link to comment
iPrestege Posted March 26, 2013 Share Posted March 26, 2013 ._. What you are trying to do?? Link to comment
TAPL Posted March 26, 2013 Share Posted March 26, 2013 I guess the output that comes in the chat is from the freeroam. 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