looks like i am still having a problem with this code the highlighted code always returns "working" with any < value and returns "not working" with any > value. I have changed the script so it changes the enemys name did this so i can check what the code is returning.
void hpbar(void vName, float fx, float fy, float fz)
{
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
void Alias;
int Health = getentityproperty(self,"health");
int MHealth = getentityproperty(self,"maxhealth");
int PHealth = (Health/MHealth*100);
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name",vName); //Acquire spawn entity by name.
int dx = getentityproperty(self, "x"); //Get X location and add adjustment.
int dy = getentityproperty(self, "a"); //Get Y location and add adjustment.
int dz = getentityproperty(self, "z"); //Get Z location and add adjustment.
if(PHealth>10)Alias="working";
else{
Alias = "not working";
}
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", dx, dy, dz); //Set spawn location.
bindentity(vSpawn, self, fx, fz, fy, 0, 0);
changeentityproperty(self, "name", Alias); //Set Alias to spawned entity
return vSpawn; //Return spawn.
}
if anyone has any ideas what i am doing wrong please share.