Bloodbane
Well-known member
It's similar to keyint rafhot posted above, I removed some key events:
Setting 0 like this works but if I set 2, it doesn't work.
Code:
void keyint(void Ani, int Frame, void Key, int Hflag)
{// Change current animation if proper key is pressed or released
void self = getlocalvar("self");
int Direction = getentityproperty(self, "direction");
int iPIndex = getentityproperty(self,"playerindex"); //Get player index
void iRKey;
if (Key=="L"){ //Left Required?
iRKey = playerkeys(iPIndex, 0, "moveleft"); // "Left"
} else if (Key=="R"){ //Right Required?
iRKey = playerkeys(iPIndex, 0, "moveright"); // "Right"
} else if (Key=="B"){ //Back Required?
if (Direction==0){
iRKey = playerkeys(iPIndex, 0, "moveright");
} else {
iRKey = playerkeys(iPIndex, 0, "moveleft");
}
} else if (Key=="S"){ //Special Required?
iRKey = playerkeys(iPIndex, 0, "special"); // "Special"
}
if (Hflag==1){ //Not holding the button case?
iRKey = !iRKey; //Take the opposite condition
}
if (iRKey){
changeentityproperty(self, "animation", openborconstant(Ani),0);
changeentityproperty(self, "animpos", Frame);
}
}
Setting 0 like this works but if I set 2, it doesn't work.