got it to work.. this is the working code..
void spawnhealthani(void vName, float fX, float fY, float fZ, int Health, void Ani)
{
void self = getlocalvar("self");
void vSpawn;
int iDirection = getentityproperty(self, "direction");
clearspawnentry();
setspawnentry("name"...