Raised This Month: $51 Target: $400
 12% 

[req] map search


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
letgoofmyeggs
Senior Member
Join Date: Aug 2006
Old 02-08-2009 , 15:44   [req] map search
Reply With Quote #1

ive searched but couldnt find a plugin like this. ive been to a server where you type in chat "find (part of map name)" and all the matching results are displayed in a hud message on theright of the screen
letgoofmyeggs is offline
letgoofmyeggs
Senior Member
Join Date: Aug 2006
Old 02-23-2009 , 23:56   Re: [req] map search
Reply With Quote #2

bump
letgoofmyeggs is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-24-2009 , 04:13   Re: [req] map search
Reply With Quote #3

Hmmm... i know only this http://forums.alliedmods.net/showthread.php?p=657545

its a realy cool plugin. but not that what u wannted. users can say :

vote de_

& become all de_ maps to vote or vote de_dust2 & the map de_dust2 will be voted by player. i hope could help.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
letgoofmyeggs
Senior Member
Join Date: Aug 2006
Old 03-03-2009 , 23:01   Re: [req] map search
Reply With Quote #4

thanks but i jus want a simple plugin that allows me to search through my maps thru the chat ina hud message. that plugin looks very complex and i will only be using a little portion of it
letgoofmyeggs is offline
letgoofmyeggs
Senior Member
Join Date: Aug 2006
Old 03-18-2009 , 21:32   Re: [req] map search
Reply With Quote #5

BUMPPPPPP
letgoofmyeggs is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 03-25-2009 , 10:12   Re: [req] map search
Reply With Quote #6

Try this.


Command: amx_findmap <partial mapname> - Displays maps names from the maps folder that match the partial mapname entered.

CVar: mf_display - If set to 0, a HUD will be displayed at the right of the screen. 1 = Prints at console.

PHP Code:
#include <amxmodx>
#include <amxmisc>

new g_SyncedHudObj;
new 
p_display;

public 
plugin_init()
{
    
register_plugin("Map Finder""1.0""Dores");
    
    
register_clcmd("amx_findmap""Cmd_FindMap"ADMIN_KICK"amx_findmap <partial mapname> - Finds matching maps from the maps folder");
    
    
p_display register_cvar("mf_display""0"); // 0 = HUD, 1 = Console.
    
    
g_SyncedHudObj CreateHudSyncObj();
}

public 
Cmd_FindMap(idlvlcid)
{
    if(!
cmd_access(idlvlcid2))
        return;
    
    new 
map[32];
    
read_argv(1map31);
    
    if(!
DisplayMatchingMaps(idmap))
    {
        
console_print(id"Could not find wanted map(s). Make sure you don't have any typos.");
    }
}

bool:DisplayMatchingMaps(const id, const map[])
{
    new 
dirh open_dir("maps"""0);
    new 
map_file[36], mapCountbool:found;
    
    while(
next_file(dirhmap_file35))
    {
        if(
containi(map_file".bsp") == -1)
            continue;
        
        
replace(map_file35".bsp""");
        
        if(
is_map_valid(map_file) && containi(map_filemap) != -1)
        {
            if(!
get_pcvar_num(p_display))
            {
                
set_hudmessage(002550.580.006.012.0);
                
ShowSyncHudMsg(idg_SyncedHudObj"%d) %s", ++mapCountmap_file);
            }
            
            else
            {
                
console_print(id"%d) %s", ++mapCountmap_file);
            }
            
            
found true;
        }
    }
    
    
close_dir(dirh);
    
    return 
found;

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 03-25-2009 at 10:17.
Dores is offline
letgoofmyeggs
Senior Member
Join Date: Aug 2006
Old 03-25-2009 , 13:59   Re: [req] map search
Reply With Quote #7

thanks how do i change the console comand into a chat command?
letgoofmyeggs is offline
Old 03-25-2009, 14:45
Dores
This message has been deleted by Dores. Reason: 1 sec...
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 03-25-2009 , 14:54   Re: [req] map search
Reply With Quote #8

There, just type findmap <mapname> in chat and results will appear in console(can't think of a way to display all of the maps using HUD).

PHP Code:
#include <amxmodx>
#include <amxmisc>

public plugin_init()
{
    
register_plugin("Map Finder""1.0""Dores");
    
    
register_clcmd("say""Cmd_HookSay");
}

public 
Cmd_HookSay(id)
{
    if(!
access(idADMIN_KICK))
        return;
    
    new 
command[41], map[32];
    
read_args(command40);
    
remove_quotes(command);
    
    if(
containi(command"findmap ") == -1)
    {
        return;
    }
    
    
parse(commandcommand40map31);
    
    if(!
DisplayMatchingMaps(idmap))
    {
        
console_print(id"Could not find wanted map(s). Make sure you don't have any typos.");
    }
}

bool:DisplayMatchingMaps(const id, const map[])
{
    new 
dirh open_dir("maps"""0);
    new 
map_file[36], mapCountbool:found;
    
    while(
next_file(dirhmap_file35))
    {
        if(
containi(map_file".bsp") == -1)
            continue;
        
        
replace(map_file35".bsp""");
        
        if(
is_map_valid(map_file) && containi(map_filemap) != -1)
        {
            
console_print(id"%d) %s", ++mapCountmap_file);
            
            
found true;
        }
    }
    
    
close_dir(dirh);
    
    return 
found;

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
letgoofmyeggs
Senior Member
Join Date: Aug 2006
Old 04-11-2009 , 21:24   Re: [req] map search
Reply With Quote #9

on the server it dint say al the maps, it jus showed the ones it could fit on the screen. do yu no how to do that?
letgoofmyeggs is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-11-2009 , 21:45   Re: [req] map search
Reply With Quote #10

For the second code it's in your console so you should be able to just scroll up .

For the first, there is a limit on hud messages.
__________________

Last edited by fysiks; 04-11-2009 at 21:47.
fysiks is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 18:45.


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