Hello there
So i have a problem as title wrote. I'm making a plugin when spectating player, will change v_model's body. Apparently it works, but delayed for few seconds. E.g. when spectating [BOT] Zach, his hands is using body 2 then after like 3s it will changed to body 3 which is what it should be. How to make it 'instantly' updated ?
*edit
Sometimes need to cycle through other players and switching spectator mode first to make it updated
*edit2
I'm using module called metadrawer for changing model body
PHP Code:
public plugin_init()
{
// Register New Addon
register_plugin(ADDON_NAME, ADDON_VERSION, ADDON_AUTHOR);
register_event("StatusValue","SpecTo_Target","bd","1=2")
register_event("SpecHealth2","SpecTo_Target","bd")
register_event("TextMsg","Spec_GetMode","b","2&#Spec_Mode")
}
public SpecTo_Target(id)
{
if (id > 0)
{
new target = read_data(2)
if (target > 0 && spec[id] > 0)
{
new szMdl[64], classid
cs_get_user_model(target, szMdl, 63)
classid = GetIDFromList(szMdl)
new hand = g_mdl_hand[classid]
// Change body, delayed
md_setviewentitybody(id, hand - (floatround(float(hand / 10), floatround_tozero) * 10))
}
}
}
public Spec_GetMode(id)
{
// discover if in first_person_view
new specMode[12]
read_data(2, specMode, 11)
if(equal(specMode, "#Spec_Mode4")) spec[id] = 1
else spec[id] = 0
}
I have tried searching for spectator related and this is the closest one to fulfill my desire but this issue. I'm still learing about spectator stuff, so bear with me :')
Thanks in advance !