Adding Modules to help with scripting/coding plugins.
Archive-Poster
Posts: 1090
Gender:
Archive-Poster
Profile
Joined: Tue Aug 04, 2026 2:18 am
Gender:
Post
by Archive-Poster » Tue Oct 20, 2026 7:01 am
MapName Patcher
1.0
Informations
♠ You may change the map name through Patch_MapName native
♠ Maximum length is 128 characters [not sure about the maximum length of the string]
Installation
♠ Upload mapname_patcher_amxx.dll and mapname_patcher_amxx_i386.so in addons/amxmodx/modules
♠ Attach your plugin to AMX Mod X adding line YourPluginName.amxx in addons/amxmodx/configs/plugins.ini
AMX Mod X connection
♠ Example of plugin:
Code: Select all
/* AMX Mod X */
#include < amxmodx >
#include < mapname_patcher >
public plugin_cfg( )
Patch_MapName( "de_dust2 (Bomb)" );
Attachments
Mapname Patcher Source Code.zip
(270.08 KiB) Downloaded 5 times
mapname_patcher_amxx.dll.zip
(39.94 KiB) Downloaded 3 times
mapname_patcher_amxx_i386.so.zip
(8.91 KiB) Downloaded 2 times
mapname_patcher.inc.zip
(464 Bytes) Downloaded 1 time
Archive-Poster
Posts: 1090
Gender:
Archive-Poster
Profile
Joined: Tue Aug 04, 2026 2:18 am
Gender:
Post
by Archive-Poster » Tue Oct 20, 2026 7:02 am
Either you download Notepad Plus Plus software and create a new file with UTF-8 without BOM [ANSI as UTF-8] encoding or download the attached file then edit it.
Example:
Code: Select all
#include < amxmodx >
#include < mapname_patcher >
public plugin_cfg( ) {
new File = fopen( "addons/amxmodx/configs/MapName.ini", "r" );
if( File != 0 ) {
static Buffer[ 256 ];
fgets( File, Buffer, charsmax( Buffer ) );
fclose( File );
trim( Buffer );
Patch_MapName( Buffer );
}
}
Attachments
MapName.ini.zip
(203 Bytes) Downloaded 2 times
Archive-Poster
Posts: 1090
Gender:
Archive-Poster
Profile
Joined: Tue Aug 04, 2026 2:18 am
Gender:
Post
by Archive-Poster » Tue Oct 20, 2026 7:03 am
Cool stuff
I remove the prefix from the map name (de_, cs_, as_, awp_, etc).
Code: Select all
new szMapName[ 32 ]
get_mapname( szMapName, charsmax( szMapName ) )
if( containi( szMapName, "_" ) != -1 )
{
new szMapPrefix[ 10 ]
new szMapSufix[ 32 ]
strtok( szMapName, szMapPrefix, charsmax( szMapPrefix ), szMapSufix, charsmax( szMapSufix ), '_' )
Patch_MapName( szMapSufix )
}
Archive-Poster
Posts: 1090
Gender:
Archive-Poster
Profile
Joined: Tue Aug 04, 2026 2:18 am
Gender:
Post
by Archive-Poster » Tue Oct 20, 2026 7:04 am
Can this change each map name? Because I can only change all map names to the same name
Yes after my post i realized how dumb I was
I made this way
Code: Select all
#include < amxmodx >
#include < mapname_patcher >
public plugin_init()
{
new szMapName[ 32 ]
get_mapname( szMapName, charsmax( szMapName ) )
if(equali(szMapName,"de_dust2"))
{
Patch_MapName( "de_dust2 [FZ]" );
}
}
Archive-Poster
Posts: 1090
Gender:
Archive-Poster
Profile
Joined: Tue Aug 04, 2026 2:18 am
Gender:
Post
by Archive-Poster » Tue Oct 20, 2026 7:05 am
small bug
start server
"de_dust" change to "Dust"
restart map - servers crash
because no map "Dust"
Use changelevel %MapName% instead.
Users browsing this forum: No registered users and 1 guest