Jump to content

Problem with gates:


montenegro11

Recommended Posts

I'm very new with scripting, and yesterday SolidSnake helped me with scripting gates, now I want to add some more gates, but I don't know how, I mean I know, I added everything, no errors, nothing. But the gates don't appear there. Here's the script, if somebody sees the problem, please say so:

gs1 = createObject ( 975, 25522.8999023438, -1722.1999511719, 13.39999961853, 0, 0, 179.74182128906 ) 
function gateOpen ( ) 
    moveObject ( gs1, 2515.3999023438, -1722.1999511719, 13.39999961853 ) 
end 
addCommandHandler ( "gss", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gs1, 25522.8999023438, -1722.1999511719, 13.39999961853 ) 
end 
addCommandHandler ( "gsd", gateClose ) 

Link to comment
gs1 = createObject ( 975, 25522.8999023438, -1722.1999511719, 13.39999961853, 0, 0, 179.74182128906 ) 
function gateOpen ( ) 
    moveObject ( gs1, 5000, 2515.3999023438, -1722.1999511719, 13.39999961853 ) 
end 
addCommandHandler ( "gss", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gs1, 5000, 25522.8999023438, -1722.1999511719, 13.39999961853 ) 
end 
addCommandHandler ( "gsd", gateClose ) 

Made it five seconds. Good now? Don't have time to test it, so.. can you just see it if I've done it good?

Link to comment

Well, checked it out, I don't know exactly where the gates are, umm. Can you check where are the gates? I probably messed up with the Coordinates again. I'll tell you them, and if you can, adjust my script please.

x:25522.8999023438

y:-1722.199951719

z:13.39999961859

Rotation:

x: 0

y: 0

z: 179.74182128906

And here's the picture where its SUPPOSED to be:

http://i.imgur.com/x5TuRHN.jpg

Link to comment

You added a extra "5".

gs1 = createObject ( 975, 2522.8999023438, -1722.1999511719, 13.39999961853, 0, 0, 179.74182128906 ) 
function gateOpen ( ) 
    moveObject ( gs1, 5000, 2515.3999023438, -1722.1999511719, 13.39999961853 ) 
end 
addCommandHandler ( "gss", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gs1, 5000, 2522.8999023438, -1722.1999511719, 13.39999961853 ) 
end 
addCommandHandler ( "gsd", gateClose ) 

Link to comment
You added a extra "5".
gs1 = createObject ( 975, 2522.8999023438, -1722.1999511719, 13.39999961853, 0, 0, 179.74182128906 ) 
function gateOpen ( ) 
    moveObject ( gs1, 5000, 2515.3999023438, -1722.1999511719, 13.39999961853 ) 
end 
addCommandHandler ( "gss", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gs1, 5000, 2522.8999023438, -1722.1999511719, 13.39999961853 ) 
end 
addCommandHandler ( "gsd", gateClose ) 

You've fixed it?

Link to comment

Three gates with this script

gs2 = createObject ( 976, 2540.69995917719, -1707.8000488281, 11.5, 0, 0, 270 ) 
function gateOpen ( ) 
    moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 9.1999998092651 ) 
end 
addCommandHandler ( "cjo", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 11.5 ) 
end 
addCommandHandler ( "cjc", gateClose ) 

I think that I've learnt this. If you could explain how to put all three gates in one script? I know "theoretically" but I'm not so sure that it will work.

Let me explain a little:

I make those functions and other part, and then I just add down commands and objects. Is it good as that or?

Link to comment
Three gates with this script
gs2 = createObject ( 976, 2540.69995917719, -1707.8000488281, 11.5, 0, 0, 270 ) 
function gateOpen ( ) 
    moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 9.1999998092651 ) 
end 
addCommandHandler ( "cjo", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 11.5 ) 
end 
addCommandHandler ( "cjc", gateClose ) 

I think that I've learnt this. If you could explain how to put all three gates in one script? I know "theoretically" but I'm not so sure that it will work.

Let me explain a little:

I make those functions and other part, and then I just add down commands and objects. Is it good as that or?

I think that it's not good,use "addEventHandler" or "BindKey".Just command it's old junk.

my opinion

Link to comment

Look man, my server will never be an PUBLIC SERVER and even if I make one, it will probably be with onMarkerHit and onMarkerLeave and this is the server where I'll soon implement zombie mod that a friend of mine made, and he will teach me how to make zones repellant of zombies, that's what gates are for. I don't want to make a roleplay server, this is a server where four of mine friends come and have fun in editor mode. And yeah, does anybody know why editor glitches resources? I start up gate gategs1 and gategs2 and editor as the last, and all of those resources need to be restarted. And also "automatic" startup "glitches" them aswell mta.config file "doesn't" run them. it runs them but THEY'RE NOT THERE. Like it loads a gate. and it's not there.

Link to comment
Three gates with this script
gs2 = createObject ( 976, 2540.69995917719, -1707.8000488281, 11.5, 0, 0, 270 ) 
function gateOpen ( ) 
    moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 9.1999998092651 ) 
end 
addCommandHandler ( "cjo", gateOpen ) 
  
function gateClose ( ) 
    moveObject ( gs2, 3000, 2540.69995917719, -1707.8000488281, 11.5 ) 
end 
addCommandHandler ( "cjc", gateClose ) 

I think that I've learnt this. If you could explain how to put all three gates in one script? I know "theoretically" but I'm not so sure that it will work.

Let me explain a little:

I make those functions and other part, and then I just add down commands and objects. Is it good as that or?

I think that it's not good,use "addEventHandler" or "BindKey".Just command it's old junk.

my opinion

And yeah, command can be an old junk, because I don't know how to make an invisible marker in where I can do that command, so if I'm in LV I can still open the gate in Los Santos, well, STILL ITS NOT PUBLIC so I don't even pay attention on that, I open the gates when I need to.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...