CurWeapon and WeapPickup / register_event to ReAPI

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
35
Реакции
9
Неверный раздел форума
Ошибка
CurWeapon and WeapPickup / register_event to ReAPI
Компилятор
Локальный
Amx Mod X
1.9.0
Исходный код
register_event("WeapPickup","checkModel","b","1=19")
register_event("CurWeapon","checkWeapon","be","1=1")

to ReAPI
How to change this

register_event("WeapPickup","checkModel","b","1=19")
register_event("CurWeapon","checkWeapon","be","1=1")

to ReAPI
 

Garey

ninjaCow
Сообщения
411
Реакции
1,051
Помог
10 раз(а)
WeapPickup - RG_CBasePlayer_AddPlayerItem
CurWeapon - Depends on what you do in your "checkWeapon"
 
Сообщения
35
Реакции
9
on checkWeapon


PHP:
public checkWeapon(id)
{
    new plrClip, plrAmmo
    new plrWeapId
   
    plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
   
    if (plrWeapId == CSW_DEAGLE && g_HasRevolver[id])
    {
        checkModel(id)
    }
    else
    {
        return PLUGIN_CONTINUE
    }
    return PLUGIN_HANDLED
}
 

Garey

ninjaCow
Сообщения
411
Реакции
1,051
Помог
10 раз(а)
So... your plugin is just model replacer? If yes then there no Deploy function in reapi
But u can use Hamsandwich without reapi (Ham_Item_Deploy) function to replace model
 
Сообщения
35
Реакции
9
What should I do with this then replacing that with ReAPI?

PHP:
public checkModel(id)
{
    new szWeapID = read_data(2)
   
    if ( szWeapID == CSW_DEAGLE && g_HasRevolver[id] == true && get_pcvar_num(cvar_custommodel) )
    {
        set_pev(id, pev_viewmodel2, DG_V_MODEL)
        set_pev(id, pev_weaponmodel2, DG_P_MODEL)
    }
    return PLUGIN_HANDLED
}

public checkWeapon(id)
{
    new plrClip, plrAmmo
    new plrWeapId
   
    plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
   
    if (plrWeapId == CSW_DEAGLE && g_HasRevolver[id])
    {
        checkModel(id)
    }
    else
    {
        return PLUGIN_CONTINUE
    }
    return PLUGIN_HANDLED
}
 
Сообщения
35
Реакции
9
I am trying to learn how to use ReAPI thats why I am here, I know there are more common methods to use WeapPickup and checkWeapon, thats why I need on how to use reapi with those functions
 

Garey

ninjaCow
Сообщения
411
Реакции
1,051
Помог
10 раз(а)
nanaka, As i said its not yet implemented in ReAPI, there no hooks to weapon deploy and etc
 
Сообщения
35
Реакции
9
What can i do with get_member(id, m_pActiveItem);?

Give me an example please, very appreciated.
 
Статус
В этой теме нельзя размещать новые ответы.

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

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