Скриптер
Моделлер
Участник
Пользователь
- Сообщения
- 855
- Реакции
- 532
- Помог
- 13 раз(а)
Код:
// В SetModel'е ставлю SetTouch(iEnt, "LaserMine_Touch");
public LaserMine_Touch(iEnt, toucher)
{
client_print(0, print_chat,"%d", toucher);
if (get_entvar(iEnt, var_euser3) != WEAPON_KEY)
{
client_print(0, print_chat,"weaponkey");
return HC_CONTINUE;
}
if (!(0<toucher<33))
{
client_print(0, print_chat,"validation");
return HC_BREAK;
}
if (zp_get_user_zombie(toucher))
{
client_print(0, print_chat,"zombie");
return HC_BREAK;
}
client_print(0, print_chat,"checked");
give_weapon(toucher);
return HC_BREAK;
}
Код:
public fwd_setmodel_c4_pre(iEnt) <WeaponBox: Enabled> {
state WeaponBox: Disabled;
static i, szClassname[32], iItem;
pev(iEnt, pev_classname, szClassname, 31);
//if(!equal(szClassname, "weaponbox")) return FMRES_IGNORED;
static owner; owner = get_entvar(iEnt, var_owner);
new iAmmoType = m_rgAmmo2 + 14;
for(i = 0; i < 6; i++) {
iItem = get_pdata_cbase(iEnt, m_rgpPlayerItems_CWeaponBox + i, 4);
if(iItem > 0 && pev(iItem, pev_impulse) == WEAPON_KEY) {
engfunc(EngFunc_SetModel, iEnt, W_MODEL);
//set_pev(iEnt, pev_body, WEAPON_BODY);
set_entvar(iEnt, var_euser3, WEAPON_KEY);
set_entvar(iEnt, var_iuser1, get_pdata_int(owner, iAmmoType, 5));
//SetTouch(iEnt, "LaserMine_Touch");
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
entity classname = weaponbox
Последнее редактирование: