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

Basically, if I remove the if(dooropen == 0)

the object moves like it's supposed to, but I need the if statements to allow it to be used in the manner I need it.


dooropen is a global variable
chaindoor is the object under ongamemodeinit
pawn Код:
CMD:door(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    printf("door open = %d", dooropen);
    if(IsPlayerInRangeOfPoint(playerid,3.0,321.45309, 310.08768, 998.14099))
    printf("range check");
    {
        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);
        }
        if(dooropen == 1)
        {
            printf("door open = %d", dooropen);
            MoveDynamicObject(chaindoor,321.45309, 310.08768, 998.14099,1.0,0,0,360);
            dooropen = 0;
        }
    }
    return 1;
}
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)