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

Set armor and helmet using only engine


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 03-30-2021 , 18:06   Set armor and helmet using only engine
Reply With Quote #1

I want to replace this

PHP Code:
cs_set_user_armor(id300CS_ARMOR_VESTHELM
I try to do it this way, I'm just not sure if I would be doing the same

PHP Code:
/*
knowing that -> EV_FL_armortype...?

CS_ARMOR_NONE = 0, // no armor
CS_ARMOR_KEVLAR = 1, // armor
CS_ARMOR_VESTHELM = 2 // armor and helmet
*/

entity_set_float(idEV_FL_armortype2.0)

static 
Float:fArmorfArmor entity_get_float(idEV_FL_armorvalue)

entity_set_float(idEV_FL_armorvaluefArmor 300.0
__________________
mlibre is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-30-2021 , 18:09   Re: Set armor and helmet using only engine
Reply With Quote #2

May I ask why?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 03-30-2021 , 18:17   Re: Set armor and helmet using only engine
Reply With Quote #3

I'm trying to use as few modules as possible thus optimizing you could say performance and response times in terms of native calls
__________________
mlibre is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 03-30-2021 , 18:29   Re: Set armor and helmet using only engine
Reply With Quote #4

It makes no such difference.
redivcram is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-30-2021 , 19:54   Re: Set armor and helmet using only engine
Reply With Quote #5

Such micro-optimizations are completely redundant. Whether you use the native in your plugin or not, the module will still run if used by other plugins. This particular change accomplishes nothing in terms of speed.
__________________

Last edited by OciXCrom; 03-30-2021 at 19:55.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-04-2021 , 16:34   Re: Set armor and helmet using only engine
Reply With Quote #6

I'm evading the cstrike that's why I use engine
__________________
mlibre is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 04-04-2021 , 16:41   Re: Set armor and helmet using only engine
Reply With Quote #7

Read our posts again.
redivcram is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-04-2021 , 19:29   Re: Set armor and helmet using only engine
Reply With Quote #8

Quote:
Originally Posted by mlibre View Post
I'm evading the cstrike that's why I use engine
A complete waste of time. If a module can do what you need to do, use it.
__________________
fysiks is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-05-2021 , 05:20   Re: Set armor and helmet using only engine
Reply With Quote #9

Quote:
Originally Posted by mlibre View Post
I'm trying to use as few modules as possible thus optimizing you could say performance and response times in terms of native calls
fewer modules != performance. I honestly don't know where people get this idea and why they keep insisting even when they are told it's completely wrong. Loading more/less modules has nothing to do with "response time" or "performance". If this was the case, it would mean loading a module has a direct impact on the cpu, causing overhead. But loading a module is merely reading the bytes from the different sections of the binary file only once and then mapping them in the address space of the hlds process. At most you use a tiny tiny bit of memory, probably a few kbs.

Use the proper module for the job. That's all there is to it.
__________________

Last edited by HamletEagle; 04-05-2021 at 05:25.
HamletEagle is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-05-2021 , 08:02   Re: Set armor and helmet using only engine
Reply With Quote #10

Code:
#include amxmodx #include engine #define ent create_entity("game_player_equip") public plugin_precache()DispatchKeyValue( ent, "item_assaultsuit", "1" ) && DispatchSpawn(ent);
__________________

Last edited by DJEarthQuake; 04-06-2021 at 08:14. Reason: Occam's razor
DJEarthQuake 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 09:36.


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