kevin11 Posted May 2, 2010 Share Posted May 2, 2010 sorry for post flooding this is my final question /ban /kick etc how do i change it to !ban !kick Link to comment
dzek (varez) Posted May 2, 2010 Share Posted May 2, 2010 you cant just change that one letter, to be recognized as commands.. you have to use "onPlayerChat" event, then check if his/her msg starts with "!" and after theres command you want to handle, then handle it.. (and cancell onPlayerChat event) you will have to rewrite all addCommandHandler from all scripts.. for my opinion -> this is stupid. Link to comment
Aibo Posted May 2, 2010 Share Posted May 2, 2010 it is really stupid, i'm still wondering why people like old mIRC script commands anyway, you need only something like this: addEventHandler("onPlayerChat", getRootElement(), function (text) if string.sub(text, 1, 1) == "!" then cancelEvent() local command = string.gsub(gettok(text, 1, 32), "!", "") local args = string.gsub(text, "!"..command, "") --outputChatBox(getPlayerName(source)..": "..text, getRootElement()) executeCommandHandler(command, source, args) end end ) if you want to display the command typed, uncomment the outputChatBox line. Link to comment
kevin11 Posted May 2, 2010 Author Share Posted May 2, 2010 Access denied @ 'executeCommandHandler' - Line: 8 ? i added it in admin (acl) and still nothing Link to comment
Callum Posted May 2, 2010 Share Posted May 2, 2010 The server must be restarted for ACL to be updated. Link to comment
kevin11 Posted May 2, 2010 Author Share Posted May 2, 2010 i restarted and checked everything but didnt work Link to comment
dzek (varez) Posted May 2, 2010 Share Posted May 2, 2010 first of all, you must STOP the server, then modify ACL, then start server.. Link to comment
kevin11 Posted May 2, 2010 Author Share Posted May 2, 2010 first of all, you must STOP the server, then modify ACL, then start server.. ok this is what i did stop server /shutdown in game modified the acl then i open the server and it shows the error Link to comment
Callum Posted May 2, 2010 Share Posted May 2, 2010 Is your resource called exactly "commands!", or is the ! a typo? Link to comment
robhol Posted May 2, 2010 Share Posted May 2, 2010 Having non-standard characters in resource names probably isn't a good idea anyways. Keep to alphanumerical and underscore (_), it should be enough and is definitely safe. Link to comment
kevin11 Posted May 2, 2010 Author Share Posted May 2, 2010 nope sorry its commands not commands! Link to comment
Callum Posted May 2, 2010 Share Posted May 2, 2010 Then that's the problem in your ACL Link to comment
kevin11 Posted May 2, 2010 Author Share Posted May 2, 2010 can someone call me a retard please i didnt add commands resource in resources lol im sorry for wasting your time (its working) Link to comment
karlis Posted May 3, 2010 Share Posted May 3, 2010 if you want to display the command typed, uncomment the outputChatBox line. thats stupid, just don't cancel event then, besides your output is not fully functional Link to comment
Aibo Posted May 3, 2010 Share Posted May 3, 2010 if you want to display the command typed, uncomment the outputChatBox line. thats stupid, just don't cancel event then, besides your output is not fully functional cancelling is done for a reason, you know. if event is not cancelled, command will be executed BEFORE chat output, since it's called from chat event. so if the command called prints something to the chat, IT will look stupid. and exactly what do you mean "not fully functional"? Link to comment
karlis Posted May 3, 2010 Share Posted May 3, 2010 you said if you want to still show the command just uncoment --- it isnt functional because it dont have nametag colored, and output at chat is not prevented from hex and eg. \n Link to comment
Aibo Posted May 3, 2010 Share Posted May 3, 2010 well then improve it, i never said it is perfect or anything. i said "something like". Link to comment
karlis Posted May 3, 2010 Share Posted May 3, 2010 i think this is completley fucntional, correct me if im wrong outputChatBox(getPlayerName(source)..": #FFFFFF".."%q":format(text:gsub("#%x%x%x%x%x%x","")),getRootElement(),240,30,150,true) 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