• My addon causes people to crash :(
    0 replies, posted
This is the code I have been working on for a bit now. It's a crosshair designer. The problem is that when some people save a custom crosshair and then try to load it up again, their game crashes... The loading is done through executing console commands to change a client convar's value. I have even added a timer to slow down the process but it hasn't helped. --Snip of code, full code in pastebin [CODE] local function crossloadingsaves() local crosshairloading = "crosshair_designer/save_" .. Hc_whichtoload .. ".txt" if file.Exists( crosshairloading, "DATA" ) then local brokencrossstring = string.Explode( " ", file.Read( crosshairloading, "DATA" ) ) local hc_timer_i = 1 timer.Create( "hc_load_cross", 0.5, hc_con_num, function() RunConsoleCommand( hc_con_order[hc_timer_i], ( brokencrossstring[hc_timer_i] ) ) hc_timer_i = hc_timer_i + 1 if hc_timer_i == hc_con_num then hc_timer_i = 1 end end) else file.Write( crosshairloading, "0 1 0 1 0 1 29 0 255 255 5 13 1 0 8 0 1 255 0 0 255" ) -- default config RunConsoleCommand( "crosshairs_load_save" ) end end concommand.Add( "crosshairs_load_save", crossloadingsaves ) [/CODE] [url]http://pastebin.com/jzjyGpkk[/url] Thanks! (re-posted because last one was in the wrong section)
Sorry, you need to Log In to post a reply to this thread.