Page 1 of 1

Code issue...

PostPosted: Mon May 07, 2007 12:46 am
by Oman
can anyone tell me why i get the

Error line 25: expected ;

for this code...

if (shield == 0)
{
CreateTimer("Event Actor", "attack1", 500);
if (pd == 1)
{
ChangeAnimation("Event Actor", "player right attack - 1bp", FORWARD);
attack = 3;
}

else if (pd == 2)
{
ChangeAnimation("Event Actor", "player left attack - 1bp", FORWARD);
attack = 4;
}

else if (pd == 5)
{
ChangeAnimation("Event Actor", "player right swipe - 1bp", FORWARD);
attack = 1;
}

else if (pd == 6)
{
ChangeAnimation("Event Actor", "player left swipe - 1bp", FORWARD)
attack = 2;
}
}

else if (shield == 1)
{
if (pd == 5)
{
ChangeAnimation("Event Actor", "player right shield - 1bp", FORWARD);
}

else if (pd == 6)
{
ChangeAnimation("Event Actor", "player left shield - 1bp", FORWARD);
}
}

thx guyes, i am reallty stumped, this is a big code

PostPosted: Mon May 07, 2007 12:51 am
by Sgt. Sparky
I think you matched all the }'s and {'s
right,
but you do not need else if,
just use if. :D

Re: Code issue...

PostPosted: Mon May 07, 2007 12:52 am
by Sgt. Sparky
Oman wrote:ChangeAnimation("Event Actor", "player left swipe - 1bp", FORWARD)

AHA!
THERE IS THE ERROR!
:D
there is no ";" :D

PostPosted: Mon May 07, 2007 12:56 am
by Oman
yay THANK YOU!

A point for you my man

PostPosted: Mon May 07, 2007 1:00 am
by Oman
Why did it give me a problem on error line 25... that was line 24

PostPosted: Mon May 07, 2007 1:01 am
by Sgt. Sparky
Oman wrote:Why did it give me a problem on error line 25... that was line 24

does it still not accept it? :(
EDIT:
that is line 25,
if you are using your code above.(the first one you posted)

PostPosted: Tue May 08, 2007 12:31 am
by Oman
Yes it works.. i was just wondering about line 25.
Well thanks i got it to work, and you are correct it is line 25 after i make the changes. :D

PostPosted: Tue May 08, 2007 12:51 am
by Sgt. Sparky
:D
I'm glad it works! :)