Object won't move cos of if statement?
#3

Quote:
Originally Posted by Misiur
Посмотреть сообщение
pawn Код:
printf("range check");
This line completely changes your code flow, remove it or move it.

You need an else clause. Learn to use it

pawn Код:
if(dooropen == 0)
{
    printf("door open = %d", dooropen);
    MoveDynamicObject(chaindoor,321.45309, 310.08768, 998.14099,1.0,0,0,-90);
    printf("objectid = %d", chaindoor);
    printf("object moved");
    dooropen = 1;
    printf("door open = %d", dooropen);
} else {
    printf("door open = %d", dooropen);
    MoveDynamicObject(chaindoor,321.45309, 310.08768, 998.14099,1.0,0,0,360);
    dooropen = 0;
}
https://sampwiki.blast.hk/wiki/Control_Structures#else
Much appreciated, however, I AM learning, that's why I asked.
Reply


Messages In This Thread
Object won't move cos of if statement? - by Dokins - 11.08.2013, 12:27
Re: Object won't move cos of if statement? - by Misiur - 11.08.2013, 12:31
Re: Object won't move cos of if statement? - by Dokins - 11.08.2013, 12:36

Forum Jump:


Users browsing this thread: 2 Guest(s)