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

Current map name edit in "find servers"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joaokb
Junior Member
Join Date: Apr 2021
Location: brazil
Old 04-19-2021 , 16:14   Current map name edit in "find servers"
Reply With Quote #1

could someone make a plugin that i can edit the map name in find servers?

example: im playing mirage in my server but in find servers shows de_dust2

like this one, but changing de map name in the list: https://forums.alliedmods.net/showthread.php?t=21484

thx

Last edited by joaokb; 04-19-2021 at 16:34.
joaokb is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-19-2021 , 17:15   Re: Current map name edit in "find servers"
Reply With Quote #2

try this:

PHP Code:
//#define REHLDS_SERVER
new const CONFIG_FILE[] = "fake_maps"

#include <amxmodx>

#if !defined REHLDS_SERVER
    #include <fakemeta>

    #define ALLOC_STRING(%0)         engfunc(EngFunc_AllocString, %0)

    
new Trie:g_tMapNamesg_iGlobalVar_MapName
#else
    #include <reapi>
#endif

public plugin_init()
{
    
register_plugin("Fake Map""0.3""Vaqtincha")
    
register_concmd("set_fakemap""ConCmd_ChangeMapName"ADMIN_CFG"set_fakemap < fake name > or < default >")

    new 
szMapName[32]
    
get_mapname(szMapNamecharsmax(szMapName))

#if !defined REHLDS_SERVER
    
g_tMapNames TrieCreate()

    
TrieSetCell(g_tMapNames"default"ALLOC_STRING(szMapName))

    new 
iGlobalVar is_linux_server() ? -0xC0 0x11320
    g_iGlobalVar_MapName 
engfunc(EngFunc_GetInfoKeyBuffer, -1) + iGlobalVar 0xC
#endif

    
LoadFakeList(szMapName)
}

public 
ConCmd_ChangeMapName(const pPlayer, const level)
{
    if(!(
get_user_flags(pPlayer) & level))
        return 
PLUGIN_HANDLED

    
if(read_argc() != 2)
    {
        
server_print("set_fakemap < fake name > or < default >")
        return 
PLUGIN_HANDLED
    
}

    new 
szMapName[32]
    
read_argv(1szMapNamecharsmax(szMapName))

    
SetMapName(szMapName)

    return 
PLUGIN_HANDLED
}

SetMapName(const szMapName[])
{
#if !defined REHLDS_SERVER
    
new iszNewName
    
// strtolower(szMapName)

    
if(!TrieGetCell(g_tMapNamesszMapNameiszNewName))
    {
        
iszNewName ALLOC_STRING(szMapName)
        
TrieSetCell(g_tMapNamesszMapNameiszNewName)
    }

    
UTIL__PatchMapName(iszNewName)

#else
    
if(equali(szMapName"default")) {
        
rh_reset_mapname()
    }
    else {
        
rh_set_mapname(szMapName)
    }
#endif
}

LoadFakeList(const szCurrentMapName[])
{
    new 
szConfigFile[256], pFile
    
new iLen get_localinfo("amxx_configsdir"szConfigFilecharsmax(szConfigFile))
    
formatex(szConfigFile[iLen], charsmax(szConfigFile) - iLen"%s/%s.ini"szConfigFile[iLen], CONFIG_FILE)

    if(!(
pFile fopen(szConfigFile"rt")))
        return

    new 
szBuffer[128], szFakeMapName[128]

    while(!
feof(pFile))
    {
        
fgets(pFileszBuffercharsmax(szBuffer))
        
trim(szBuffer)
    
        if(!
szBuffer[0] || szBuffer[0] == ';' || szBuffer[0] == '#')
            continue
    
        if(
szBuffer[0] == '[')
        {
            
copyc(szFakeMapNamecharsmax(szFakeMapName), szBuffer[1], ']')       
            continue
        }
    
        if(!
szFakeMapName[0])
        {
            
server_print("[FAKE MAP] Error: Invalid config file!")
            break
        }

        if(
equali(szCurrentMapNameszBuffer))
        {
            
server_print("[FAKE MAP] Info: Current map %s set to %s"szCurrentMapNameszFakeMapName)
            
SetMapName(szFakeMapName)
            break
        }
    }
}

