View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-07-2018 , 18: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