AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Map Menu [ TUT ] (https://forums.alliedmods.net/showthread.php?t=307538)

soumyadip77 05-14-2018 11:10

[HELP] Map Menu [ TUT ]
 
Guys how to make a map menu plaugin when i will type in console /maps it will read maps from mapwar.ini and show them in menu and chose map will be chnage to that map........ any onw tell me how to start and how to make .....

CrazY. 05-14-2018 11:28

Re: [HELP] Map Menu [ TUT ]
 
How to make menu
https://forums.alliedmods.net/showthread.php?t=46364

How to read from file
https://forums.alliedmods.net/showthread.php?t=133254

Tries
https://forums.alliedmods.net/showthread.php?t=201872

amx_map <mapname>

soumyadip77 05-14-2018 11:36

Re: [HELP] Map Menu [ TUT ]
 
after read data how to display in menu :/

CrazY. 05-14-2018 12:03

Re: [HELP] Map Menu [ TUT ]
 
Split string, store each map name in array. In menu, run a loop, get from array as an string, and show.

soumyadip77 05-14-2018 22:14

Re: [HELP] Map Menu [ TUT ]
 
is this code will read this file ?? and how to display this in a menu :/ i want to use arry bt cant under stand how....

PHP Code:

/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
#include <amxmisc>
// #include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "New Plug-In"
#define VERSION "1.0"
#define AUTHOR  "Author"

new filename164 ];
new 
buffer164 ];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
get_configsdir(filename164);
    
format(filename164"%s/matchmap.ini"filename);
}

public 
plugin_cfg()
{
    if( 
file_existsfilename ) )
    {
        new 
open fopenfilename"rt");

        while( !
feofopen ) )
        {
            
fgetsopenbuffercharsmax(buffer));
            
trim(buffer);
        }
    }



DarthMan 05-15-2018 04:18

Re: [HELP] Map Menu [ TUT ]
 
Quote:

Originally Posted by CrazY. (Post 2592161)
Split string, store each map name in array. In menu, run a loop, get from array as an string, and show.

I guess trie is better to use in this case. Especially if u have duplicates of the same map in the text file, each valid map will only be added to the trie once. With an array you'd have to loop and check if the map was already added in the array. So TrieSetCell with a value of 1 applied to the mapname is the better way to go by first checking if TrieKeyExists.

CrazY. 05-15-2018 07:19

Re: [HELP] Map Menu [ TUT ]
 
Hmm... yes, I agree with you.

@OP, I think you need to learn more about amxx.
https://forums.alliedmods.net/showthread.php?t=172936

soumyadip77 05-15-2018 07:59

Re: [HELP] Map Menu [ TUT ]
 
I dnt know about ini and all file read functions well :(

CrazY. 05-15-2018 10:20

Re: [HELP] Map Menu [ TUT ]
 
Take a look at amx_settings_api.


All times are GMT -4. The time now is 00:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.