Question
#1

Well, Today I made an keypad thing for my LSPD doors and I have a little problem. Always when I am pressing 'enter' anywhere is doing the animation which should do only on the door. How can I fix that ? Codes:

Код:
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 1288.8297,-1019.4271,1085.9760))
        if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Officer.");
        {
            if(pddoor5opened == false)
            {
                ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.0, 0, 0, 0, 0, 0);
                MoveDynamicObject(pddoor5, 1289.10, -1018.93, 1085.00, 0.50);
                pddoor5opened = true;
                return 1;
            }
            else
            {
                ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.0, 0, 0, 0, 0, 0);
                MoveDynamicObject(pddoor5, 1288.06, -1018.93, 1085.00, 0.50);
                pddoor5opened = false;
                return 1;
            }
        }
    }
    return 1;
}
Reply
#2

pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 1288.8297,-1019.4271,1085.9760))
        {
            if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Officer.");
            {
                if(pddoor5opened == false)
                {
                    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.0, 0, 0, 0, 0, 0);
                    MoveDynamicObject(pddoor5, 1289.10, -1018.93, 1085.00, 0.50);
                    pddoor5opened = true;
                    return 1;
                }
                else
                {
                    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.0, 0, 0, 0, 0, 0);
                    MoveDynamicObject(pddoor5, 1288.06, -1018.93, 1085.00, 0.50);
                    pddoor5opened = false;
                    return 1;
                }
            }
        }
    }
return 1;
}
Reply
#3

pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 1288.8297,-1019.4271,1085.9760))
        {
         if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Officer.");
         {
            if(pddoor5opened == false)
            {
                ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.0, 0, 0, 0, 0, 0);
                MoveDynamicObject(pddoor5, 1289.10, -1018.93, 1085.00, 0.50);
                pddoor5opened = true;
                return 1;
            }
            else
            {
                ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.0, 0, 0, 0, 0, 0);
                MoveDynamicObject(pddoor5, 1288.06, -1018.93, 1085.00, 0.50);
                pddoor5opened = false;
                return 1;
            }
         }
        }
    }
    return 1;
}
EDIT: ops im late
Reply
#4

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SECONDARY_ATTACK)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, 1288.8297,-1019.4271,1085.9760))
        {
            if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Officer.");
            if(pddoor5opened == false)
            {
                ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.0, 0, 0, 0, 0, 0);
                MoveDynamicObject(pddoor5, 1289.10, -1018.93, 1085.00, 0.50);
                pddoor5opened = true;
                return 1;
            }
            else
            {
                ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.0, 0, 0, 0, 0, 0);
                MoveDynamicObject(pddoor5, 1288.06, -1018.93, 1085.00, 0.50);
                pddoor5opened = false;
                return 1;
            }
        }
    }
    return 1;
}
Se ajudei da reputation
Reply
#5

Well, I tried all of them you gave me guys and I am getting lots of Errors from everywhere. The problem is still up.
Reply
#6

Fixed. Thank you.
Reply
#7

Maybe a good idea to provide your "errors" so we could have a chance to find out what you struggle with. Just saying.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)