Jump to content

help with marker and getElementData


Adde

Recommended Posts

Hello, in castillo´s script gang_system is the scoreboard column "Group" and then the name of the gang you are in. But how to continue this script so only players in example gang Glory can do this function below? please help.

And btw, how do I set interior and dimension when I use createmarker? Or atleast dimension.

marker1 = createMarker (-2639.30, 1406.47, 906.46,"cylinder",1.5,0,200,0,0) 
marker2 = createMarker (-2636.77, 1402.80, 906.46,"cylinder",1.5,0,200,0,0) 
  
function gangEntrence () 
account = getPlayerAccount(source) 
if is getElementData( "Glory") then 
setElementPosition(-2636.77, 1402.80, 906.46) 
end 
addEventHandler("onMarkerHit", marker1, gangEntrence) 
  
function gangExit () 
setElementPosition(-2639.30, 1406.47, 906.46) 
end 
addEventHandler("onMarkerHit", marker2, gangExit) 

Link to comment

If you have the latest version of my resource, then you can use the function getPlayerGang exported fro mit.

Then you can check like this on your script:

marker1 = createMarker (-2639.30, 1406.47, 906.46,"cylinder",1.5,0,200,0,0) 
marker2 = createMarker (-2636.77, 1402.80, 906.46,"cylinder",1.5,0,200,0,0) 
  
function gangEntrence ( hitElement ) 
    if ( getElementType ( hitElement ) == "player" ) then 
        if ( exports [ "gang_system" ]:getPlayerGang ( hitElement ) == "Glory" ) then 
            setElementPosition ( hitElement, -2636.77, 1402.80, 906.46 ) 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", marker1, gangEntrence ) 
  
function gangExit ( hitElement ) 
    if ( getElementType ( hitElement ) == "player" ) then 
        if ( exports [ "gang_system" ]:getPlayerGang ( hitElement ) == "Glory" ) then 
            setElementPosition ( hitElement, -2639.30, 1406.47, 906.46 ) 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", marker2, gangExit ) 

Link to comment
If you have the latest version of my resource, then you can use the function getPlayerGang exported fro mit.

Then you can check like this on your script:

marker1 = createMarker (-2639.30, 1406.47, 906.46,"cylinder",1.5,0,200,0,0) 
marker2 = createMarker (-2636.77, 1402.80, 906.46,"cylinder",1.5,0,200,0,0) 
  
function gangEntrence ( hitElement ) 
    if ( getElementType ( hitElement ) == "player" ) then 
        if ( exports [ "gang_system" ]:getPlayerGang ( hitElement ) == "Glory" ) then 
            setElementPosition ( hitElement, -2636.77, 1402.80, 906.46 ) 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", marker1, gangEntrence ) 
  
function gangExit ( hitElement ) 
    if ( getElementType ( hitElement ) == "player" ) then 
        if ( exports [ "gang_system" ]:getPlayerGang ( hitElement ) == "Glory" ) then 
            setElementPosition ( hitElement, -2639.30, 1406.47, 906.46 ) 
        end 
    end 
end 
addEventHandler ( "onMarkerHit", marker2, gangExit ) 

Yes I have the latest, I will test :)

Hmm, the markers wont show :o

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