Gate newkeys problem and other
#9

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I forgot about that streamer function Vince mentioned so no need of variables to check if the objects are moving.

pawn Код:
if (!IsDynamicObjectMoving(POLICEGATE[0]))
{
    if (!DOORMODE) // DOORMODE is false
    {
        ...
    }
    else // DOORMODE is true
    {
        ...
    }
}
By the way you move POLICEGATE[0] in all four cases, the last two wouldn't be the other object stored in POLICEGATE[1]?
Okay, door is not spamming anymore, works like it should work, thanks to you! But,
second doors are not opening anymore i get no text that it opens and closes and they're not moving anymore.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(job[playerid] == POLICE)
        {
        if((newkeys & 8 && !IsPlayerInAnyVehicle(playerid)) || (newkeys & KEY_HANDBRAKE && IsPlayerInAnyVehicle(playerid)))
            {
                if(IsPlayerInRangeOfPoint(playerid, 3.0, -1641.1395,686.5178,7.1875))
                {
                    if (!IsDynamicObjectMoving(POLICEGATE[0]))
                    {
                        if (!GATEMODE) // DOORMODE is false
                        {
                            MoveDynamicObject(POLICEGATE[0], -1641.55225, 688.7032, 6.18130, 3.0);
                            SendClientMessage(playerid, zalia, "Gate is opening");
                            VARTUMODE = true;
                        }
                        else // DOORMODE is true
                        {
                            MoveDynamicObject(POLICEGATE[0], -1641.55225, 687.22321, 6.18130, 3.0);
                            SendClientMessage(playerid, raudona, "Gate is closing");
                            GATEMODE = false;
                        }
                    }
                    else if(IsPlayerInRangeOfPoint(playerid, 4.0, -1641.1897,679.5863,7.1875))
                    {
                        if (!IsDynamicObjectMoving(POLICEGATE[1]))
                        {
                        if(!VARTUMODE2) // DOORMODE is false
                        {
                            MoveDynamicObject(POLICEGATE[1], -1641.60791, 679.52722, 11.5965, 3.0);
                            SendClientMessage(playerid, zalia, "Gate is opening");
                            GATEMODE2 = true;
                        }
                        else // DOORMODE is true
                        {
                            MoveDynamicObject(POLICEGATE[1], -1641.60791, 679.52722, 7.67200, 3.0);
                            SendClientMessage(playerid, raudona, "Gate is closing");
                            GATEMODE2 = false;
                        }
                     }
                }
            }
        }
    }
        return 1;
}
Reply


Messages In This Thread
Gate newkeys problem and other - by Spookis - 02.07.2016, 09:07
Re: Gate newkeys problem and other - by Spookis - 02.07.2016, 10:33
Re: Gate newkeys problem and other - by Mencent - 02.07.2016, 11:03
Re: Gate newkeys problem and other - by Spookis - 02.07.2016, 11:47
Re: Gate newkeys problem and other - by Konstantinos - 02.07.2016, 12:01
Re: Gate newkeys problem and other - by Vince - 02.07.2016, 12:06
Re: Gate newkeys problem and other - by Spookis - 02.07.2016, 12:23
Re: Gate newkeys problem and other - by Konstantinos - 02.07.2016, 12:32
Re: Gate newkeys problem and other - by Spookis - 02.07.2016, 13:32
Re: Gate newkeys problem and other - by Spookis - 02.07.2016, 16:48

Forum Jump:


Users browsing this thread: 1 Guest(s)