Jump to content

Question

Posted

Nick: Gawitkkk

Problema: MoveObject, porti miscatoare.

Erori / warnings: -

Lini/script: -

Ai incercat sa rezolvi singur ?: Da.

Salut tuturor, am incercat sa fac un moveobject (portile de la intrare/iesire) la Police Departament din LV, unde este LVPD insa tot primesc niste erori si nu stiu cum sa le fac. Mai o problema, nu stiu cum sa fac sa se deschida de pe h, cred ca stiti la ce ma refer.

6 answers to this question

Recommended Posts

Posted

Din acest tutorial, poarta se misca din comanda, insa eu vreau cand apas butonul h intr-o masina de dep, fiind membru dep.

  • Administrator
Posted

[pawn]#define PRESSED(%0) \

    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

//For more information about PRESSED: http://wiki.sa-mp.com/wiki/OnPlayerKeyStateChange

public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)

{

    switch(PRESSED)//Always use switch

    {

        case KEY_HANDBRAKE://(Hand Brake/aim)

        {

            if(IsPlayerInRangeOfPoint(playerid,10,xxx,yyy,zzz)//Gate 1

            {

                switch(Open{0})//Check whether the gate opened or closed

                {

                    case true://If the gate opened

                    {

                        MoveObject(Gate[0],Float:X,Float:Y,Float:Z,Float:Speed);//Close the gate

                        Open{0} == false;//false for closed

                    }

                    case false://If the gate closed

                    {

                        MoveObject(Gate[0],Float:X,Float:Y,Float:Z,Float:Speed);//Open the gate

                        Open{0} == true;//true for opened

                    }

                }

            }

            else if(IsPlayerInRangeOfPoint(playerid,10,xxx,yyy,zzz)//Gate 2

            {

                switch(Open{1})//Check whether the gate opened or closed

                {

                    case true://If the gate opened

                    {

                        MoveObject(Gate[1],Float:X,Float:Y,Float:Z,Float:Speed);//Close the gate

                        Open{1} == false;//false for closed

                    }

                    case false://If the gate closed

                    {

                        MoveObject(Gate[2],Float:X,Float:Y,Float:Z,Float:Speed);//Open the gate

                        Open{1} == true;//true for opened

                    }

                }

            }

            else if(IsPlayerInRangeOfPoint(playerid,10,xxx,yyy,zzz)//Gate 3

            {

                switch(Open{2})//Check whether the gate opened or closed

                {

                    case true://If the gate opened

                    {

                        MoveObject(Gate[3],Float:X,Float:Y,Float:Z,Float:Speed);//Close the gate

                        Open{2} == false;//false for closed

                    }

                    case false://If the gate closed

                    {

                        MoveObject(Gate[3],Float:X,Float:Y,Float:Z,Float:Speed);//Open the gate

                        Open{2} == true;//true for opened

                    }

                }

            }

        }

    }

    return 1;

}[/pawn]

Sursa: http://forum.sa-mp.com/showthread.php?t=278880

Posted

Am reusit!

WopsS esti un geniu, mersi frumos!

Ti-am acordat un +1 pentru efortul pe care l-ai depus pentru mine, stiu ca te-am cam stresat putin  :D.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.