General > Developers Corner

Help with permamute?

<< < (3/4) > >>

roastchicken:
Could you post the contents of cc_pgag.lua?

iViscosity:
I asked the operator to send it to me, but he's not available right now, I have the same code except it's in a bit of a different order. Would that still help?

roastchicken:
Wait, what? Who's "the operator"?

The code in a different order would likely not be useful because the line numbers would be different, making it hard to find which line is causing the error.

iViscosity:
The operator is the guy who runs the console of the server I'm staff on. His name is Jamie, I'll just refer to him by that from now on. Basically, he's the one that can add/remove things to and from the server, and basically he said that whenever he tries to do the "say" command in the console, he's flooded with those errors. He won't be back on until tomorrow, so I can ask him then to send me the exact code he has and I'll put it here. (I only gave him the code from the pmute, he must've added it to the pgag file, which is why they're different).

LuaTenshi:
What's happening is that console is always an invalid entity and GetPData can not be passed to it. Basically all you need to do is check if the "talker" is valid.

if IsValid(talker) and talker:GetPData( "permmuted" ) == "true" then ... end

Also not sure if you should add talker.GetPData to be extra safe but just so you can see both variations...

if IsValid(talker) and talker.GetPData and talker:GetPData( "permmuted" ) == "true" then ... end

Line 35 in your paste, line 147 in the console error.


Also to help you understand lua errors better, errors will usually look like this...

[ERROR] path/to/file.lua:line: Description
Everything underneath this line are other errors that happened because of the main error above.

This is the path to the file, aka. where the file is.
The files name, what it's called.
On what line of the file the error happened, this will help you find exactly what part of your code the error happens on. (You will see line numbers in editors like Notepad++, Sublime Text, etc.)
The description tells you what went wrong, "a nil value" means that a value was not found or returned nothing when your code was expecting something.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version