• ERROR Again
    12 replies, posted
Sorry for posting so many post's, but i just need help. I know you guy's think the answer is obvious, but i just startet today. :) But let's move on Console: [CODE] Please check your console for more information! [ERROR] Lua is unable to understand file "darkrp_modules/CarDealer/sv_config.lua" because its author made a mistake around line number 22. The best help I can give you is this: Right before the 'concommand', Lua expected to read an '='-sign, but it didn't. Hints: - Did you simply forget the '='-sign? - Did you forget a comma? - Is this supposed to be a local variable? ------- End of Simplerr error ------- [/CODE] My Code [CODE]function MyFrame() local ply = LocalPlayer() local Frame = vgui.Create( "DFrame" ) Frame:SetPos( 5, 5 ) Frame:SetSize( 300, 150 ) Frame:SetTitle( "RazFrame" ) Frame:SetVisible( true ) Frame:SetDraggable( false ) Frame:ShowCloseButton( false ) Frame:MakePopup() end local function OpenMyFrame( ply, text, team) if string.sub( text, 1, 10 ) == "!frameopen" then ply:RunConsoleCommand("OpenMyFrame") end end hook.Add( "PlayerSay", "OpenMyFrame", OpenMyFrame ) concommand.Add( "Open_MyFrame", MyFrame )[/CODE] Big thanks for replies. :) - Raz
RunConsoleCommand it's not a player method
Its ply:ConCommand("OpenMyFrame")
Just did some coding, still same error The new code [CODE]function MyFrame() local ply = LocalPlayer() local Frame = vgui.Create( "DFrame" ) Frame:SetPos( 5, 5 ) Frame:SetSize( 300, 150 ) Frame:SetTitle( "RazFrame" ) Frame:SetVisible( true ) Frame:SetDraggable( false ) Frame:ShowCloseButton( false ) Frame:MakePopup() end local function OpenMyFrame( ply, text, team) if string.sub( text, 1, 10 ) == "!frameopen" then RunConsoleCommand("Open_MyFrame") end end hook.Add( "PlayerSay", "OpenMyFrame", OpenMyFrame )• concommand.Add( "Open_MyFrame", MyFrame ) [/CODE]
What's this character in hook add • Can you check your code?
Where do you see this •? [editline]23rd December 2015[/editline] [QUOTE=gonzalolog;49370945]What's this character in hook add • Can you check your code?[/QUOTE] Ohh it was something it just added when i posted it on the forum, its not in my code. [CODE]a is unable to understand file "darkrp_modules/CarDealer/sv_config.lua" because its author made a mistake around line number 22. The best help I can give you is this: Right before the 'concommand', Lua expected to read an '='-sign, but it didn't. Hints: - Did you simply forget the '='-sign? - Did you forget a comma? - Is this supposed to be a local variable? ------- End of Simplerr error -------[/CODE]
Check your code, we won't spoon feed on you [t]http://i.imgur.com/EzJb2yf.jpg[/t]
I'm unsure why you need to make a console command for this. Just call your function that draws the derma elements. [lua] function MyFrame() local ply = LocalPlayer() local Frame = vgui.Create( "DFrame" ) Frame:SetPos( 5, 5 ) Frame:SetSize( 300, 150 ) Frame:SetTitle( "RazFrame" ) Frame:SetVisible( true ) Frame:SetDraggable( false ) Frame:ShowCloseButton( false ) Frame:MakePopup() end concommand.Add( "OpenMyFrame", MyFrame ); hook.Add( "PlayerSay", "OpenMyFrame", function( ply, text, team ) if string.sub( text, 1, 10 ) == "!frameopen" then RunConsoleCommand( "OpenMyFrame" ); end end) [/lua] --EDIT-- My bad, I didn't see that it's server-sided until I went and looked. Ignore me.
The • Was something it added when i posted it on the forum, as you can see if you take some time to read my message you would see that i said that before. But here is the code [CODE]function MyFrame() local ply = LocalPlayer() local Frame = vgui.Create( "DFrame" ) Frame:SetPos( 5, 5 ) Frame:SetSize( 300, 150 ) Frame:SetTitle( "RazFrame" ) Frame:SetVisible( true ) Frame:SetDraggable( false ) Frame:ShowCloseButton( false ) Frame:MakePopup() end local function OpenMyFrame( ply, text, team) if string.sub( text, 1, 10 ) == "!frameopen" then RunConsoleCommand("Open_MyFrame") end end hook.Add( "PlayerSay", "OpenMyFrame", OpenMyFrame ) concommand.Add( "Open_MyFrame", MyFrame )[/CODE]
PlayerSay it's serversided
[QUOTE=gonzalolog;49371059]PlayerSay it's serversided[/QUOTE] What should i replace it with?
Network PlayerSay or use OnPlayerChat in case no hooks overwrite it
[QUOTE=gonzalolog;49371087]Network PlayerSay or use OnPlayerChat in case no hooks overwrite it[/QUOTE] Thanks, i will try the OnPlayerChat, have a nice day. :) [editline]23rd December 2015[/editline] Thanks for the Replies :) Huge thank to gonzalolog
Sorry, you need to Log In to post a reply to this thread.