Raised This Month: $32 Target: $400
 8% 

Weapons War v7.5 (26 Weapons)


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-29-2015 , 08:19   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #211

Quote:
Originally Posted by addons_zz View Post
You first post is very nice now, and you change log is very well done

But I still recommend to follow this guide line and use patch updates "MAJOR.MINOR.PATCH".
There you will find out a well explanation about what it is and why use it.

For example, this one:

Was supposed to be:


But this is fine because is not a patch, is a minor update:
It's up to the coder, stop suggesting such things and posting like this is critical or very important, you are not helping anyone.
__________________

Last edited by HamletEagle; 10-29-2015 at 08:20.
HamletEagle is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 10-29-2015 , 08:36   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #212

Quote:
Originally Posted by HamletEagle View Post
It's up to the coder, stop suggesting such things and posting like this is critical or very important, you are not helping anyone.
Do you read the entire post? If it was critical or very important I would say so.

Them you suggest to people keep their code bad naming their variables and doing so without documentation too?

Because these are the next things I am going to do next, recommend the opposite and explain why.
addons_zz is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-29-2015 , 09:10   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #213

I appreciate your suggestion. ;)

Last edited by zmd94; 12-02-2015 at 23:04.
zmd94 is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 10-29-2015 , 13:39   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #214

I am very happy I could help you. Once I never new about such thing, then I always created some freak way to naming versions. Later when I find this out, I said, DAMN DAMN DAMN ! It was there all along.

Last edited by addons_zz; 10-29-2015 at 13:43. Reason: I appreciate your suggestion
addons_zz is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 10-29-2015 , 18:55   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #215

LOL. \o/
zmd94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-30-2015 , 11:12   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #216

Quote:
Originally Posted by addons_zz View Post
Do you read the entire post? If it was critical or very important I would say so.

Them you suggest to people keep their code bad naming their variables and doing so without documentation too?

Because these are the next things I am going to do next, recommend the opposite and explain why.
I did not read anything from the page, I am talking about your comment.
Coding style, variable naming, versions format, changelog and so on is really up to the coder. Of course it's nice to have a clean code, with proper names, that's why we suggest it when it is the case, but it's not a requierement for approval(as long as the code is not unreadable things are ok).

About documentation, if someone does not want to leave comments explaining his functions it's ok. Approvers should be able to understand based on the code, but having comments helps for sure. Sometimes, when the code is big and you are not the author, understanding from the first glance the whole code logic and flow is not that easy.

If you want to help him then start by checking the actual code, not his changelog structure, lol :O.

Quote:
Because these are the next things I am going to do next, recommend the opposite and explain why.
What ?
__________________

Last edited by HamletEagle; 10-30-2015 at 11:15.
HamletEagle is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 10-30-2015 , 13:55   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #217

Quote:
Originally Posted by HamletEagle View Post
Coding style, variable naming, versions format, changelog and so on is really up to the coder.
Of course, everything is upper to the coders. But people should not go out there releasing open source code, without thinking about others that eventually latter will end up maintaining the code. Because of that, I recommend/suggest to new coders to follow such approach. Is not helpful to someone latter assuming the code has to practically re-code everything because could not understand was was done by the original author.

Quote:
Originally Posted by HamletEagle View Post
About documentation, if someone does not want to leave comments explaining his functions it's ok. Approvers should be able to understand based on the code, but having comments helps for sure. Sometimes, when the code is big and you are not the author, understanding from the first glance the whole code logic and flow is not that easy.
When I said documentation I am not talking about code commentaries, I am talking about this:
PHP Code:
/**
 * Write debug messages to server's console accordantly with cvar gal_debug.
 * If gal_debug 1 or more higher, the voting and runoff times are set to 5 seconds. 
 * 
 * @param mode the debug mode level:
 *           (00000) 0 disable all debug.
 *           (00001) 1 displays basic debug messages. 
 *           (00010) 2 displays players disconnect, how many remaining, and multiple time limits 
 *                                 changes and restores. 
 *           (00100) 4 displays maps events as: choices, votes, nominations and the current map name at plugin_cfg()
 *           (01000) 8 displays vote_loadChoices() and actions at vote_startDirector
 *           (10000) 16 displays messages related to RunOff voting
 *           (11111) 31 displays all debug logs levels at server console. 
 *
 * @param text the debug message, if omitted its default value is ""
 * @param any the variable number of formatting parameters
 */
debugMessageLog(const mode, const text[] = "", {Float,Sql,Result,_}:...)
{    
    
g_isDebugEnabledNumber get_cvar_num("gal_debug");

    if( 
mode g_isDebugEnabledNumber )
    {
        new 
formattedText[1024];
        
format_args(formattedText10231);

        
server_print"%s"formattedText )
        
client_print0print_console"%s"formattedText )
    }
    
