![]() |
list of files of what's in a folder?
Is there a command that will return an array of the files that are in a folder on the server?
For example, something like: getfilelist("levels/images/*.*"); and that returns an array filelist={"image1.png","image2.gif","image2.mng"} if there is a command that does something like this, what is it? Not sure how to phrase the idea of this to put the description into a wiki search engine, so I hope someone here knows it. |
Quote:
|
loadfolder(str, int)
loads the content of a folder into the variable, you must specify the folder name and pattern (e.g. "levels/bodies/*.png") and if it should be recursive http://wiki.graal.net/index.php/Crea...ient/TGraalVar |
thanks, but then why dosent this work?
and what are the int numbers that this function accepts and which ints alter what paramater of the function? //#CLIENTSIDE function onweaponfired() { player.chat=loadfolder("levels/images/*.png",1); } the player chat is 0 regardless of the int is 0 or 1 tried setting it as a string also but that didnt work either ... so how do i access the array of file names that this command creates? that bit of info is not on the wiki... |
Loadfolder annoys me.
Anyway, it is varname.loadfolder("levels/images/*.png", 1); Then you can do player.chat = varname; I also remember having some trouble with loadfolder with the int part. I did something like levels.loadfolder("levels/", *) and that worked. Been a while since I used it. >.> |
Quote:
|
it returns an array of strings. That was the final command I needed to make this useful little image previewer. But it seems to show images from the local folder and not from the server?
Also the image Bitmap control does not even show the initial bomb.png image... This is a free for all script that I think every graphics artist or lat looking for an image would appreciate once it works. Feel free to tweak it to have it work and look right. PHP Code:
|
It's a clientside script, what do you expect?
|
problem: variables set serverside cannot be read clientside even if its within the same block of npc code. Nor can triggeractions be sent server side.
solution: set a serverr.string to the value you want to read clientside and when the client reads the data, clear out the serverr.string. is there a more efficient way to do that? and more importantly, why dosent the image show up in the GuiBitmapCtrl? |
Quote:
|
Quote:
But yea, loadfolder is a serverside function. |
| All times are GMT +2. The time now is 04:30 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.