- Code: Select all
int n, current;
n = rand(5);
void targetChange(); //Variables
{
if (animindex == getAnimIndex("rangetarget1")) //Setcurrent, to prevent same target from appearing.
{
current = 1;
}
else if (animindex == getAnimIndex("rangetarget2"))
{
current = 2;
}
else if (animindex == getAnimIndex("rangetarget3"))
{
current = 3;
}
else if (animindex == getAnimIndex("rangetarget4"))
{
current = 4;
}
else if (animindex == getAnimIndex("rangetarget5"))
{
current = 5;
}
else if (animindex == getAnimIndex("rangetarget6"))
{
current = 6;
}
if(current == 1) //Set target.
{
if(n==0)ChangeTransparency("target2", 0.000000);
if(n==1)ChangeTransparency("target3", 0.000000);
if(n==2)ChangeTransparency("target4", 0.000000);
if(n==3)ChangeTransparency("target5", 0.000000);
if(n==4)ChangeTransparency("target6", 0.000000);
current = 0;
}
else if(current == 2)
{
if(n==0)ChangeTransparency("target1", 0.000000);
if(n==1)ChangeTransparency("target3", 0.000000);
if(n==2)ChangeTransparency("target4", 0.000000);
if(n==3)ChangeTransparency("target5", 0.000000);
if(n==4)ChangeTransparency("target6", 0.000000);
current = 0;
}
else if(current == 3)
{
if(n==0)ChangeTransparency("target1", 0.000000);
if(n==1)ChangeTransparency("target2", 0.000000);
if(n==2)ChangeTransparency("target4", 0.000000);
if(n==3)ChangeTransparency("target5", 0.000000);
if(n==4)ChangeTransparency("target6", 0.000000);
current = 0;
}
else if(current == 4)
{
if(n==0)ChangeTransparency("target1", 0.000000);
if(n==1)ChangeTransparency("target2", 0.000000);
if(n==2)ChangeTransparency("target3", 0.000000);
if(n==3)ChangeTransparency("target5", 0.000000);
if(n==4)ChangeTransparency("target6", 0.000000);
current = 0;
}
else if(current == 5)
{
if(n==0)ChangeTransparency("target1", 0.000000);
if(n==1)ChangeTransparency("target2", 0.000000);
if(n==2)ChangeTransparency("target3", 0.000000);
if(n==3)ChangeTransparency("target4", 0.000000);
if(n==4)ChangeTransparency("target6", 0.000000);
current = 0;
}
else if(current == 6)
{
if(n==0)ChangeTransparency("target1", 0.000000);
if(n==1)ChangeTransparency("target2", 0.000000);
if(n==2)ChangeTransparency("target3", 0.000000);
if(n==3)ChangeTransparency("target4", 0.000000);
if(n==4)ChangeTransparency("target5", 0.000000);
current = 0;
}
}
I have this code in global code, but it won't work, when I use the function it just gives me this error,
"target1 -> Timer (wait1), line 1: Link error: undefined function :-> targetChange"
What's wrong?