SA-MP Forums Archive
Need help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help (/showthread.php?tid=597659)



Need help - dndperas - 03.01.2016

i want to create a garage object and Open Auto
is there a CodE ?


Re: Need help - Mister0 - 03.01.2016

You want to say a gate? with /opengate and the object moving and 'opene auto'


Re: Need help - dndperas - 04.01.2016

No, this this Garage http://imgur.com/4k6seDI
it's auto open/close see: http://imgur.com/TFpIzUo


Re: Need help - dndperas - 04.01.2016

Bumb?


Re: Need help - Riddick94 - 04.01.2016

You want to have your custom garage, where you will get close to it and it's going to open automatically when you are near it?


Re: Need help - dndperas - 04.01.2016

Yess


Re: Need help - Riddick94 - 04.01.2016

pawn Код:
#include    <a_samp>

new GarageDoor;

public OnGameModeInit()
{
    GarageDoor = CreateObject(...); // Check for function parameters on SA-MP's Wiki.
    return 1;
}

public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, ...))
    {
        // OPEN.
        MoveObject(GarageDoor, ...);
    }
   
    else
    {
        // CLOSE.
        MoveObject(GarageDoor, ...);
    }
    return 1;
}
This is the most I can give you. Check function(s) parameters at SA-MP's Wiki page. When you create object make sure you have your object created in CLOSED garage door position, and YOU MUST HAVE garage door OPENED position as well, because you gonna need it for MoveObject in // OPEN. section in the code.

That's all you really need, if you want to open garage nicely, then you have to do RotX, RotY, RotZ with X, Y, Z. All those parameters are explained at SA-MP's Wiki. Give it some time, play around with it, try it.. got error? ****** it, try again.. Stuck for hours? Come back and ask. Not after 5 minutes.


Re: Need help - dndperas - 04.01.2016

Thnx