Gate newkeys problem and other
#3

Hello!

Try this:
PHP код:
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
    if(
job[playerid] == POLICE)
    {
        if((
newkeys && !IsPlayerInAnyVehicle(playerid)) || (newkeys KEY_HANDBRAKE && IsPlayerInAnyVehicle(playerid)))
        {
            if(
IsPlayerInRangeOfPoint(playerid,3.0,-1641.1395,686.5178,7.1875))
            {
                if(
DOORMODE == false)
                {
                    
MoveDynamicObject(POLICIJOSDOORS[0],-1641.55225688.70326.181303.0);
                    
SendClientMessage(playerid,green,"Door is opening");
                    
DOORMODE true;
                }
                else if(
DOORMODE == true)
                {
                    
MoveDynamicObject(POLICEDOORS[0], -1641.55225687.223216.181303.0);
                    
SendClientMessage(playeridred"Doors are closing");
                    
DOORMODE false;
                }
            }
            else if(
IsPlayerInRangeOfPoint(playerid,10.0, -1641.1897,679.5863,7.1875))
            {
                if(
DOORMODE2 == false)
                {
                    
MoveDynamicObject(POLICEGATES[0], -1641.60791679.5272211.59653.0);
                    
SendClientMessage(playeridgreen"Gate is opening");
                    
DOORMODE2 true;
                }
                else if(
DOORMODE2 == true)
                {
                    
MoveDynamicObject(POLICEGATES[0], -1641.60791679.527227.672003.0);
                    
SendClientMessage(playeridred"Gate is closing");
                    
DOORMODE2 false;
                }
            }
        }
    }
    return 
1;

You must press the key one times. After that you must press it again to close the gate. Don't hold the key.
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)