I implemented some things that I liked: 1) one task system for the whole server, 2) the AMXX 182 and 183 optimized color system, 3) I removed the model update every second (no needed), added czbots support and 4) opmized no weapon pick up. I attached the newer file. Here you can see exactly what I changed. The others things not mentioned here, still need to be implemented.
If you have some doubts or trouble implementing/understanding, just ask me here or PM me.
On 'menu_item_getinfo( menu, item, access, data, 5, iName, 63, callback )', 'static msg[ 191 ]', you still hard coding the string size, use charsmax( iName ).
Use 'get_pcvar_num( cvar_friendlyfire )' instead of 'get_cvar_num("mp_friendlyfire")'. Because pcvars are much faster than cvars. Example:
You were updating the all players model every second. No need to do that.
Remove the game native skim choosher that appears after you choose team using your team chooser.
If you choose the spectator team, when entering at the server for the first time, the user stays locked/blocked on the opening camera, without moving around or watching others playing.
Cache the 'get_user_msgid("DeathMsg")' value used on 'extra_dmg(id, attacker, damage, weaponDescription[])' at 'plugin_init' using a global variable.
p | weapon_touch | 1637 | 0.001147 / 0.000000 / 0.000013
f | operator*(Float:,_:) | 153 | 0.000055 / 0.000000 / 0.000001
f | operator/(Float:,_:) | 169 | 0.000057 / 0.000000 / 0.000001
f | operator/(_:,Float:) | 781 | 0.000160 / 0.000000 / 0.000003
f | operator+(Float:,_:) | 169 | 0.000060 / 0.000000 / 0.000001
f | operator-(_:,Float:) | 507 | 0.000083 / 0.000000 / 0.000001
f | operator==(Float:,_:) | 153 | 0.000043 / 0.000000 / 0.000001
f | get_configsdir | 1 | 0.000000 / 0.000000 / 0.000000
f | get_user_model | 40 | 0.000020 / 0.000000 / 0.000001
f | spawn_event | 41 | 0.000105 / 0.000001 / 0.000007
f | use_power | 202 | 0.000546 / 0.000000 / 0.000027
f | create_power | 169 | 0.002072 / 0.000003 / 0.000079
f | dbz_loop | 2284 | 0.004845 / 0.000000 / 0.000133
f | model_update | 41 | 0.000075 / 0.000001 / 0.000003
f | extra_dmg | 153 | 0.000234 / 0.000000 / 0.000010
f | set_user_health | 41 | 0.000031 / 0.000000 / 0.000005
f | fm_cs_set_user_nobuy | 562 | 0.000589 / 0.000000 / 0.000005
f | precache_playermodel | 37 | 0.000154 / 0.000002 / 0.000008
f | fm_cs_get_weapon_ent_owner | 1069 | 0.000746 / 0.000000 / 0.000003
f | print_colored | 281 | 0.000310 / 0.000000 / 0.00000437 natives, 25public callbacks, 45 function calls were not executed.
See more details about that on amxmodx profiler thread. To cache the value of 'cs_get_user_team' and others as I cached 'is_user_alive', seen unncessary because once 'vexd_pfntouch' is replaced, the others natives also called as high as 'vexd_pfntouch' is will get improved, because they are called within 'vexd_pfntouch'. I cached 'is_user_alive' because it was called multiple times per second on multiple places. See some natives vs caches on the profiler to see some results. To know more about this see Optimizing Plugins: Cache Results on a Larger Scale? and Function checks vs variables.
Dont use anything from amxmod_compact as your 'vexd_pfntouch'. This is called too much on some game play minutes.
See the thread Best touch function for alternatives to it. Here above you can see that 'model_change' was called just 40 times, but it is because I already have removed its per second update on all players.
As task operations are expensive operations, better to have only one task that is created when the first player is put in to the server, and removed when the last player disconnects. And when someone is put in server/disconnected, add/remove its id to the current players ids array. Then on that task, loop through all players on that list. Hence 'ShowHUD' and 'dbz_loop' first code part, were merged on 'iterate_through_players'. And now, on 'fwd_PlayerSpawn', must be removed the 'set_task', as we just have one now:
v 1.5 (Beta):
* Cached Itens for reduce lag/delay (Thanks addons_zz for helping)
* No Amx 1.8.2 Suport now (Now requires AMX 1.8.3 or higher)
* Removed set_user_model plugin needed (Because of cstrike module fixes on AMX 1.8.3)
* Optimed Code
* Removed Redudant Resources
* DBZ tag changed to DBM in cvars
* Added Omega Shenron Sounds
* Added Frieza's Golden Form
* Changed Vegeta SSJ3 to Vegeta SSJ Blue
* Power up description updated on lang (Lang Updated)