JanKy Posted June 17, 2018 Share Posted June 17, 2018 Umm, hey guys. I don't understand why i get this error in the debugscript : "attempt to call 'getRadioChannel' ( a nil value )" Also, even if i use setRadioChannel alone, i get the same error : "attempt to call 'setRadioChannel' ( a nil value )" Also, here's the code if getRadioChannel() ~= 0 then setRadioChannel(0) cancelEvent() end Link to comment
Moderators Patrick Posted June 17, 2018 Moderators Share Posted June 17, 2018 It is a Client-only function. Do you use it on client side? Link to comment
JanKy Posted June 17, 2018 Author Share Posted June 17, 2018 Oh, silly me. Wasn't on client side. But now it is, like this : addEventHandler("onPlayerVehicleEnter", root, function() if getRadioChannel() ~= 0 then setRadioChannel(0) cancelEvent() end end); No errors, but the radio still works. Any ideas to make it stop? Link to comment
Moderators Patrick Posted June 18, 2018 Moderators Share Posted June 18, 2018 (edited) 8 hours ago, JanKy said: Oh, silly me. Wasn't on client side. But now it is, like this : addEventHandler("onPlayerVehicleEnter", root, function() if getRadioChannel() ~= 0 then setRadioChannel(0) cancelEvent() end end); No errors, but the radio still works. Any ideas to make it stop? addEventHandler("onClientVehicleStartEnter", getRootElement(), function() setRadioChannel(0) end) addEventHandler("onClientPlayerRadioSwitch", getRootElement(), function() cancelEvent() end) Edited June 18, 2018 by Patrick2562 Link to comment
JanKy Posted June 18, 2018 Author Share Posted June 18, 2018 Oh, thanks. Solved it ^^ 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