Quote:
Originally Posted by Arkshine
cs_get_weapon_burst expects you a weapon entity index not player.
|
You mean like "CSW_VP70"? but that's what was originally in there and it also got an error.
But okay, I'll test it again first. Might just be a slight case of the stupid on my part.
Be updating you in a few...
UPDATE:
======
No go replacing it with "CSW_VP70". I even tried putting "CSWID" but still the same error. I'll put the whole "Event_CurWeapon" code so you can see what I mean.
PHP Code:
public Event_CurWeapon(id)
{
if(!is_user_alive(id))
return
static CSWID; CSWID = read_data(2)
if((CSWID == CSW_VP70 && g_Old_Weapon[id] != CSW_VP70) && Get_BitVar(g_Had_Weapon, id))
{
set_pev(id, pev_viewmodel2, V_MODEL)
set_pev(id, pev_weaponmodel2, "")
set_weapon_anim(id, DRAW_ANIM)
Draw_NewWeapon(id, CSWID)
set_user_maxspeed(id, get_user_maxspeed(id)-WALKSPEED);
} else if((CSWID == CSW_VP70 && g_Old_Weapon[id] == CSW_VP70) && Get_BitVar(g_Had_Weapon, id)) {
static Ent; Ent = fm_get_user_weapon_entity(id, CSW_VP70)
if(!pev_valid(Ent))
{
g_Old_Weapon[id] = get_user_weapon(id)
return
}
new Float:rof
if(Get_BitVar(g_Had_Weapon,id))
{
if(cs_get_weapon_burst(CSWID)) rof = BURSTROF
else rof = RATEOFIRE
}
set_pdata_float(Ent, 46, get_pdata_float(Ent, 46, 4) * rof, 4)
} else if(CSWID != CSW_VP70 && g_Old_Weapon[id] == CSW_VP70) Draw_NewWeapon(id, CSWID)
g_Old_Weapon[id] = get_user_weapon(id)
}