For some reason, I can't seem to stream data to the server in singleplayer or a listen server anymore. Here's what I'm doing:
On the client:
[lua]local function Done( ) print( "Done sending." ); end
local function Accepted( accepted, tempid, id )
if accepted then
LocalPlayer():ChatPrint( "Temporary stream " .. tempid .. " was accepted! It's official ID is now " .. id );
else
LocalPlayer():ChatPrint( "Temporary stream " .. tempid .. " was denied." );
end
end
datastream.StreamToServer("playSong_cl",str,Done,Accepted)[/lua]
On the server:
[lua] hook.Add("AcceptStream","AllowSongs",function(pl,hand,id)
for _,v in ipairs(player.GetAll()) do v:ChatPrint(pl:Name().." - "..hand.." - "..id.."\n") end
if pl:IsAdmin() or hand=="playSong_cl" then return true end
end)
datastream.Hook("playSong_cl",function(pl,hand,id,enc,dec)
datastream.StreamToClients(player.GetAll(),"playSong_sv",dec)
end)[/lua]
However, neither hooks are being called. When I try and stream, it just tells me "Temporary stream 1 was denied." It doesn't even try to check the AcceptStream, it just flat-out rejects it. Help?
*Note: I've also tried restarting Gmod, but it didn't work. And for some reason this worked fine earlier.
Sorry, you need to Log In to post a reply to this thread.