Jump to content
  • 0

Problema MoveObject


Gawitkkk

Question

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.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

[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

Link to comment
Share on other sites

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.