View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-13-2015 , 09:36   Re: DMC (Map chooser)
Reply With Quote #11

As I already told you 3 times, stop hardcoding paths. Maybe you will understand better from here: https://forums.alliedmods.net/showthread.php?t=40946
PHP Code:
#define MapFile "addons/amxmodx/configs/dmc/mapdatas.dmc"
#define PrevMapFile "addons/amxmodx/configs/dmc/prevmap.dmc" 
Pawn compiler sucks at optimization. If you use the same string multiple times it will appear more than one time in the string table.
PHP Code:
#define Prefix "!g[DMC]" 
This should be made a constant, not a define. Defines are removed during compilation process and are replaced by their value.
Formatex is faster than format, it's not hard to keep in mind that.

PHP Code:
new Error[64];
        
formatex(Errorcharsmax(Error), "%s file error! [%d maps] (min %d)"MapCycle_Linesget_pcvar_num(Cvar_MaxMaps));
        
set_fail_state(Error); 
In amxmodx 1.8.3 set_fail_state can format a string, maybe you would consider checking amxx version and using the appropiate way.
Charsmax should be used on strings, not sizeof - 1 for readability purpose. Also, sizeof is not a function as most of peoples think. It is sizeof string and not sizeof(string). Well, it won't affect anything, but just for the sake of doing things correctly.

Just something that I saw in the first 200 lines of your code.
__________________

Last edited by HamletEagle; 04-13-2015 at 09:37.
HamletEagle is offline