// thanks to PRoSToTeM@, good idea.
// -- implemented hack: PRoSToTeM@
// -- by s1lent
stock UTIL__PatchMapName(const iszNewName)
{
    if(
iszNewName) {
        
set_tr2(g_iGlobalVar_MapNameTR_AllSolidiszNewName)
    }

PHP Code:
//#define REHLDS_SERVER 
- uncomment, if you have a ReHLDS server

cvar
PHP Code:
set_fakemap de_dust2 
you can also set different names for diff maps

PHP Code:
FakeMaps configuration file
;[name you want it to be]
name of the maps you want to change

[de_dust2]
de_dust2x2_sneg
de_dust2_snow


[de_inferno]
de_inferno_pro
de_inferno_xmas 
Attached Files
File Type: ini fake_maps.ini (182 Bytes, 82 views)
tarsisd2 is offline
joaokb
Junior Member
Join Date: Apr 2021
Location: brazil
Old 04-19-2021 , 19:08   Re: Current map name edit in "find servers"
Reply With Quote #3

Quote:
Originally Posted by tarsisd2 View Post
try this:

PHP Code:
//#define REHLDS_SERVER
new const CONFIG_FILE[] = "fake_maps"

#include <amxmodx>

#if !defined REHLDS_SERVER
    #include <fakemeta>

    #define ALLOC_STRING(%0)         engfunc(EngFunc_AllocString, %0)

    
new Trie:g_tMapNamesg_iGlobalVar_MapName
#else
    #include <reapi>
#endif

public plugin_init()
{
    
register_plugin("Fake Map""0.3""Vaqtincha")
    
register_concmd("set_fakemap""ConCmd_ChangeMapName"ADMIN_CFG"set_fakemap < fake name > or < default >")

    new 
szMapName[32]
    
get_mapname(szMapNamecharsmax(szMapName))

#if !defined REHLDS_SERVER
    
g_tMapNames TrieCreate()

    
TrieSetCell(g_tMapNames"default"ALLOC_STRING(szMapName))

    new 
iGlobalVar is_linux_server() ? -0xC0 0x11320
    g_iGlobalVar_MapName 
engfunc(EngFunc_GetInfoKeyBuffer, -1) + iGlobalVar 0xC
#endif

    
LoadFakeList(szMapName)
}

public 
ConCmd_ChangeMapName(const pPlayer, const level)
{
    if(!(
get_user_flags(pPlayer) & level))
        return 
PLUGIN_HANDLED

    
if(read_argc() != 2)
    {
        
server_print("set_fakemap < fake name > or < default >")
        return 
PLUGIN_HANDLED
    
}

    new 
szMapName[32]
    
read_argv(1szMapNamecharsmax(szMapName))

    
SetMapName(szMapName)

    return 
PLUGIN_HANDLED
}

SetMapName(const szMapName[])
{
#if !defined REHLDS_SERVER
    
new iszNewName
    
// strtolower(szMapName)

    
if(!TrieGetCell(g_tMapNamesszMapNameiszNewName))
    {
        
iszNewName ALLOC_STRING(szMapName)
        
TrieSetCell(g_tMapNamesszMapNameiszNewName)
    }

    
UTIL__PatchMapName(iszNewName)

#else
    
if(equali(szMapName"default")) {
        
rh_reset_mapname()
    }
    else {
        
rh_set_mapname(szMapName)
    }
#endif
}

LoadFakeList(const szCurrentMapName[])
{
    new 
szConfigFile[256], pFile
    
new iLen get_localinfo("amxx_configsdir"szConfigFilecharsmax(szConfigFile))
    
formatex(szConfigFile[iLen], charsmax(szConfigFile) - iLen"%s/%s.ini"szConfigFile[iLen], CONFIG_FILE)

    if(!(
pFile fopen(szConfigFile"rt")))
        return

    new 
szBuffer[128], szFakeMapName[128]

    while(!
feof(pFile))
    {
        
fgets(pFileszBuffercharsmax(szBuffer))
        
trim(szBuffer)
    
        if(!
szBuffer[0] || szBuffer[0] == ';' || szBuffer[0] == '#')
            continue
    
        if(
szBuffer[0] == '[')
        {
            
copyc(szFakeMapNamecharsmax(szFakeMapName), szBuffer[1], ']')       
            continue
        }
    
        if(!
szFakeMapName[0])
        {
            
server_print("[FAKE MAP] Error: Invalid config file!")
            break
        }

        if(
equali(szCurrentMapNameszBuffer))
        {
            
server_print("[FAKE MAP] Info: Current map %s set to %s"szCurrentMapNameszFakeMapName)
            
SetMapName(szFakeMapName)
            break
        }
    }
}

// thanks to PRoSToTeM@, good idea.
// -- implemented hack: PRoSToTeM@
// -- by s1lent
stock UTIL__PatchMapName(const iszNewName)
{
    if(
iszNewName) {
        
set_tr2(g_iGlobalVar_MapNameTR_AllSolidiszNewName)
    }

PHP Code:
//#define REHLDS_SERVER 
- uncomment, if you have a ReHLDS server

cvar
PHP Code:
set_fakemap de_dust2 
you can also set different names for diff maps

PHP Code:
FakeMaps configuration file
;[name you want it to be]
name of the maps you want to change

[de_dust2]
de_dust2x2_sneg
de_dust2_snow


[de_inferno]
de_inferno_pro
de_inferno_xmas 

How can i talk to you in private bro?!
joaokb is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-19-2021 , 20:31   Re: Current map name edit in "find servers"
Reply With Quote #4

you can send pm, you can also post here

Last edited by tarsisd2; 04-19-2021 at 20:32.
tarsisd2 is offline
MAJESTIC_SZ
Senior Member
Join Date: Mar 2020
Location: Portugal
Old 04-19-2021 , 20:49   Re: Current map name edit in "find servers"
Reply With Quote #5

Hi.
This is what you need, 100% sure:

https://www.amxx-bg.info/forum/viewt...hp?f=18&t=1780
MAJESTIC_SZ is offline
joaokb
Junior Member
Join Date: Apr 2021
Location: brazil
Old 04-20-2021 , 06:57   Re: Current map name edit in "find servers"
Reply With Quote #6

Quote:
Originally Posted by MAJESTIC_SZ View Post
Hi.
This is what you need, 100% sure:

https://www.amxx-bg.info/forum/viewt...hp?f=18&t=1780
thx so much bro, there are some angels in this forum
joaokb is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 04-20-2021 , 09:45   Re: Current map name edit in "find servers"
Reply With Quote #7

This shouldn't even be allowed here. Goes against Valve's Policy of Truth.
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
joaokb
Junior Member
Join Date: Apr 2021
Location: brazil
Old 04-20-2021 , 13:16   Re: Current map name edit in "find servers"
Reply With Quote #8

Quote:
Originally Posted by DruGzOG View Post
This shouldn't even be allowed here. Goes against Valve's Policy of Truth.
why?
__________________
⠀⠀⠀⠀⠀⠀
⠀⠀kabest
joaokb is offline
DruGzOG
Veteran Member
Join Date: Nov 2007
Location: Unknown
Old 04-20-2021 , 17:02   Re: Current map name edit in "find servers"
Reply With Quote #9

https://support.steampowered.com/kb_...FGJ-3513#truth
__________________
DruGzOG is offline
Send a message via AIM to DruGzOG
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-21-2021 , 00:10   Re: Current map name edit in "find servers"
Reply With Quote #10

Quote:
Originally Posted by DruGzOG View Post
pretty sure that page is meant for Team Fortress 2
tarsisd2 is offline
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

Forum Jump


All times are GMT -4. The time now is 03:49.


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