• Deathscreen Error
    5 replies, posted
Hello, Ive got my own deathscreen, but it gives an error that i can't solve or maybe im just to blind to see it. When a player dies a screens pops up and they have to click a button in order to respawn. But when the player clicks the button they don't respawn and it gives the following error: [CODE] [ERROR] lua/autorun/client/cl_deathscreen.lua:193: Calling net.Start with unpooled message name! [http://goo.gl/qcx0y] 1. Start - [C]:-1 2. DoClick - lua/autorun/client/cl_deathscreen.lua:193 3. unknown - lua/vgui/dlabel.lua:232 [/CODE] Here is my button and deathscreen loader: [CODE] local ExitButton = vgui.Create( "DButton", DeathScreenFrame ) ExitButton:SetFont("Lobby") ExitButton:SetText( "Exit to game" ) ExitButton:SetTextColor( Color(255,255,255,250) ) ExitButton:SetSize(200, 50) ExitButton:SetPos( ScrW() / 1 - 165 - ExitButton:GetWide(), ScrH() - 100 - ExitButton:GetTall() ) ExitButton.Paint = function(self, w, h) draw.RoundedBox( 0, 0, 0, w, h, Color( 50, 50, 50, 150 ) ) end ExitButton.DoClick = function(self) DeathScreenFrame:Close() net.Start("PUBG_RequestExitGame") net.SendToServer() end[/CODE] [CODE]util.AddNetworkString( "PUBG_DeathScreen" ) local GM_TABLE if(GM) then GM_TABLE = GM else GM_TABLE = GAMEMODE end function GM_TABLE:PlayerDeath( ply, inflictor, attacker ) net.Start("PUBG_DeathScreen") net.WriteBool(true) net.Send(ply) if(ply == attacker) then ply:AddFrags(1) end end function GM_TABLE:PlayerSpawn( ply ) net.Start("PUBG_DeathScreen") ply:Spawn() net.WriteBool(false) net.Send(ply) end function GM_TABLE:PlayerDeathThink( ply ) return; end[/CODE] Thanks in advance.
You need to do [code]util.AddNetworkString()[/code] for the "PUBG_RequestExitGame"
Or your can just follow [url=http://goo.gl/qcx0y]that URL[/url] from the error
[QUOTE=Gmod4phun;52892795]You need to do [code]util.AddNetworkString()[/code] for the "PUBG_RequestExitGame"[/QUOTE] Ahh, i was blind after all. It now gives no errors, but the player doesn't respawn?
[QUOTE=DevJekko;52892892]Ahh, i was blind after all. It now gives no errors, but the player doesn't respawn?[/QUOTE] Because you're overriding the gamemode PlayerDeath hook instead of using hook.Add.
[QUOTE=txike;52892897]Because you're overriding the gamemode PlayerDeath hook instead of using hook.Add.[/QUOTE] I see it! Thank you!
Sorry, you need to Log In to post a reply to this thread.