Hello. I used the search, but can not find exactly what I want.
I can hook weaponbox spawn:
PHP Code:
RegisterHam(Ham_Spawn, "weaponbox", "weaponbox_spawn", 1)
And now I have three questions:
- How I can check if weaponbox == M4A1 (or any another weapon)?
- How I can replace (change) model of weaponbox?
- How I can check if weaponbox with M4A1 (or USP) weapon have enabled silencer?
I try do first:
PHP Code:
public weaponbox_spawn(weaponBox)
{
new iWeapon = get_pdata_cbase(weaponBox, 35, 4)
client_print(0, print_chat, "weaponbox: %i", iWeapon)
}
I got "-1" value for all weaponbox'es

.
I try do second:
PHP Code:
public weaponbox_spawn(weaponBox)
{
engfunc(EngFunc_SetModel, weaponBox, "models/w_ak47.mdl")
}
I guess this code should replace all weaponboxes models with AK47 model. But this does not work

.
Thanks!