Raised This Month: $51 Target: $400
 12% 

[MOD] CS Halloween Mod (v6.4.1)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-31-2015 , 15:54   Re: Halloween Mod 2015
Reply With Quote #11

Let's check each plugin:

api_player_burn:
  • You should use real offset names, so instead of m_flPainShock you should put m_flVelocityModifier. Changing the name does not impact on the code, but it helps on readability. Someone who is reading your code can check HLSDK/CSSDK(if it is the case) and understand what this offset is used for.
  • Do you mind using orpheu ? Checking if player is in water in PreThink it's a poor way. You can hook PM_CheckWater as post and do what you do in PreThink there. The difference is that this happens at the right moment. Here's what you should do, with explanations(if you don't understand something please tell me):
    Spoiler

    The needed signatures are here:
    Spoiler
  • Don't use natives with style 1, it is considered deprected functionality. Swith to style 0. Remember that when using style 0 you don't have the params in the header, you access them with get_param/get_string/get_array(depending on the param type). Do this in all your plugins.
  • In on_player_spawn check if the user is alive before doing something.

api_player_cosmetics:
  • if(g_playerHatEntity[id][slot] <= 0 || !pev_valid(g_playerHatEntity[id][slot])) checking only if entity is invalid should be enough.
  • Allocating a string is an expensive operation, so this engfunc(EngFunc_AllocString, "info_target") should be cached in a place like init, then use it's value.
  • In get_player_cosmetic_model_index check if the entity is valid before retrieving model index.

api_player_invisible:
  • #define AUTHOR "FiEctro" are you FiEctro ? If not, give proper credits please.

cs_api_player_spawn:
  • Nothing should be static, use new.

cs_api_player_team does not make much sense, remove it and use the natives from cstrike module. Also in hmw_weapons: please remove your useless implementation of give_item/cs_set_weapon_ammo etc and use the natives from the modules. They should be faster. So give_user_weapon -> give_item; set_user_ammo -> cs_set_user_bpammo. Your weapons menu never change during run time, so you can build it only one time in precache, then just show it when the command is used. Remember to change menu_destroy to menu_cancel, because you will need the menu later.

I did not checked all of them, because there is a lot of code. I would prefer to take things step by step. Read what I said and try to modify. You can PM me when you made the changes, so we can continue.

Don't forget, if you don't understand something ask.
__________________

Last edited by HamletEagle; 10-31-2015 at 15:55.
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 12:01.


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