SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/01/2015, 10:54 PM   #1
ahmedkoki
Big Clucker
 
Join Date: Aug 2012
Posts: 96
Reputation: 5
Default Show files inside script files folder in game

Hello, I want a plugin or something to show or list the .ini files inside scriptfiles when I type a command
__________________
ahmedkoki is offline   Reply With Quote
Old 14/01/2015, 10:56 PM   #2
PowerPC603
High-roller
 
Join Date: Nov 2010
Location: Belgium
Posts: 1,733
Reputation: 238
Default Re: Show files inside script files folder in game

http://forum.sa-mp.com/showthread.php?t=92246
__________________
Gamemode: PPC_Trucking
Extras-file (for PPC_Trucking): /delproperty, /evict, /propertyid, /porthouse, /portbus, /properties
------------------------------------------------------------------------------------
PPC-Trucking-V2 (home-hosted, only open on occasion for testing purposes): ppctruckingv2.no-ip.info:7777
Youtube channel: https://www.youtube.com/channel/UC-4...Mpglma8f0Ld-YQ
------------------------------------------------------------------------------------
Filterscripts: PPC_Speedometer - PPC_Housing - PPC_Business
PowerPC603 is offline   Reply With Quote
Old 14/01/2015, 11:16 PM   #3
ahmedkoki
Big Clucker
 
Join Date: Aug 2012
Posts: 96
Reputation: 5
Default Re: Show files inside script files folder in game

That worked thanks but I need to use it without .ini so it doesn't show .ini just the file name
__________________
ahmedkoki is offline   Reply With Quote
Old 14/01/2015, 11:22 PM   #4
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,133
Reputation: 445
Default Re: Show files inside script files folder in game

You can remove the "ini" from the string using strdel, or by using common functions(user-made) such as strreplace.

http://forum.sa-mp.com/showthread.php?t=85697 may help you.
Abagail is offline   Reply With Quote
Old 14/01/2015, 11:57 PM   #5
ahmedkoki
Big Clucker
 
Join Date: Aug 2012
Posts: 96
Reputation: 5
Default Re: Show files inside script files folder in game

Ok but the file manager returns only one file but I want it to return all existing files
__________________
ahmedkoki is offline   Reply With Quote
Old 15/01/2015, 12:22 AM   #6
ahmedkoki
Big Clucker
 
Join Date: Aug 2012
Posts: 96
Reputation: 5
Default Re: Show files inside script files folder in game

How to loop this so it lists all files inside the folder?

pawn Code:
CMD:listfactions(playerid, params[])
{
    new dir:dHandle = dir_open("./scriptfiles/Groups/");
    new item[40], type, string[128];
       
    while(dir_list(dHandle, item, type))
    {
        strdel(item, strfind(item, ".ini"), strlen(item));
        format(string, sizeof(string), "Files: %s.", item);
        if(type == 2) return SendClientMessage(playerid, -1, string);
    }  
    dir_close(dHandle);
    return 1;
}
__________________
ahmedkoki is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop through files in a folder RelaxCafe Scripting Help 4 19/12/2011 11:06 PM
Creating files from script in npcmodes folder Jochemd Help Archive 2 23/08/2011 04:45 PM
PHP - Files from folder on a webpage Jantjuh Everything and Nothing 10 21/02/2011 06:03 PM
Creating files into a folder: how? Jochemd Help Archive 9 28/05/2010 07:50 PM
List files from a folder gtachile Help Archive 0 14/04/2009 07:59 PM


All times are GMT. The time now is 03:41 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.