Raised This Month: $ Target: $400
 0% 

Change Mapname


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 06-17-2018 , 14:12   Change Mapname
Reply With Quote #1

I made a mapname changer but I have a problem about file (.ini)
Plugin doesn't get any mapname and change mapname.

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

public plugin_init() {
    
register_plugin("MapName""1.1""PurposeLess")

    
load_file()
}

public 
load_file()
{
    new 
filename[64];
    
get_localinfo("amxx_configsdir"filenamecharsmax(filename));
    
format(filenamecharsmax(filename), "%s/map_ismi.ini"filename);

    new 
file fopen(filename"rt");

    new 
data[182], left[64], right[64], mapname[32];
    if(
file)
    {
        while(!
feof(file))
        {
            
fgets(filedatacharsmax(data));
            
trim(data);

            if(
data[0] == ';')
            {
                continue;
            }

            
argbreak(dataleftcharsmax(left), rightcharsmax(right));
            
get_mapname(mapnamecharsmax(mapname));

            if(
equal(dataleft))
            {
                
remove_quotes(right);
                
rh_set_mapname(right);
            }
        }
    }

PurposeLessx is offline
 



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 12:44.


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