![]() |
Loading the class folder
I've been trying all sorts of ways trying to load and list the classes folder, but I just can't get it. It won't even load the contents of the folder.
I've made a constant variabe CLASS_FOLDER, with the class folder specified as classes/*.txt, but it won't load them. I know there is nothing wrong with the rest of my script, as everything else is functioning apart from this line. PHP Code:
|
Does the NPC-Server have read rights to that folder?
|
It's scripts/* not classes.
DB-NPCS: npcs/* Weapons: weapons/* Folder Rights Example (NPC-Server will need at least r rights): rw weapons/*.txt rw scripts/*.txt rw npcs/*.txt -rw npcs/npclocalnpc*.txt (Hides putnpc2 npcs) These are strictly NC Folders: CLASSES/* WEAPONS/* NPCS/* |
Thanks fowlplay. :oo:
|
Now that I've asked that question, I may as well ask this one..
How would you go about loading the contents of one of those script files? |
Quote:
As Array of Lines: PHP Code:
PHP Code:
|
Everytime I use loadlines() or loadstring(), it just returns 0.
I'm triggering the server from the clientside, with the name of the script file being carried over from the serverside as the second parameter. The first parameter defines if it's a weapon or a script. PHP Code:
|
What filename are you using? Keep in mind you need to escape it if it has special characters, and weapons are named weaponWeaponName.txt.
|
Ah. I forgot the weapon prefix for weapon scripts. I was using a substring. Thanks cbk.
|
Okay, now I really am at my wit's end with this...
Okay, I have a GuiTextList with all the weapon names listed without the weapon prefix, without the .txt and the special characters escaped. So, I press a GuiButton to send the selected text to the serverside using triggerserver(), which is fine. Say, for example, I selected "Personal/iBeatz/Test" in the GuiTextList: PHP Code:
PHP Code:
I have also tried this with a script file as well, and still nothing works. This is so annoying... !pissed! |
It's because the forward slashes (and other special/unsafe characters) get encoded.
Personal/iBeatz/Test is actually stored as weaponPersonal%047iBeatz%047Test.txt in the weapons folder. Testbed might not have the folder rights necessary to read the raw script files either. |
Wow. Why does everything have to be so complicated...?
Thanks once again. |
All times are GMT +2. The time now is 09:05 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.