Gate making
#1

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?
Reply
#2

Should this gate open on command? Or another callback?
Reply
#3

Ya like /open command
Reply
#4

Код:
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;
}
Reply
#5

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.
Reply
#6

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?
Reply
#7

bump
Reply
#8

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)