MR.S3D Posted January 16, 2013 Posted January 16, 2013 Can I cancel the chat on my server? yes you need Cancle event onPlayerChat Welcom to my server Q.5 Current game type in my server Drift my Email : [email protected] Programming level: 90%
csiguusz Posted January 16, 2013 Posted January 16, 2013 Or just do showChat(false) Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003
iPrestege Posted January 16, 2013 Author Posted January 16, 2013 Can I cancel the chat on my server? yes you need Cancle event onPlayerChat Like That? local root = getRootElement() function chatbox(text, type) cancelEvent() if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Big.Admin")) then cancelEvent() elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("msol-admin")) then cancelEvent() end end addEventHandler("onPlayerChat", root, chatbox) Also i want to hide the chat : function Hide() showChat (false) end addEventHandler ( "onResourceStart", getRootElement(), Hide ) Or just do showChat(false) i want to cancel the chat for ever =D
MR.S3D Posted January 16, 2013 Posted January 16, 2013 Can I cancel the chat on my server? yes you need Cancle event onPlayerChat Like That? local root = getRootElement() function chatbox(text, type) cancelEvent() if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Big.Admin")) then cancelEvent() elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("msol-admin")) then cancelEvent() end end addEventHandler("onPlayerChat", root, chatbox) Also i want to hide the chat : function Hide() showChat (false) end addEventHandler ( "onResourceStart", getRootElement(), Hide ) Or just do showChat(false) i want to cancel the chat for ever =D local root = getRootElement() addEventHandler("onPlayerChat", root, function() cancelEvent() end) Welcom to my server Q.5 Current game type in my server Drift my Email : [email protected] Programming level: 90%
MR.S3D Posted January 16, 2013 Posted January 16, 2013 You're welcome. Welcom to my server Q.5 Current game type in my server Drift my Email : [email protected] Programming level: 90%
Sora Posted January 16, 2013 Posted January 16, 2013 local root = getRootElement() addEventHandler("onPlayerChat", root, function() cancelEvent() end) you don't need to define root , because it's predefined .. https://wiki.multitheftauto.com/wiki/Pre ... ables_list [REL] Resource Starter System v1.3 [REL] Give Permissions Panel v1.4 [REL] Meta Creator 1.1 ( In-game MetaCreator ) [REL] ACL Permission Manager 1.0 [REL] Accounts Security Manager 1.1 Name(s) in-game : old |S.s|SoRa, current : *Sora
csiguusz Posted January 16, 2013 Posted January 16, 2013 you don't need to define root , because it's predefined .. https://wiki.multitheftauto.com/wiki/Pre ... ables_list But you can define it for better performance Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003
myonlake Posted January 16, 2013 Posted January 16, 2013 you don't need to define root , because it's predefined .. https://wiki.multitheftauto.com/wiki/Pre ... ables_list But you can define it for better performance Your argument is invalid. It does not improve the performance of anything, whether you used "root" instead of "getRootElement" or the other way around. "getRootElement" is already pre-defined as "root" by the Multi Theft Auto code, so you do not need to define it again, because it's no use. The only thing it does, it makes it faster to type, since "root" only takes four letters and "getRootElement" takes fourteen letters (sixteen with the last two brackets). If I helped you, please click the like button on the right Thanks!
csiguusz Posted January 16, 2013 Posted January 16, 2013 Using a local variable instead of a global one can be a bit faster ( http://lua-users.org/wiki/OptimisingUsingLocalVariables ) But i know, it is not necessary and doesn't counts much in this case. Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003
myonlake Posted January 16, 2013 Posted January 16, 2013 Using a local variable instead of a global one can be a bit faster ( http://lua-users.org/wiki/OptimisingUsingLocalVariables )But i know, it is not necessary and doesn't counts much in this case. Injecting pre-definitions into the C++ code of MTA and then comparing the speed to Lua local variables, I don't see much of a difference. Honestly speaking, if you have a problem with 1µs speed difference, then I don't get it. If I helped you, please click the like button on the right Thanks!
csiguusz Posted January 16, 2013 Posted January 16, 2013 Ahh... aren't you in a good mood today? As I said I know it's not much, I just told sora that it's not so bad to re-define a pre-defined variable. And of course: every µs is important! Owner of [HUN]Magyar Play Szerver 1.4, IP: 31.220.43.153:22003
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