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) State: Inactive
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) " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
Sasu Posted March 26, 2013 Author Posted March 26, 2013 Cancel event if the Player isnt logged in. State: Inactive
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) Some people want it to happen, some wish it would happen, others make it happen.
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 State: Inactive
TAPL Posted March 26, 2013 Posted March 26, 2013 I guess the output that comes in the chat is from the freeroam.
Markeloff Posted March 26, 2013 Posted March 26, 2013 Your welcome Sasuke Some people want it to happen, some wish it would happen, others make it happen.
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