Can somebody Please help me with this Lil Script :) thanks
#1

hey Guys so i just made some Gates and some walls Around a Private Drift area in Mta Map editor
And I Put it in my gamemode I can now see the gates in My Private server

I Jotted down the Gates Locations when closed and there ids

Left Gate
Id 985
Location When closed : 2562.950195, 1824.456299, 11.530980, 0.0000, 0.0000, 88.6257

Right Gate
Id 986
Location When Closed: 2562.637695, 1816.374512, 11.530980, 0.0000, 0.0000, 88.4181

Whats needed?
Both Gates open When "/open1" is typed.
Both Gates Close when "/close1" is typed.

I have no Idea How to do this? I would Appriciate it if someone On xfire could add me? (mcferson123)
Or windows live messenger (magot_12@hotmail.co.uk)

Or a comment would do
Thanks Guys i really need this script
Reply
#2

Quote:
Originally Posted by Lipsmoker101
hey Guys so i just made some Gates and some walls Around a Private Drift area in Mta Map editor
And I Put it in my gamemode I can now see the gates in My Private server

I Jotted down the Gates Locations when closed and there ids

Left Gate
Id 985
Location When closed : 2562.950195, 1824.456299, 11.530980, 0.0000, 0.0000, 88.6257

Right Gate
Id 986
Location When Closed: 2562.637695, 1816.374512, 11.530980, 0.0000, 0.0000, 88.4181

Whats needed?
Both Gates open When "/open1" is typed.
Both Gates Close when "/close1" is typed.

I have no Idea How to do this? I would Appriciate it if someone On xfire could add me? (mcferson123)
Or windows live messenger (magot_12@hotmail.co.uk)

Or a comment would do
Thanks Guys i really need this script
Well you need open an close gate cords.. Not just closed.
Reply
#3


[/quote]

Well you need open an close gate cords.. Not just closed.
[/quote]


Soo? How do i do that lol
move the gates To closed position then what? If i save it ill lose were they was originally, if i move them back i wont get exactally the same place and therefor itll glitch out
Reply
#4

Quote:
Originally Posted by Lipsmoker101
Well you need open an close gate cords.. Not just closed.
[/quote]


Soo? How do i do that lol
move the gates To closed position then what? If i save it ill lose were they was originally, if i move them back i wont get exactally the same place and therefor itll glitch out

[/quote]

Lol its easy, u put the gate in closed pos, you take the cords, then you put it on open pos, you take the cords and thats it. (Remember to take rotation cords too.)
Reply
#5

Quote:
Originally Posted by Fedee!
Quote:
Originally Posted by Lipsmoker101
Well you need open an close gate cords.. Not just closed.
Soo? How do i do that lol
move the gates To closed position then what? If i save it ill lose were they was originally, if i move them back i wont get exactally the same place and therefor itll glitch out


[/quote]

Lol its easy, u put the gate in closed pos, you take the cords, then you put it on open pos, you take the cords and thats it. (Remember to take rotation cords too.)
[/quote]


Rigght? i take the cords?
How do i take them
The only way i know how to take them is by saving it as .map and then using the online converter
Reply
#6

Just double-click on the objetc, a windows comes with X Y Z cords.
Reply
#7

Quote:
Originally Posted by Fedee!
Just double-click on the objetc, a windows comes with X Y Z cords.
Left Gate
Id 985
Location When closed : 2562.950195, 1824.456299, 11.530980, 0.0000, 0.0000, 88.6257
Location When Open : 2563.149414, 1832.431519, 11.530980, 1.546811,0.000000,0.000000


Right Gate
Id 986
Location When Closed: 2562.637695, 1816.374512, 11.530980, 0.0000, 0.0000, 88.4181
location When open : 2562,612793, 1808,196655, 11.530980, -4.739999,0.000000,0.000000

hows that look?
were from here
Reply
#8

Now do this:

On top of script:
Quote:
new Gate1;
new Gate2;
forward CloseGate1();
forward CloseGate2();

OnGameModeInit:
Quote:
public OnGameModeInit()
{
Gate1 = CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ); //Change this
Gate2 = CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ); //Change this
return 1;
}

OnPlayerCommandText:
Quote:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/opengate1", true) == 0)
{
new string[50];
MoveObject(Gate1,objectid, Float:X, Float:Y, Float:Z, Float:Speed); // Change this.
SetTimer("CloseGate1", 5000, false); // 5000 = 5 secs
format(string, sizeof(string), "Gate open, will close in 5 seconds.", 500);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
if(strcmp(cmdtext, "/opengate2", true) == 0)
{
new string[50];
MoveObject(Gate2,objectid, Float:X, Float:Y, Float:Z, Float:Speed); // Change this.
SetTimer("CloseGate2", 5000, false); // 5000 = 5 secs
format(string, sizeof(string), "Gate open, will close in 5 seconds.", 500);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
return 0;
}

Somewhere in your script:
Quote:
public CloseGate1()
{
MoveObject(Gate1,Float:X, Float:Y, Float:Z, Float:Speed); // Change this.
return 1;
}

public CloseGate2()
{
MoveObject(Gate2,Float:X, Float:Y, Float:Z, Float:Speed); // Change this.
return 1;
}

Reply
#9

Quote:
Originally Posted by Fedee!
Now do this:

On top of script:
Quote:
new Gate1;
new Gate2;
forward CloseGate1();
forward CloseGate2();

OnGameModeInit:
Quote:
public OnGameModeInit()
{
Gate1 = CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ); //Change this
Gate2 = CreateObject(modelid, Float:X, Float:Y, Float:Z, Float:rX, Float:rY, Float:rZ); //Change this
return 1;
}

OnPlayerCommandText:
Quote:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/opengate1", true) == 0)
{
new string[50];
MoveObject(Gate1,objectid, Float:X, Float:Y, Float:Z, Float:Speed); // Change this.
SetTimer("CloseGate1", 5000, false); // 5000 = 5 secs
format(string, sizeof(string), "Gate open, will close in 5 seconds.", 500);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
if(strcmp(cmdtext, "/opengate2", true) == 0)
{
new string[50];
MoveObject(Gate2,objectid, Float:X, Float:Y, Float:Z, Float:Speed); // Change this.
SetTimer("CloseGate2", 5000, false); // 5000 = 5 secs
format(string, sizeof(string), "Gate open, will close in 5 seconds.", 500);
SendClientMessage(playerid, 0xFF000000, string);
return 1;
}
return 0;
}

Somewhere in your script:
Quote:
public CloseGate1()
{
MoveObject(Gate1,Float:X, Float:Y, Float:Z, Float:Speed); // Change this.
return 1;
}

public CloseGate2()
{
MoveObject(Gate2,Float:X, Float:Y, Float:Z, Float:Speed); // Change this.
return 1;
}

Thanks alot for all your help
A freind Helped me with some of it over teamviewer he had to run to school
could you help me?

xfire (mcferson123)
windows live (magot_12@hotmail.co.uk)

thanks alot
im upto the final part but confused
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)