![]() |
hasscriptaccess()
hasscriptaccess(filepath, readonly) - returns true if the file at the given filepath can be accessed with the various load/save functions such as loadlines(). readonly is a bool that is true if you only want to check if the file can be read regardless of if you can write to it. Example: PHP Code:
PHP Code:
Of course on the clientside the second parameter would only check if the file was read-only or not. The function should also be supported serverside which would basically return the (npcserver)'s hasfolderright() to the file with respect to r and rw depending on the second parameter. What do you think, could you implement this function Stefan? Really would like it for my global client/server file browser I'm making (which is required for my scripted level editor) as well as a few other things. |
This would be nice, though I can't think of many uses besides a file browser type thing.
|
I can't imagine it taking very much time to implement into the new client :).
|
Will this be added?
|
Ok added something, although it's not exactly identical:
getScriptAccessFile(filename, dowrite) returns the file that will be modified when using the specified filename: when the file extension is not allowed then it will return an empty string, otherwise either the filename (if it was including a path name and it's allowed to access) or a filename starting with scriptfiles or scriptfiles/servername. This will work with the next update of the npcserver and the next client version. |
Perfect, just what I needed! Thank you! ^^
|
Umm, is the npcserver gonna be updated anywhere? Almost everywhere I've tried the function doesn't exist.
|
| All times are GMT +2. The time now is 09:54 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.