[HELP] Opening a gate with kmb_keypad..?
#1

I need help i know how to make a gate to open with enter / f or commands /enter and other btw in some servers i saw kmb_keypad and when you go to kmbkeypad there is animation clicking on it and opening door... ? Can anyone help me give me code what to add im using LARP .. Thanks btw.


Reply
#2

anyone to help me? really i need this.
Reply
#3

I believe there's a "button" include wich allows you to create buttons using 'AddButton' (I believe) but I don't know where to find it, I'm sure you can find it somewhere, It's also included in some RP scripts
Reply
#4

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
I believe there's a "button" include wich allows you to create buttons using 'AddButton' (I believe) but I don't know where to find it, I'm sure you can find it somewhere, It's also included in some RP scripts
Which RP Scripts can you tell me one?
Reply
#5

There's a include called yom_buttons, but I don't think it's being shared anymore. However there's an example here on how to do it: https://sampforum.blast.hk/showthread.php?tid=231531 you could maybe learn from it.
Reply
#6

Quote:
Originally Posted by Prumpuz
Посмотреть сообщение
There's a include called yom_buttons, but I don't think it's being shared anymore. However there's an example here on how to do it: https://sampforum.blast.hk/showthread.php?tid=231531 you could maybe learn from it.
Thanks but why this two times with other ids?

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & 16 && IsPlayerInRangeOfPoint(playerid, 1, 1458.6327,643.8281,10.8203) && !IsPlayerInAnyVehicle(playerid))
    {
        if(gateopen == 1)
        {
            CloseGateOutside(playerid);
            }
            else {
            OpenGateOutside(playerid);
            }
        }
    if(newkeys & 16 && IsPlayerInRangeOfPoint(playerid, 1, 1469.0891,642.6558,10.8456) && !IsPlayerInAnyVehicle(playerid))
    {
        if(gateopen == 1)
        {
            CloseGateInside(playerid);
            }
            else {
            OpenGateInside(playerid);
            }
        }
    return 1;
}

stock CloseGateOutside(playerid)
{
    SetPlayerPos(playerid, 1458.6327,643.8281,10.8203); //1 Buton
    SetPlayerFacingAngle(playerid, 181.7816);
    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.1,0,1,1,0,0);
    MoveObject(gate, 1459.65173340, 643.68463135, 9.94531059, 2);
    gateopen = 0;
    return 1;
}

stock OpenGateOutside(playerid)
{
    SetPlayerPos(playerid, 1458.6327,643.8281,10.8203); 
    SetPlayerFacingAngle(playerid, 181.7816);
    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.1,0,1,1,0,0);
    MoveObject(gate, 1467.82653809, 643.69866943, 9.94531059, 2);
    gateopen = 1;
    return 1;
}

CloseGateInside(playerid)
{
    SetPlayerPos(playerid, 1469.0891,642.6558,10.8456);
    SetPlayerFacingAngle(playerid, 0.6966);
    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.1,0,1,1,0,0);
    MoveObject(gate, 1459.65173340, 643.68463135, 9.94531059, 2);
    gateopen = 0;
    return 1;
}

OpenGateInside(playerid)
{
    SetPlayerPos(playerid, 1469.0891,642.6558,10.8456); 
    SetPlayerFacingAngle(playerid, 0.6966);
    ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 4.1,0,1,1,0,0);
    MoveObject(gate, 1467.82653809, 643.69866943, 9.94531059, 2);
    gateo
Like this is for two doors or one? btw

First: MoveObject(gate, 1467.82653809, 643.69866943, 9.94531059, 2);
And: MoveObject(gate, 1459.65173340, 643.68463135, 9.94531059, 2);

This for the position where is keypad

1: SetPlayerPos(playerid, 1469.0891,642.6558,10.8456);
2: SetPlayerPos(playerid, 1458.6327,643.8281,10.8203);


Because i didnt saw on video 2 doors
And other thing can you help me and to add only faction pleader = 14 to can open that door.
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)