• Creating a few classes
    9 replies, posted
Hi guys!, i try make a classes system?, for my HogwartsRP i make a few timer.Simple in serverside example: [CODE] util.AddNetworkString("init") util.AddNetworkString("screen2") util.AddNetworkString("screen3") function playenter2() net.Start("init") net.Broadcast() -- RECREO timer.Simple(1, function() net.Start("screen2") net.Broadcast() -- RECREO end) timer.Simple(60*20,function() net.Start("screen3") net.Broadcast() end) end hook.Add("PlayerInitialSpawn","Startscreen2", playenter2)[/CODE] Client: [CODE]surface.CreateFont( "enorme", { font = "Harry P", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name extended = false, size = 40, weight = 100, } ) surface.CreateFont( "titulo", { font = "Harry P", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name extended = false, size = 30, weight = 500, shadow = true, } ) function init() local Frame2 = vgui.Create("DFrame") Frame2:SetSize(310,210) Frame2:SetPos(ScrW()/2+495, ScrH()/5-5) Frame2:SetTitle("") Frame2:SetDraggable(false) Frame2:ShowCloseButton(false) function Frame2:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(255,255,255,255)) end local Frame = vgui.Create("DFrame") Frame:SetSize(300,200) Frame:SetPos(ScrW()/2+500, ScrH()/5) Frame:SetTitle("") Frame:SetDraggable(false) Frame:ShowCloseButton(false) function Frame:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(57,57,57,255)) end local Line = vgui.Create("DFrame", Frame) Line:SetSize(300,5) Line:SetPos(0,100) Line:SetTitle("") Line:SetDraggable(false) Line:ShowCloseButton(false) function Line:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(255,255,255,255)) end local Horario = vgui.Create("DLabel") Horario:SetPos(ScrW()/2+495, ScrH()/5-50) Horario:SetSize(100,60) Horario:SetText("Horario:") Horario:SetColor(Color(255,255,255)) Horario:SetFont("titulo") primero = "1º y 2º - " tercero = "3º y 4º - " quinto = "5º y 6º - " local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(10,25) Texto:SetText("CARGANDO...") Texto:SetColor(Color(255,255,255)) Texto:SetFont("enorme") local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(10,125) Texto:SetText("Espere a la siguiente clase.") Texto:SetColor(Color(255,255,255)) Texto:SetFont("titulo") end net.Receive("init",init)[/CODE] more files of client don't add When starts the next class, i retry and go back to the server, the inside makes me appear the first screen and not to make when people between already see class.
You're gonna have to get a translator because I'm not sure anyone can figure out what this is supposed to mean: [quote]more files of client don't add When starts the next class, i retry and go back to the server, the inside makes me appear the first screen and not to make when people between already see class.[/quote] What exactly is a class system? What are you trying to do? Where is the net.Receive for "screen2" and "screen3"? What on earth is this supposed to be?: [lua]primero = "1º y 2º - " tercero = "3º y 4º - " quinto = "5º y 6º - "[/lua]
this is for [CODE]surface.CreateFont( "enorme", { font = "Harry P", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name extended = false, size = 40, weight = 100, } ) surface.CreateFont( "titulo", { font = "Harry P", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name extended = false, size = 30, weight = 500, shadow = true, } ) function screen2() sound.PlayFile( "sound/ambient/alarms/alarm1.wav", "", function( station ) if ( IsValid( station ) ) then station:Play() end end ) local Frame2 = vgui.Create("DFrame") Frame2:SetSize(310,210) Frame2:SetPos(ScrW()/2+495, ScrH()/5-5) Frame2:SetTitle("") Frame2:SetDraggable(false) Frame2:ShowCloseButton(false) function Frame2:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(255,255,255,255)) end local Frame = vgui.Create("DFrame") Frame:SetSize(300,200) Frame:SetPos(ScrW()/2+500, ScrH()/5) Frame:SetTitle("") Frame:SetDraggable(false) Frame:ShowCloseButton(false) function Frame:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(57,57,57,255)) end local Line = vgui.Create("DFrame", Frame) Line:SetSize(300,5) Line:SetPos(0,100) Line:SetTitle("") Line:SetDraggable(false) Line:ShowCloseButton(false) function Line:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(255,255,255,255)) end primero = "1º y 2º - " tercero = "3º y 4º - " quinto = "5º y 6º - " local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(10,25) Texto:SetText("RECREO") Texto:SetColor(Color(255,255,255)) Texto:SetFont("enorme") local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(10,125) Texto:SetText("RECREO") Texto:SetColor(Color(255,255,255)) Texto:SetFont("enorme") end net.Receive("screen2",screen2)[/CODE] and [CODE]surface.CreateFont( "clases", { font = "Harry P", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name extended = false, size = 20, weight = 100, } ) surface.CreateFont( "enorme", { font = "Harry P", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name extended = false, size = 40, weight = 100, } ) function screen3() sound.PlayFile( "sound/ambient/alarms/alarm1.wav", "", function( station ) if ( IsValid( station ) ) then station:Play() end end ) local Frame2 = vgui.Create("DFrame") Frame2:SetSize(310,210) Frame2:SetPos(ScrW()/2+495, ScrH()/5-5) Frame2:SetTitle("") Frame2:SetDraggable(false) Frame2:ShowCloseButton(false) function Frame2:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(255,255,255,255)) end local Frame = vgui.Create("DFrame") Frame:SetSize(300,200) Frame:SetPos(ScrW()/2+500, ScrH()/5) Frame:SetTitle("") Frame:SetDraggable(false) Frame:ShowCloseButton(false) function Frame:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(57,57,57,255)) end local Line = vgui.Create("DFrame", Frame) Line:SetSize(300,5) Line:SetPos(0,100) Line:SetTitle("") Line:SetDraggable(false) Line:ShowCloseButton(false) function Line:Paint(w,h) draw.RoundedBox(0,0,0,w,h,Color(255,255,255,255)) end primero = "1-2" tercero = "3-4" quinto = "5-6" local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(5,15) Texto:SetText("Clase de Duelos") Texto:SetColor(Color(255,255,255)) Texto:SetFont("enorme") local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(5,115) Texto:SetText("Clase de Defensa C.A.O") Texto:SetColor(Color(255,255,255)) Texto:SetFont("enorme") local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(5,50) Texto:SetText("Aula: X") Texto:SetColor(Color(255,255,255)) Texto:SetFont("clases") local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(5,150) Texto:SetText("Aula: X") Texto:SetColor(Color(255,255,255)) Texto:SetFont("clases") local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(100,50) Texto:SetText("Año: " .. primero) Texto:SetColor(Color(255,255,255)) Texto:SetFont("clases") local Texto = vgui.Create("DLabel", Frame) Texto:SetSize(300,50) Texto:SetPos(100,150) Texto:SetText("Año: " .. tercero) Texto:SetColor(Color(255,255,255)) Texto:SetFont("clases") end net.Receive("screen3",screen3)[/CODE]
[QUOTE=JasonMan34;52245501]What exactly is a class system? What are you trying to do?[/QUOTE] Also: What is happening when you run the code? What do you want to have happen when you run the code?
[QUOTE=JasonMan34;52245501]You're gonna have to get a translator because I'm not sure anyone can figure out what this is supposed to mean: What exactly is a class system? What are you trying to do? Where is the net.Receive for "screen2" and "screen3"? What on earth is this supposed to be?: [lua]primero = "1º y 2º - " tercero = "3º y 4º - " quinto = "5º y 6º - "[/lua][/QUOTE] Just for SetText(primero .. "hello") for example [editline]18th May 2017[/editline] [QUOTE=JasonMan34;52245524]Also: What is happening when you run the code? What do you want to have happen when you run the code?[/QUOTE] The code works, the problem is that I would like that when someone enters the server, the class that everyone sees, also see it, but lower surface do that what it does is that when someone enters the server everyone is restarted. [editline]18th May 2017[/editline] [QUOTE=JasonMan34;52245524]Also: What is happening when you run the code?[/QUOTE] [IMG]http://i.imgur.com/Z3aS00f.png[/IMG]
I still have no clue what you're trying to say, but I'll try to help anyway Consider using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Send]net.Send[/url] instead of [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Broadcast]net.Broadcast[/url], and only send it to the player that spawned
[QUOTE=JasonMan34;52245617]I still have no clue what you're trying to say, but I'll try to help anyway Consider using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Send]net.Send[/url] instead of [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Broadcast]net.Broadcast[/url], and only send it to the player that spawned[/QUOTE] oh great! i try net.Send(ply) [editline]18th May 2017[/editline] [QUOTE=JasonMan34;52245617]I still have no clue what you're trying to say, but I'll try to help anyway Consider using [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Send]net.Send[/url] instead of [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/net/Broadcast]net.Broadcast[/url], and only send it to the player that spawned[/QUOTE] I'd like to that class appeared to them all at the same time. and when someone new, who shows them the same class as the rest.
He doesn't know the meaning of "Class", i think he meant he wants to do a round system were players assists Although you must know that classes are a way to define objects, example npc_combine_s is a class, that thing you are trying to do, aren't classes
[QUOTE=gonzalolog;52245848]He doesn't know the meaning of "Class", i think he meant he wants to do a round system were players assists Although you must know that classes are a way to define objects, example npc_combine_s is a class, that thing you are trying to do, aren't classes[/QUOTE] Gonzo, El Significado de clases en inglés es Classes Me refiero a crear una horario, un planning o algo por el estilo y que cada persona que entre al servidor vea la clase actual pero con net.Send no creo que lo consiga.
This forum is only for english, you misunderstood class meaning, that's why nobody can't help you, for programming when you mean classes, it's not the same meaning than refering to school You are looking for a round system, just run a timer, and then run net.Broadcast to show it to everyone, create another timer once it finished and run net.Broadcast again
Sorry, you need to Log In to post a reply to this thread.