DjSt3rios Posted August 10, 2011 Share Posted August 10, 2011 Hello, I was wondering if it is possible to disable the chat. I Tested Server Side onPlayerChat to use cancelEvent() but no luck. On client side, when i type, San andreas crashes... maybe there is another way to do it? Link to comment
JR10 Posted August 10, 2011 Share Posted August 10, 2011 toggleControl(player, "chatbox", false) Link to comment
DjSt3rios Posted August 10, 2011 Author Share Posted August 10, 2011 Hmm, Could you help me make it with a For so it can be applied to all players? for is pretty weird in lua Link to comment
JR10 Posted August 10, 2011 Share Posted August 10, 2011 for id, player in ipairs(getElementsByType("player")) do toggleControl(player, "chatbox", false) end Link to comment
DjSt3rios Posted August 10, 2011 Author Share Posted August 10, 2011 (edited) Thank you very much! EDIT: Actually its not working.. although i believed it would work.. maybe some help? I did it server-side... Edited August 10, 2011 by Guest Link to comment
DjSt3rios Posted August 10, 2011 Author Share Posted August 10, 2011 Im sorry, but its not working... I thought it would work as i used this function before, and was working fine.... i dont know, i tried many ways to fix it but nothing.. maybe any idea? EDIT: I made it work in Client-Side... Now i will try to fix it completely, thanks anyway Link to comment
JR10 Posted August 10, 2011 Share Posted August 10, 2011 You used it server side, so when the resource start, all the players won't be able to use the chat box. But when a player joins, he will be able to use the chat box. Because we used the loop, if you want it server side, use onPlayerJoin. 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