void main()
{
int iPlIndex = getlocalvar("player"); //Get Player's index
void vSelf = getlocalvar("self"); //Get player
void vAniID = getentityproperty(vSelf,"animationID"); //Get current animation ID
void vAniPos = getentityproperty(vSelf, "animpos"); //Get current animation frame
int Arrow = getentityvar(vSelf,1);
int SFX = loadsample("data/sounds/ganti.wav");
void iUp = playerkeys(iPlIndex, 1, "moveup"); // New key status of "Up"
void iDown = playerkeys(iPlIndex, 1, "movedown"); // New key status of "Down"
void iLeft = playerkeys(iPlIndex, 1, "moveleft"); // New key status of "Left"
void iRight = playerkeys(iPlIndex, 1, "moveright"); // New key status of "Right"
void iAttack2 = playerkeys(iPlIndex, 1, "attack2");// New key status of "Attack2"
void iAttack3 = playerkeys(iPlIndex, 1, "attack3");// New key status of "Attack3"
// Arrow switch
if (iAttack2){ // change arrow left
if (vAniID != openborconstant("ANI_DIE") && vAniID != openborconstant("ANI_RESPAWN") && vAniID !=
openborconstant("ANI_SELECT")){ // Not in invalid animations?
Arrow = Arrow - 1;
if(Arrow <= 0){
Arrow = 4;
}
setentityvar(vSelf, 1, Arrow);
playsample(SFX, 0, 120, 120, 100, 0);
}
} else if (iAttack3){ // change arrow right
if (vAniID != openborconstant("ANI_DIE") && vAniID != openborconstant("ANI_RESPAWN") && vAniID !=
openborconstant("ANI_SELECT")){ // Not in invalid animations?
Arrow = Arrow + 1;
if(Arrow >= 5){
Arrow = 1;
}
setentityvar(vSelf, 1, Arrow);
playsample(SFX, 0, 120, 120, 100, 0);
}
}
}