GrainHHH Posted July 6, 2019 Share Posted July 6, 2019 (edited) function addRadio () outputChatBox ( " WOOOORKS " ) outputChatBox ( "You're currently listening to " .. getRadioChannelName ( getRadioChannel() ) .. "!" ) end addCommandHandler ( "MyRadio", addRadio, bool restricted = false, bool caseSensitive = false ) What's wrong with this code? Why the hell it doesn't work? ( Nothing happens when i enter the command ) this command must be available for evereone in any case ( I mean it doesn't matter whether i enter /MyRadio or /myradio, /MyRaDiO and so on ) Thank you in advance Edited July 6, 2019 by GrainHHH Link to comment
Scripting Moderators ds1-e Posted July 6, 2019 Scripting Moderators Share Posted July 6, 2019 23 minutes ago, GrainHHH said: function addRadio () outputChatBox ( " WOOOORKS " ) outputChatBox ( "You're currently listening to " .. getRadioChannelName ( getRadioChannel() ) .. "!" ) end addCommandHandler ( "MyRadio", addRadio, bool restricted = false, bool caseSensitive = false ) What's wrong with this code? Why the hell it doesn't work? ( Nothing happens when i enter the command ) this command must be available for evereone in any case ( I mean it doesn't matter whether i enter /MyRadio or /myradio, /MyRaDiO and so on ) Thank you in advance Try like that: function addRadio() outputChatBox("WOOOORKS") outputChatBox("You're currently listening to "..getRadioChannelName(getRadioChannel()).."!") end addCommandHandler("MyRadio", addRadio, false, false) And if this wouldn't work, be sure that code is in client-side, also check debugscript 3 for errors/warnings. Link to comment
GrainHHH Posted July 6, 2019 Author Share Posted July 6, 2019 2 hours ago, majqq said: Try like that: function addRadio() outputChatBox("WOOOORKS") outputChatBox("You're currently listening to "..getRadioChannelName(getRadioChannel()).."!") end addCommandHandler("MyRadio", addRadio, false, false) And if this wouldn't work, be sure that code is in client-side, also check debugscript 3 for errors/warnings. Thank god i got it. But there's mistake in your code ( "addCommandHandler " for client-sided type can take only 3 arguments - commandName, handlerFunction, caseSensitive ). But anyway it hepled me so thank you, i really appreciate it. And sorry for my english) 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