// not needed but gets rid of stupid compiler error
    
if (text[0] == 0) return;

There you can observe a code commentary, but it was necessary because that code part could be obscure. Code should not need commentaries, unless such at peculiar cases and others certain situations, when a code has properly variable naming and documentation.

Quote:
Originally Posted by HamletEagle View Post
If you want to help him then start by checking the actual code, not his changelog structure, lol :O.
You are right, but if you read that text, you will understand that a good change log is not just a beautifier. And I didn't know about it, for a long time, then I was just pointing this out to him, because he could be at the same situation as mime. Moreover, I will not start point things at his coding without first to be sure that I am really able to do so. For example, now I am developing Multi-Mod Server, Golden Weapons, the Galileo Reloaded plugin, and the Multi-Mod Manager, where I am applying all my efforts to build the best of best. But until this plugins are finished and approved, and I know that I am really good pawn programmer, I am not going to disturb/bad instruct/teach pawn coding.

However for now, I am developing a tutorial teaching about what I now better, variable naming, documentation and software versioning, using what I am learning while developing. And it will be released after I finished my plugins and get them approved. That is to not release bad guides/material out there.

Quote:
Originally Posted by HamletEagle View Post
Of course it's nice to have a clean code, with proper names, that's why we suggest it when it is the case, but it's not a requierement for approval(as long as the code is not unreadable things are ok).
This is sad, that should a be requirement for approval, because a clean code, with proper names, is a readable code (at least should be, as the tutorial I am developing teaches). So, when I code without it, could be close to be unreadable, i.e:

If this is a small code, not a clean code with proper names, or is a trivial stuff that can be quickly relearned, probability is readable. But even if is readable, it will not be the same pleasure as read a clean, properly named and structured code. However, codes can grow as the times goes on, then if it started wrong, should end wrong, unless it pass throw a refactoring at a despair time. For example, the original Galileo code, was without any doubt, a readable code for its author's Brad, but me, it was like chinese until I started renaming variables, cutting off abbreviations, i.e., refactoring the whole code and including documentation. Now, it is easy to program as it was mime. But that code is far way from done because it is not fully documented and re-factored as my other plugin Multi-Mod Manager that includes 100% documentation and since I know, 0% bad variable naming, but I maybe find some lost one, when I re-inspect it, and when I find some, I rename it immediately.

A full method refactoring example mime (an unfinished and unapproved plugin yet), where I changed this:
PHP Code:
public load_cfg()
{
    new 
szData[LSTRING]
    new 
szFilename[LSTRING]

    
formatex(szFilenamecharsmax(szFilename), "%s/%s"AMX_BASECONFDIR"multimod.ini")

    new 
fopen(szFilename"rt")
    new 
szTemp[SSTRING],szModName[SSTRING], szTag[SSTRING], szCfg[SSTRING]
    while(!
feof(f)) {
        
fgets(fszDatacharsmax(szData))
        
trim(szData)
        if(!
szData[0] || szData[0] == ';' || (szData[0] == '/' && szData[1] == '/')) continue

        if(
szData[0] == '[') {
            
g_modcount++
            
replace_all(szDatacharsmax(szData), "[""")
            
replace_all(szDatacharsmax(szData), "]""")

            
strtok(szDataszModNamecharsmax(szModName), szTempcharsmax(szTemp), ':'0)
            
strtok(szTempszTagcharsmax(szTag), szCfgcharsmax(szCfg), ':'0)

            if(
equal(szModNameg_multimod)) {
                
formatex(g_fileconf192"%s/%s"AMX_BASECONFDIRszCfg)
                
copy(g_currentmodcharsmax(g_currentmod), szModName)
                
g_currentmodid g_modcount
                server_print
("[AMX MultiMod] %L"LANG_PLAYER"MM_WILL_BE"g_multimodszTagszCfg)
            }
            
formatex(g_modnames[g_modcount], 32"%s"szModName)
            
formatex(g_filemaps[g_modcount], 192"%s/%s-maps.ini"AMX_BASECONFDIRszTag)
            
formatex(g_fileplugins[g_modcount], 192"%s/%s-plugins.ini"AMX_BASECONFDIRszTag)
            
server_print("MOD Loaded: %s %s %s"g_modnames[g_modcount], g_filemaps[g_modcount], g_fileconf)
        }
    }
    
fclose(f)
    
set_task(10.0"check_task"TASK_VOTEMOD""0"b")

Into this:
PHP Code:
/**
 * Loads the config file "voting_list.ini" and all mods stored there.
 */
public load_votingList()
{   
    new 
currentLine                                [LONG_STRING]
    new 
currentLine_splited                    [SHORT_STRING]
    new 
modName                                    [SHORT_STRING]
    new 
modShortName_string                [SHORT_STRING]
    new 
unusedLast_string                    [SHORT_STRING]

    new 
votingList_filePointer fopeng_votingList_filePath"rt" )

    while( !
feofvotingList_filePointer ) )
    {   
        
fgetsvotingList_filePointercurrentLinecharsmax(currentLine) )
        
