Feche1320 Posted July 12, 2011 Share Posted July 12, 2011 Why is this making an error on the debugscript saying 'C stack overflow' ? setRadioChannel(0) Link to comment
DiSaMe Posted July 12, 2011 Share Posted July 12, 2011 Stack overflow often is a result of infinite recursion. I guess this isn't your full script. Maybe you used this line in onClientPlayerRadioSwitch? If yes, then setRadioChannel triggers another onClientPlayerRadioSwitch which calls setRadioChannel again, and so on. If you want to make the radio station always 0, use setRadioChannel when player enters the vehicle and cancel the event when radio switch is attempted. Link to comment
Feche1320 Posted July 13, 2011 Author Share Posted July 13, 2011 Okay, I will try later, thanks! Link to comment
qaisjp Posted July 13, 2011 Share Posted July 13, 2011 Yes I did that when attempting to make custom radio, that sucks, setRadioChannel shouldn't trigger it Link to comment
Buffalo Posted July 13, 2011 Share Posted July 13, 2011 Just use it that way: local blockRadioEvent addEventHandler('onClientPlayerRadioSwitch',root,function() if blockRadioEvent then blockRadioEvent = nil return end if conditions then --e.g. channel == 0 blockRadioEvent = true setRadioChannel(0) end end) 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