Posts: 21
Threads: 5
Joined: Jan 2015
i want to create a garage object and Open Auto
is there a CodE ?
Posts: 220
Threads: 28
Joined: Aug 2015
Reputation:
0
You want to say a gate? with /opengate and the object moving and 'opene auto'
Posts: 21
Threads: 5
Joined: Jan 2015
No, this this Garage
http://imgur.com/4k6seDI
it's auto open/close see:
http://imgur.com/TFpIzUo
Posts: 21
Threads: 5
Joined: Jan 2015
Posts: 1,767
Threads: 124
Joined: Mar 2010
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?
Posts: 21
Threads: 5
Joined: Jan 2015
Posts: 1,767
Threads: 124
Joined: Mar 2010
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.
Posts: 21
Threads: 5
Joined: Jan 2015