I'm not sure how to change keyvalues properly, but my guess is to use this:
Code:
DispatchKeyValue(extrastuff[id], "targetname", "string")
DispatchKeyValue(extrastuffb[id], "target", "string")
instead of this:
Code:
entity_set_string(extrastuff[id], EV_SZ_targetname, "string")
entity_set_string(extrastuffb[id], EV_SZ_target, "string")