Jump to content

[Video Tut]Gates


xXMADEXx

Recommended Posts

I really wouldnt call it a good tutorial since firstly, u use a text editor to say things, which is good but u should use a mic or write a bit faster and second why the heck do u have your windows sound enabled?, the car u are sitting in makes much noise, your skype and everything :)

Taht was just some suggestions.

Link to comment
  • 2 weeks later...

is there anyway to change this bit to the players team?:

local data = getElementData(player,"job")  
    if (data=="Admin") 

(Full script):

object = createObject(2933, 2582.1000976563, -2123.6000976563, 1.3999999761581)  
marker = createMarker(2581.8000488281, -2123, -0.5, "cylinder", 2, 100, 0, 0, 100) 
function gateo(player) 
    local data = getElementData(player,"job")  
    if (data=="Admin") then  
    moveObject(object, 2000, 2582.1000976563, -2123.6000976563, -5) 
end 
addEventHandler("onMarkerHit", gateo) 
function gatec(player) -- makes a function to close the gate 
    moveObject(object,2933, 2582.1000976563, -2123.6000976563, 1.3999999761581) 
end 
addEventHandler("onMarkerLeave", gatec) 
end 

Link to comment
object = createObject(2933, 2582.1000976563, -2123.6000976563, 1.3999999761581) 
marker = createMarker(2581.8000488281, -2123, -0.5, "cylinder", 2, 100, 0, 0, 100) 
  
function gateo ( player ) 
    local team = getPlayerTeam ( player ) 
    local teamName = ( team and getTeamName ( team ) or "" ) 
    if ( teamName == "Admin" ) then 
        moveObject ( object, 2000, 2582.1000976563, -2123.6000976563, -5 ) 
    end 
end 
addEventHandler ( "onMarkerHit", root, gateo ) 
  
function gatec ( player ) 
    moveObject ( object, 2933, 2582.1000976563, -2123.6000976563, 1.3999999761581 ) 
end 
addEventHandler ( "onMarkerLeave", root, gatec ) 

Link to comment
  • 3 years later...
Thank you, people :)

:fp: now I know why when I was an idiot scripter this script haven't worked :fp:

Reason:

addEventHandler("onMarkerHit", gateo) 

Example from Wiki: (https://wiki.multitheftauto.com/wiki/OnMarkerHit)

local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) -- create myMarker 
  
function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler 
    local elementType = getElementType( hitElement ) -- get the hit element's type 
    outputChatBox( elementType.." inside myMarker", getRootElement(), 255, 255, 0 ) -- attach the element's type with the text, and output it 
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- attach onMarkerHit event to MarkerHit function 

he forgot to write the marker before the function :fp:

xXMADEXx's script haven't worked with me

cauz there is no specific marker to hit or to leave in the addEventHandler

Link to comment
  • Recently Browsing   0 members

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