SA-MP Forums Archive
Gate making - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Gate making (/showthread.php?tid=99109)



Gate making - MarcusX - 25.09.2009

I really need help on this, it'd be really nice if someone could help out or something.

I wanna make this the close one CreateObject(980, 1281.016357, -2055.733398, 60.624096, 0.0000, 0.0000, 268.0402);
and this one the open one CreateObject(980, 1281.014893, -2055.825928, 54.935707, 0.0000, 0.0000, 268.0402);

What do I need to do?


Re: Gate making - Desert - 25.09.2009

Should this gate open on command? Or another callback?


Re: Gate making - MarcusX - 25.09.2009

Ya like /open command


Re: Gate making - Desert - 25.09.2009

Код:
new gate;//this will be used later to be defined to the gate's id

public OnGameModeInit()
{
	gate = CreateObject(980, 1281.016357, -2055.733398, 60.624096, 0.0000, 0.0000, 268.0402);//defines and creates the gate
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/open", cmdtext, true, 5) == 0)
	{
		MoveObject(gate,1281.014893, -2055.825928, 54.935707,2.0);//Moves it away to open it
		SendClientMessage(playerid,0xFFFFFF,"Gate has been opened");
		return 1;
	}
	if (strcmp("/close",cmdtext,true,6) == 0)
	{
		MoveObject(gate,1281.016357, -2055.733398, 60.624096,2.0);//Moves it to its original possition
		SendClientMessage(playerid,0xFFFFFF,"Gate has been closed");
		return 1;
		}
	return 0;
}



Re: Gate making - MarcusX - 25.09.2009

Quote:
Originally Posted by Desert
Код:
new gate;//this will be used later to be defined to the gate's id

public OnGameModeInit()
{
	gate = CreateObject(980, 1281.016357, -2055.733398, 60.624096, 0.0000, 0.0000, 268.0402);//defines and creates the gate
	return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/open", cmdtext, true, 5) == 0)
	{
		MoveObject(gate,1281.014893, -2055.825928, 54.935707,2.0);//Moves it away to open it
		SendClientMessage(playerid,0xFFFFFF,"Gate has been opened");
		return 1;
	}
	if (strcmp("/close",cmdtext,true,6) == 0)
	{
		MoveObject(gate,1281.016357, -2055.733398, 60.624096,2.0);//Moves it to its original possition
		SendClientMessage(playerid,0xFFFFFF,"Gate has been closed");
		return 1;
		}
	return 0;
}
THANKKKK YOU Ily.


Re: Gate making - MarcusX - 26.09.2009

How would I do it with these

open:CreateObject(980, 2464.744873, -2261.610596, 26.835892, 0.0000, 0.0000, 46.4096);
Close:CreateObject(980, 2464.705078, -2261.675293, 21.385910, 0.0000, 0.0000, 46.4096);

open:CreateObject(980, 2383.727539, -2399.666016, 15.153675, 0.0000, 0.0000, 40.3935);
close:CreateObject(980, 2383.808838, -2399.537109, 9.457022, 0.0000, 0.0000, 40.3935);

All in my script o-o?


Re: Gate making - MarcusX - 26.09.2009

bump


Re: Gate making - Abernethy - 26.09.2009

Don't triple post.
The code is there, convert it yourself or ask in the Script Request thread.


Re: Gate making - Peter_Corneile - 26.09.2009

You dont need to make 2 gates like open and close .. One gate is enough and the coords for the place where it will move to .. Nothing else is required