AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set armor and helmet using only engine (https://forums.alliedmods.net/showthread.php?t=331644)

mlibre 03-30-2021 18:06

Set armor and helmet using only engine
 
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


OciXCrom 03-30-2021 18:09

Re: Set armor and helmet using only engine
 
May I ask why?

mlibre 03-30-2021 18:17

Re: Set armor and helmet using only engine
 
I'm trying to use as few modules as possible thus optimizing you could say performance and response times in terms of native calls

redivcram 03-30-2021 18:29

Re: Set armor and helmet using only engine
 
It makes no such difference.

OciXCrom 03-30-2021 19:54

Re: Set armor and helmet using only engine
 
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.

mlibre 04-04-2021 16:34

Re: Set armor and helmet using only engine
 
I'm evading the cstrike that's why I use engine

redivcram 04-04-2021 16:41

Re: Set armor and helmet using only engine
 
Read our posts again.

fysiks 04-04-2021 19:29

Re: Set armor and helmet using only engine
 
Quote:

Originally Posted by mlibre (Post 2743019)
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.

HamletEagle 04-05-2021 05:20

Re: Set armor and helmet using only engine
 
Quote:

Originally Posted by mlibre (Post 2742456)
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.

DJEarthQuake 04-05-2021 08:02

Re: Set armor and helmet using only engine
 
Code:
#include amxmodx #include engine #define ent create_entity("game_player_equip") public plugin_precache()DispatchKeyValue( ent, "item_assaultsuit", "1" ) && DispatchSpawn(ent);


All times are GMT -4. The time now is 15:35.

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