PDA

View Full Version : Need help


dndperas
03/01/2016, 10:01 AM
i want to create a garage object and Open Auto
is there a CodE ?

Mister0
03/01/2016, 01:52 PM
You want to say a gate? with /opengate and the object moving and 'opene auto'

dndperas
04/01/2016, 08:58 AM
No, this this Garage http://imgur.com/4k6seDI
it's auto open/close see: http://imgur.com/TFpIzUo

dndperas
04/01/2016, 05:09 PM
Bumb?

Riddick94
04/01/2016, 05:17 PM
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?

dndperas
04/01/2016, 05:27 PM
Yess

Riddick94
04/01/2016, 05:33 PM
#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.

dndperas
04/01/2016, 05:38 PM
Thnx