v36u Posted June 17, 2018 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
Moderators Patrick Posted June 17, 2018 Moderators Posted June 17, 2018 It is a Client-only function. Do you use it on client side? community profile | map converters | map images | pDownloader | pAttach | model encrypter
v36u Posted June 17, 2018 Author 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?
Moderators Patrick Posted June 18, 2018 Moderators 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 community profile | map converters | map images | pDownloader | pAttach | model encrypter
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