remove the 3 frags that the game gives when deactivating and exploding the bomb

Сообщения
10
Реакции
0
I am trying to remove the 3 frags that the game gives when deactivating and exploding the bomb, but he does nothing who can help me

Код:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <reapi>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
   
    RegisterHookChain(RG_CGrenade_DefuseBombEnd, "CGrenade_DefuseBombEnd", 1);
    RegisterHookChain(RG_CGrenade_ExplodeBomb, "CGrenade_ExplodeBomb", 1);
}

public CGrenade_DefuseBombEnd(ent, id, bool:bDefused)
{
    if(bDefused)
    {
        set_entvar(id, var_frags, get_entvar(id, var_frags) - 3.0);
       
        new name[32]
        get_user_name(id,name,charsmax(name))
        client_print_color(0,1,"DEFUSER IS %s",name);
    }
}
public CGrenade_ExplodeBomb(ent)
{
    new id = get_entvar(ent, var_owner);
    if(is_user_connected(id))
    {
        set_entvar(id, var_frags, get_entvar(id, var_frags) - 3.0);
       
        new name[32]
        get_user_name(id,name,charsmax(name))
        client_print_color(0,1,"BOMBER IS %s",name);
    }
}
 
Сообщения
1,698
Реакции
1,510
Помог
26 раз(а)
set_entvar(id, var_frags, Float:get_entvar(id, var_frags) - 3.0);
14 Янв 2020
Hook pre and use m_pBombDefuser, for explode too because no owner in post.
 

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу