yom_buttons help....
#1

Hey, I use yom_buttons and i got some problem here...

I have 3 buttons on the server. 1 goes to left PD Gate, 1 goes to right PD Gate, 1 goes to Mechanic Gate.


pawn Код:
PDGate1 = CreateObject(4084, 618.210815, -596.516479, 17.976679, 0.0000, 0.0000, 0.0000); // Gate 1
PDGate2 = CreateObject(4084, 617.766663, -602.198669, 17.976679, 0.0000, 0.0000, 0.0000); // Gate 2
PDGate1Button = CreateButton(618.39, -594.62, 17.85, 90.0); // PDGate1 Open/Close button
PDGate2Button = CreateButton(618.39, -599.21, 17.85, 90.0); // PDGate2 Open/Close button
MechanicButton = CreateButton(795.01, -614.11, 16.96, 181.0); // MechanicHQ Button
MechanicGate = CreateObject(988, 797.593994, -614.515747, 15.850008, 0.0000, 0.0000, 0.1035); // OPEN MECHANIC GATE


pawn Код:
public OnPlayerPressButton(playerid, buttonid)
{
    if(buttonid == PDGate1Button)
    {
      if(PlayerInfo[playerid][pMember] != 1) return SendClientMessage(playerid,COLOR_GREY,"Invalid Card!");
        if(GateOpen == 0)
        {
          MoveObject(PDGate1,616.504761, -596.493103, 19.626654,5);
          SetObjectRot(PDGate1,0.0000, 286.9479, 0.0000);
          GateOpen = 1;
        }
        else if(GateOpen == 1)
        {
          MoveObject(PDGate1,618.210815, -596.516479, 17.976679,5);
          SetObjectRot(PDGate1,0.0000, 0.0000, 0.0000);
          GateOpen = 0;
        }
    }
    if(buttonid == PDGate2Button)
    {
      if(PlayerInfo[playerid][pMember] != 1) return SendClientMessage(playerid,COLOR_GREY,"Invalid Card!");
        if(GateOpen2 == 0)
        {
          MoveObject(PDGate2,616.140503, -602.101746, 19.951649,5);
          SetObjectRot(PDGate2,0.0000, 296.4017, 0.0000);
          GateOpen2 = 1;
        }
        else if(GateOpen2 == 1)
        {
          MoveObject(PDGate2,617.766663, -602.198669, 17.976679,5);
          SetObjectRot(PDGate2,0.0000, 0.0000, 0.0000);
          GateOpen2 = 0;
        }
    }
    if(buttonid == MechanicButton)
    {
      if(PlayerInfo[playerid][pMember] != 3) return SendClientMessage(playerid,COLOR_GREY,"Invalid Card!");
      if(GateOpen3 == 0)
      {
        MoveObject(MechanicGate,797.682434, -614.532898, 19.447336,3);
        GateOpen3 = 1;
        }
        if(GateOpen3 == 1)
      {
        MoveObject(MechanicGate,797.593994, -614.515747, 15.850008,3);
        GateOpen3 = 0;
        }
    }
    return 1;
}
the PD Gates works perfectly...

But the Mechanic gate wont open when i push the button...

Help please?

Thank you
Reply
#2

Anyone
Reply


Forum Jump:


Users browsing this thread: