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

[MOD] CS Halloween Mod (v6.4.1)


Post New Thread Reply   
 
Thread Tools Display Modes
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
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 10-31-2015 , 16:05   Re: Halloween Mod 2015
Reply With Quote #12

api_player_burn
I would not want to use Orpheu.

api_player_cosmetics
I can fix.

api_player_invisible
My friend. I just taught him.

cs_api_player_spawn
Oh, this is my old API. Ok, I fix it. %)
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 10-31-2015 at 16:44.
Hedgehog Fog is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-31-2015 , 16:15   Re: Halloween Mod 2015
Reply With Quote #13

Quote:
I would not want to use Orpheu.
Why the heck people keep saying this ? That's does not make any sense. Orpheu is a module like any other(ham/engine/fakemeta etc), the only difference is that it does not have some predefined functions, it gives you access to any function you want, if you provide an indetifier(symbol, signature).
What it matters is to use the right tool at the right moment. You are checking if he is in water each frame, and this is too much. CheckWater is a better place for doing your checks, as it happes less frequently and at almost the right moment. Also don't tell me that you don't know how to use it, I did the work for you and I can explain more if you don't understand something.
__________________

Last edited by HamletEagle; 10-31-2015 at 16:16.
HamletEagle is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 10-31-2015 , 16:43   Re: Halloween Mod 2015
Reply With Quote #14

HamletEagle,
Orpheu is not included in amxmodx-1.8.2-base, I think this is the reason.

Quote:
if(g_playerHatEntity[id][slot] <= 0 || !pev_valid(g_playerHatEntity[id][slot])) checking only if entity is invalid should be enough.
Not sure. 0 is a worldspawn entity, isn't it?
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 10-31-2015 at 16:44.
Hedgehog Fog is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-31-2015 , 17:22   Re: Halloween Mod 2015
Reply With Quote #15

Definately not a good reason. Your plugin is not part of amxmodx-1.8.2-base too, but people download and install it. This is the case of orpheu too, just link to the package and eventually tell them how to install it.
Yeah, 0 is worldspawn, well, not like it matter much.
__________________
HamletEagle is offline
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 10-31-2015 , 18:22   Re: Halloween Mod 2015
Reply With Quote #16

HamletEagle,
I'm a little tired today. I will continue tomorrow, maybe I will use Orpheu.
Please tell me that it would be better replace to the Orpheu methods besides infinite round and force round wins, Player Burn API(extinguish by water).
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities
Hedgehog Fog is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 10-31-2015 , 22:53   Re: Halloween Mod 2015
Reply With Quote #17

Intresting
Syturi0 is offline
Syturi0
Veteran Member
Join Date: Aug 2014
Location: Your mom house -Portugal
Old 11-01-2015 , 01:07   Re: Halloween Mod 2015
Reply With Quote #18

Can you give me the code for the 4 spells? Whiout the need of all that .amxx files and api's
Syturi0 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-01-2015 , 08:20   Re: Halloween Mod 2015
Reply With Quote #19

Quote:
Originally Posted by Hedgehog95 View Post
HamletEagle,
I'm a little tired today. I will continue tomorrow, maybe I will use Orpheu.
Please tell me that it would be better replace to the Orpheu methods besides infinite round and force round wins, Player Burn API(extinguish by water).
Take things step by step. We'll see later, for now complete what I have said.
__________________
HamletEagle is offline
topv1rus
Junior Member
Join Date: Jun 2015
Old 11-02-2015 , 04:11   Re: Halloween Mod 2015
Reply With Quote #20

Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team


C:/Users/********************************************* ********************************************* ***************************/Downloads/FanxyStudio_Alpha010/amxxpc/hwn_weapons.sma( : fatal error 100: cannot read from file: "weapons_stocks"


Compilation aborted.
1 Error.
Could not locate output file C:/Users/********************************************* ********************************************* ***************************/Downloads/FanxyStudio_Alpha010/amxxpc///hwn_weapons.amx (compile failed).
topv1rus is offline
Reply


Thread Tools
Display Modes

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 00:36.


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