Raised This Month: $ Target: $400
 0% 

[CSO] Hidden Mod(Update v3.5-3/10/13)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-27-2014 , 07:43   Re: [CSO] Hidden Mod(Update v3.5-3/10/13)
Reply With Quote #40

Your comments are a mess.

PHP Code:

// ===============================================================================
//     Booleans
// ===============================================================================
new NRTS[33//Bool for change team
new HasSpeed[33//bool for each team speed
new HasShopSpeed[33//bool for speed in shop
new HasGravity[33//bool for gravity shop
new HasDamage[33//bool for double damage shop
new HasMulti[33//bool for multijump shop
new jumpnum[33//bool for multijump
new dojump[33//bool for multijump
new knifes_used[33]
new 
prima_used[33]
new 
second_used[33]
new 
is_joker[33]

//BOOL FOR NEW STYLE OF SHOP
new itemunlocked[33][10]
/*
[0] = M4
[1] = AK47
[2] = Galil
[3] = P90
[4] = AWP
[5] = Deagle
[6] = Dual
[7] = Strong
[8] = Axe
[9] = Combat
*/ 
Even not one of this are booleans.
Please don't comment everything just for the sake of having green lines into your code, comment only the parts that may be confusing, where you want to explain something.

FYI, sizeof is not a function, so it's sizeof string and not sizeof(string). Nothing wrong to use (), just saying.

PHP Code:
stock const FIRST_JOIN_MSG[] =        "#Team_Select";
stock const FIRST_JOIN_MSG_SPEC[] =    "#Team_Select_Spect";
stock const INGAME_JOIN_MSG[] =        "#IG_Team_Select";
stock const INGAME_JOIN_MSG_SPEC[] =    "#IG_Team_Select_Spect"
Why stock] ? This is useful in include files where parts of the code may not be needed, but in a plugin you should use every variable/function that you create.

PHP Code:
/* Booleans / Integers */
new menu1
new menu2
new knifes
new axe[33]
new 
combat[33]
new 
hammer[33]
new 
strong[33]
new 
defaul[33
Were do you see a bool ? Tell me.

This is just a "copy-paste", please be consistent. In some places you put both models in the same constant, in other places you create two of them.
PHP Code:
new VIEW_AXE[]        = "models/hidden-mod/v_axe_knife.mdl"
new PLAYER_AXE[]    = "models/hidden-mod/p_axe_knife.mdl" 
In forwards like init,precache,cfg you don't need static. A good ideea would be to add dynamic suport for both wav and mp3 files, just check the extension of the sound file and decide what it is. I can provide a way if you don't know how.

PHP Code:
precache_sound("hidden-mod/5.wav")
precache_sound("hidden-mod/4.wav")
precache_sound("hidden-mod/3.wav")
precache_sound("hidden-mod/2.wav")
precache_sound("hidden-mod/1.wav"
Don't hardcode them if you already used constant for everything else.

You register FM_Spawn forward in plugin_precache, it would be good to unregister it in init.
Again, be consistent and use charsmax to get a string array size.

In Event_DeathMsg():
Getting their names should be under the if check, to avoid useless array initialization and native calls.
The rand variable is used one time, just use random_num inside the switch().

PHP Code:
RegisterHam(Ham_Touch"armoury_entity""FakemetaTouch")
RegisterHam(Ham_Touch"weaponbox""FakemetaTouch"
Fakemeta but your forwards are from hamsandwich.

In give_screenfade cache get_user_msgid("ScreenFade") in a global variable. MSG_ONE_UNRELIABLE may be better, to avoid overflow.

In FwdTakeDamage better to see if the inflictor is the same as the attacker, to make sure that a player made the damage.

PHP Code:
if(HasDamage[attacker])
                {    
                    
SetHamParamFloat(4damage 2);
                }
                if(
strong[attacker])
                {
                    
SetHamParamFloat(4damage get_pcvar_float(knife_dam))
                } 
Some logic problems here. If both are true only the last one would be taken into account.
Reseting the variables in client_disconnect and putinserver is silly, do it only in disconnect. Also this forward is called one time when a player send the "disconnect" command, why static ?
There are better ways for multijump, others than prethink & posthink.

Instead of CurrentWeapon event hook Ham_Item_Deploy and retrieve the player index for m_pPlayer offset. For changing speed hook Ham_Item_PreFrame, don't use currentweapon for such stuffs.

Go to emp tutorial about new amxx style menu and you will find some interesting stuffs about the menus. In this case using the info param of the menu_additem native is not needed. If you just pass "" you can also remove menu_getinfo native.

If you want to block a menu item in some situation you can specify 1<<31 bits and you don't need to keep checking the team into the handler. Such menu may be created as global anyway.

PHP Code:
new shop[101]; 
This array size is too big for such small items names.
Amxmodx 1.8.3 has a native for colored print, you can add suport for it, just check if AMXX_VERSION_NUM < 183

In jokers_handler cache the value of cs_get_user_money(id) native.

Your client_printc stock is awful, don't reindex an array, just save it in a variable, cache get_user_msgid value.
You can replace create_fog with a stock made by Arkshine, it's much better, without hardcoded density values.

I will stop now because I feel like is enough, but if you want I may continue later.
__________________

Last edited by HamletEagle; 12-27-2014 at 11:10.
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 18:40.


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