trimcurrentLine )

        
// skip commentaries while reading file
        
if( !currentLine[0] || currentLine[0] == ';' || ( currentLine[0] == '/' && currentLine[1] == '/' ) )
        {   
            continue
        }

        if( 
currentLine[0] == '[' )
        {   
            
g_modCounter++

            
// remove line delimiters [ and ]
            
replace_allcurrentLinecharsmax(currentLine), "[""" )
            
replace_allcurrentLinecharsmax(currentLine), "]""" )

            
// broke the current config line, in modname (modName), modtag (modShortName_string) 
            
strtokcurrentLinemodNamecharsmax(modName), currentLine_splitedcharsmax(currentLine_splited), ':')
            
strtokcurrentLine_splitedmodShortName_stringcharsmax(modShortName_string), unusedLast_string
                    
charsmaxunusedLast_string ), ':')

            
// stores at memory the modname and the modShortName
            
formatexg_modNames[g_modCounter], sizeofg_mod_shortNames[] ) - 1"%s"modName )
            
formatexg_modShortNames[g_modCounter], sizeofg_mod_shortNames[] ) - 1"%s"modShortName_string )

            
debugMessageLog1"[AMX MOD Loaded] %d - %s",  g_modCounter 2g_modNames[g_modCounter] )

            if( 
g_is_debug 
            {   
                new 
mapcycle_filePath                    [SHORT_STRING
                new 
config_filePath                        [SHORT_STRING
                new 
plugin_filePath                        [SHORT_STRING
                new 
message_filePath                    [SHORT_STRING]
                new 
messageResource_filePath            [SHORT_STRING]
                new 
lateConfig_filePath                [SHORT_STRING

                
mapcycle_pathCodermodShortName_stringmapcycle_filePathcharsmaxmapcycle_filePath ) )
                
config_pathCodermodShortName_stringconfig_filePathcharsmaxconfig_filePath ) )
                
plugin_pathCodermodShortName_stringplugin_filePathcharsmaxplugin_filePath ) )
                
message_pathCodermodShortName_stringmessage_filePathcharsmaxmessage_filePath ) )

                
messageResource_pathCodermodShortName_stringmessageResource_filePath
                        
charsmaxmessageResource_filePath ) )

                
lateConfig_pathCodermodShortName_stringlateConfig_filePathcharsmaxlateConfig_filePath ) )

                
server_print"[AMX MOD Loaded] %s"modShortName_string )
                
server_print"[AMX MOD Loaded] %s"mapcycle_filePath )
                
server_print"[AMX MOD Loaded] %s"plugin_filePath )
                
server_print"[AMX MOD Loaded] %s"config_filePath )
                
server_print"[AMX MOD Loaded] %s"message_filePath )
                
server_print"[AMX MOD Loaded] %s"lateConfig_filePath )
                
server_print"[AMX MOD Loaded] %s^n"messageResource_filePath )
            }
        }
    }
    
fclosevotingList_filePointer )


Last edited by addons_zz; 12-13-2015 at 14:35. Reason: Grammar fix.
addons_zz is offline
Klatypaus
Member
Join Date: Jan 2015
Old 11-01-2015 , 10:31   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #218

Quote:
Originally Posted by zmd94 View Post
Klatypaus, after tested the plugin many times, there will be no problem if player use the auto-buy scripts in buy zone. This is because if the weapon that they are currectly holding is not the same with current weapon war, the weapon will become unusable or unfunctional.
Yes, I tested the plugin extensively now. Players with autobuy scripts cant buy weapons anymore.
GOOD PLUGIN! I hope the admins APPROVE it

I will get you know if I find anymore bugs
Klatypaus is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-01-2015 , 11:10   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #219

Nice, Klatypaus. I'm glad you love this plugin.

Just let me know if there are any problems.
zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 11-04-2015 , 18:24   Re: Weapons War v7.2 (26 Weapons)
Reply With Quote #220

Any suggestions or comments?
zmd94 is offline
Reply



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 13:13.


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