Raised This Month: $120 Target: $400
 30% 

About the Difference Of the Modules "fakemeta_util" and "fun"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jess98
Junior Member
Join Date: Apr 2018
Old 12-06-2018 , 18:49   About the Difference Of the Modules "fakemeta_util" and "fun"
Reply With Quote #1

There are some same functions in these two modules.. Actually I can't be sure if they are same or not.. But in fun, they call as "natives" and in fakemeta_util, they call as "stocks". I want to ask 2 questions about that..

1 - What's the difference between "native" and "stock"? Do we use stock as how we use native?

2 - What's the difference between of these functions, do they have the same tasks? (And other ones that I didn't write here):

Code:
fm_get_user_godmode => get_user_godmode
Code:
fm_set_user_godmode => set_user_godmode
---

Code:
fm_get_user_gravity => get_user_gravity
Code:
fm_set_user_gravity => set_user_gravity
---

Code:
fm_get_user_maxspeed => get_user_maxspeed
Code:
fm_set_user_maxspeed => set_user_maxspeed
---

Code:
fm_give_item => give_item
---

* The left ones belong to fakemeta_util, the right ones belong to fun
Jess98 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-06-2018 , 19:23   Re: About the Difference Of the Modules "fakemeta_util" and "fun"
Reply With Quote #2

They do the same thing, but fun does it with 1 native call versus many with fakemeta_util. Use fun when possible.
__________________
Bugsy is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-07-2018 , 15:15   Re: About the Difference Of the Modules "fakemeta_util" and "fun"
Reply With Quote #3

1. 'native' is a function that will make only 1 call to the module;
'stock' is a set of funtions, every function will make own call to the module.
2. See Bugsy's answer.
__________________
My English is A0
E1_531G is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: Brazil 🇧🇷
Old 12-07-2018 , 15:44   Re: About the Difference Of the Modules "fakemeta_util" and "fun"
Reply With Quote #4

Avoid from use and/or create stock if is there one native that does same thing., even more if stock it's of fakemeta_util.
__________________
Working with $$$ paid plugins. Contact below (ONLY FOR NEGOTIATIONS)
  • Skype: crazy.770
  • Steam: crazy770
  • Discord: CrazY.#5317
Feel free to check my work at https://conceptstrike.blogspot.com

Check my Aliens vs. Predator: currently offline

Last edited by CrazY.; 12-07-2018 at 15:45.
CrazY. is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-07-2018 , 19:09   Re: About the Difference Of the Modules "fakemeta_util" and "fun"
Reply With Quote #5

fakemeta_util re-creates many functions that already exist, but it is not ideal to use these unless you need to modify functionality in some way. In some cases, fakemeta_util completes a function that also exists in another module, such as fun, in 1 native call so there is really no negative aspect of using the fakemeta_util version. As E1_531G mentioned, less native calls are better. Below are examples of each:

godmode - Each result in 1 native call so there is really no difference.

fakemeta_util
Code:
stock fm_get_user_godmode(index) {     new Float:val;
    pev(index, pev_takedamage, val);
    return (val == DAMAGE_NO); }

fun
Code:
get_user_godmode()

strip_user_weapons - fakemeta_util requires 5 native calls while the fun version is only 1. For this, fun would be ideal, unless you needed to modify functionality in some way.

fakemeta_util
Code:
stock fm_strip_user_weapons(index) {
    new ent = fm_create_entity("player_weaponstrip");
   
    if (!pev_valid(ent))
        return 0;
    dllfunc(DLLFunc_Spawn, ent);
    dllfunc(DLLFunc_Use, ent, index);
    engfunc(EngFunc_RemoveEntity, ent);
    return 1; }

fun
Code:
strip_user_weapons
__________________
Bugsy is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-08-2018 , 05:10   Re: About the Difference Of the Modules "fakemeta_util" and "fun"
Reply With Quote #6

Note that fakemeta_util also contains some stocks that are not conversions of existing natives, which are useful and can be used.
__________________
HamletEagle 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 13:53.


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