• file.Write/Read
    3 replies, posted
Hey peps. Im making this test gamemode. and i wonder. How do i make it skip the register part where u enter stuff in TextEntry and it uploads to a txt file with Write? I know its something about read but, i dont know how its supposed to make it read before the vgui is called. And if their info is there. They get their stuff. Pl0x help xD CL_Init.lua [code] include( "shared.lua" ) function TeamMenu() -- Skapar funktionen TeamMeny local Team = vgui.Create( "DFrame" ) -- Skapar själva DFramen Team:SetPos( 250, 500 ) -- Positionen på skärmen Team:SetSize( 250, 250 ) -- Storleken Team:SetTitle( "Zombie Outbreak Character Menu" ) -- Titeln på dermaframen Team:SetVisible( true ) -- Synlig. ja såklart Team:SetDraggable( false ) -- Man kan inte dra runt den Team:ShowCloseButton( false ) -- Closeknappen visas ej Team:MakePopup() -- Gör så vi kan använda den utanför själva ESC området local Text1 = vgui.Create( "DTextEntry", Team ) Text1:SetPos( 15, 15 ) Text1:SetTall( 75 ) Text1:SetWide( 200 ) Text1:SetText( "Username: " ) Text1.OnEnter = function() file.Write( "zombie/gubbar.txt", ..Text1:GetValue().. "\n" ) end [/code] init.lua [code] AddCSLuaFile( "cl_init.lua" ) AddCSLuaFile( "shared.lua" ) include( "shared.lua" ) function GM:PlayerInitialSpawn( ply ) umsg.Start( "call_vgui", ply ) umsg.End() end function GM:OnNPCKilled( victim, killer, weapon ) HUD_PRINTCENTER( victim:GetClass() .. " was killed by " .. killer:GetName().. " with a " .. weapon:GetClass() .. ".\n" ) end [/code] Its not big progress. but thats becuz i need this first xD Srry if im nub:D
Just comment out the user message and the user message function. And what?
We don't speak your foreign, boy. But just do what Horsey said. Take out the usermessages.
Oh forgot that. Well. If i take does out does it still popup atleast the first time? And i dont know how to make it read it at playerjoin.
Sorry, you need to Log In to post a reply to this thread.