Addon Issues

Hello there.

So, I’m in the process of making my first addon, but I’ve kind of hit a roadblock here.

So I am making a derma panel, meant to forcefully make people take a look at the information on the screen, like rules, or gamemode information if you will, for an ‘x’
amount of seconds. I’ve created clientside file for the derma panel, and a serverside to call upon the derma panel via. networking through a PlayerSpawn/PlayerSay-hook.

If you’re wondering, the directory of these files are “lua/autorun/client” and “lua/autorun/server/” respectively.

Since I want multiple pages of these information sections, I decided to create a function with the parameters: ‘title’, ‘time’, ‘text’. Title being the title of the page, time being the amount of time needed to wait until you can click the ‘Next’ button, and text being the… well, text.

Now that that’s out of the way, let me tell you want my actual issue is. So, I decided to try and make a seperate file to store the excessive calling of the function, otherwise it would
just stack immensely inside the main file, which I don’t want for the sake of simplicity. The actual issue is, that if I try and use the ‘include’ function on the main file to add the other file, so that whatever is declared in said file also becomes apart of the main file, the console will simply give me an error, saying the file wasn’t found, even though it is in the same directory. If I try and use ‘include’ on the other file to include the main file, my game will crash on attempting to join the server.

Thank you :slight_smile:

Can you post the actual error and your code for including the file?

Why are you calling the function excessively if you’re only using it once for one single part of the panel?

How do I do snips? I’ve never used this site before up until now.

[editline]20th July 2017[/editline]

Because in the dermapanel, the text section are split up into ‘pages’, when you click the next button it goes to the next, so I kind of have to stack 'em. Perhaps there is a better way, but none that I am aware of :confused:
I can’t really put them in a for loop, because they have to be unique compared to the other pages.

EDIT

I explained how the derma works rather poorly, sorry. It’s better if I just upload the code. The CreatePage function is the function I’m using in the other file excessively.
But I don’t know how to upload a snippet of it, I’ve seen it on other threads but I can’t see any “snip” option as I’m writing this.

Think of it as the DarkRP-Modification addon, when you add jobs perhaps.

Have you tried using DPropertySheet? It’s made for tabs and stuff like that

I don’t really want to use it, I don’t think it looks too appealing. I’d rather create my own “next” and “previous” button to move back and forward between the pages. Thanks anyway, I will definitely use this some other time though, cause it looks fun.

You can wrap your code in


 tags to make it look nice.

Ah, nevermind guys, sorry, I was being an idiot. I didn’t try to include the main file in the pages.lua file exclusively, what I did before was I made the files include each other, I didn’t try where I only included the main file in the other file.

Thanks you everyone who tried to help me though :slight_smile: