This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

DeRoiD's Mapchooser v2.33


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 07:28.


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