Jump to content

Script Problem!


MiniGoveya

Recommended Posts

Hello, im making this script but i dont know how to make the open door function and i too think that the mostly part of this script is wrong, then, my question is, can u help me saying the wrong things and tell me how can i make the open door function?.

local progress = 0; 
  
door = createObject(1497, 2476.6862792969,-1657.423828125, 12.327535629272, 0, 0) 
  
function markers() 
    marker1 = createMarker( 2485.6589355469, -1682.5872802734, 13.686952590942, 'corona', 5.0, 255, 0, 0, 0 ) 
    marker2 = createMarker( 2493.4475097656, -1675.3487548828, 13.686952590942, 'corona', 5.0, 255, 0, 0, 0 ) 
    marker3 = createMarker( 2493.1372070313, -1665.1042480469, 13.686952590942, 'corona', 5.0, 255, 0, 0, 0 ) 
    marker4 = createMarker( 2492.8647460938, -1656.109375, 13.686952590942, 'corona', 5.0, 255, 0, 0, 0 ) 
end 
  
function marker1() 
if(marker1 == 0) then 
if(progress == 0) then 
   progress = 1 
else 
   progress = 0 
end 
end 
end 
addEventHandler ( "onResourceStart", getRootElement(), marker1 ) 
  
function marker2 () 
if(marker2 == 0) then 
if(progress == 1) then 
   progress = 2 
else 
   progress = 0 
end 
end 
end 
addEventHandler( "onResourceStart", getRootElement(), marker2 ) 
  
function marker3() 
if(marker3 == 0) then 
if(progress == 2) then 
   progress = 3 
else 
   progress = 0 
end 
end 
end 
addEventHandler( "onResourceStart", getRootElement(), marker3 ) 
  
function marker4() 
if(marker4 == 0) then 
if(progress == 3) then 
   progress = 0 
   open door 
else 
   progress = 0 
end 
end 
end 
addEventHandler( "onResourceStart", getRootElement(), marker4 ) 

Putting the same script on MTA Script Editor the following lines are wrong:

-49

-50

-52

-53

-54

Ty for advance.

Link to comment

How about not repeating the same bad code over and over again? Get one marker working, then the others.

But basically, read the wiki, your code makes no sense at all. "if(marker1 == 0) then" means nothing - an element is never going to be 0. Why do you expect 'open door' to work?

Link to comment
function openCarDoors() 
local createVeh = createVehicle(411, 1000, 1000, 1000) -- just thrown random coordinates 
--- 
setVehicleDoorState(createVeh, 2, 1) -- opens front left door 
--- 
end 
addEventHandler ("onResourceStart", getResourceRootElement(), openCarDoors) 

Not tested.

Link to comment
function openCarDoors() 
local createVeh = createVehicle(411, 1000, 1000, 1000) -- just thrown random coordinates 
--- 
setVehicleDoorState(createVeh, 2, 1) -- opens front left door 
--- 
end 
addEventHandler ("onResourceStart", getResourceRootElement(), openCarDoors) 

Not tested.

lol, you really got him wrong.. i don't get how you can understand something like this when he actually wants to move a object o_O

Link to comment
function openCarDoors() 
local createVeh = createVehicle(411, 1000, 1000, 1000) -- just thrown random coordinates 
--- 
setVehicleDoorState(createVeh, 2, 1) -- opens front left door 
--- 
end 
addEventHandler ("onResourceStart", getResourceRootElement(), openCarDoors) 

Not tested.

lol, you really got him wrong.. i don't get how you can understand something like this when he actually wants to move a object o_O

I thought by "opening doors" I instantly thought it's a vehicle.My bad then. :?

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...