Jump to content

Group Base


Recommended Posts

createObject -- create the object 
createColRectangle -- create a colshape 
addEventHandler -- event handler 
"onColShapeHit" -- event 
if getElementData then -- some checking 
moveObject -- move it a bit away 
setTimer -- add a timer 
moveObject -- move the gate back 

Link to comment
createObject -- create the object 
createColRectangle -- create a colshape 
addEventHandler -- event handler 
"onColShapeHit" -- event 
if getElementData then -- some checking 
moveObject -- move it a bit away 
setTimer -- add a timer 
moveObject -- move the gate back 

i am using marker

Thank you

Link to comment
markGroup = createMarker(test) 
groupobject = createObject = (test) 
  
addEventHandler("onMarkerHit", markGroup, 
function() 
if getElementData(hitElement,"Group") == "myGroupName" then -- i am get this from resource 
moveObject(groupobject,test) 
   end 
end 
) 

Is this true?

Link to comment
  
tabelPlayerGroup = {} 
  
markGroup = createMarker ( 1, 1, 1, "cylinder", 1.5, 0, 0, 0, 0 ) 
groupobject = createObject( 980, 1, 1, 1 ) 
  
addEventHandler("onMarkerHit", markGroup, 
function( hitElement ) 
if getElementData(hitElement,"Group") == "myGroupName" then -- i am get this from resource 
moveObject( groupobject, 1000, 1, 1, 3 ) 
   end 
end 
) 
  
addEventHandler("onMarkerLeave", markGroup, 
function( leftElement ) 
getGroupPlayer() 
for i,p in ipairs ( tabelPlayerGroup ) do 
if getElementData(leftElement,"Group") == "myGroupName" and not isElementWithinMarker(p,markGroup) then -- i am get this from resource 
moveObject( groupobject, 1000, 1, 1, 1 ) 
      end 
   end 
end 
) 
  
getGroupPlayer = function() 
for i,v in ipairs ( getElementsByType( "player" ) ) do 
if getElementData(v,"Group") == "myGroupName" then -- i am get this from resource 
table.insert(tabelPlayerGroup,v) 
      end 
   end 
end 

Did this work?

Link to comment
markGroup = createMarker ( 1, 1, 1, 'cylinder', 1.5, 0, 0, 0, 0 ) 
groupobject = createObject( 980, 1, 1, 1 ) 
  
addEventHandler ( 'onMarkerHit', markGroup, function( hitElement ) 
    if getElementData ( hitElement,'Group') == 'myGroupName' then -- i am get this from resource 
        moveObject( groupobject, 1000, 1, 1, 3 ) 
    end 
end ) 
  
addEventHandler ( 'onMarkerLeave', markGroup, function( leftElement ) 
    if getElementData ( leftElement,'Group') == 'myGroupName' then -- i am get this from resource 
        moveObject( groupobject, 1000, 1, 1, 1 ) 
    end 
end ) 

Link to comment
markGroup = createMarker ( 1, 1, 1, 'cylinder', 1.5, 0, 0, 0, 0 ) 
groupobject = createObject( 980, 1, 1, 1 ) 
  
addEventHandler ( 'onMarkerHit', markGroup, function( hitElement ) 
    if getElementData ( hitElement,'Group') == 'myGroupName' then -- i am get this from resource 
        moveObject( groupobject, 1000, 1, 1, 3 ) 
    end 
end ) 
  
addEventHandler ( 'onMarkerLeave', markGroup, function( leftElement ) 
    if getElementData ( leftElement,'Group') == 'myGroupName' then -- i am get this from resource 
        moveObject( groupobject, 1000, 1, 1, 1 ) 
    end 
end ) 

are you nop ?

why you delete my table ??

Link to comment

Will if you want your table :

tabelPlayerGroup = {} 
  
markGroup = createMarker ( 1, 1, 1, 'cylinder', 1.5, 0, 0, 0, 0 ) 
groupobject = createObject( 980, 1, 1, 1 ) 
  
addEventHandler ( 'onMarkerHit', markGroup, function ( hitElement ) 
    if getElementData ( hitElement, 'Group' ) == 'myGroupName' then -- i am get this from resource 
        moveObject ( groupobject, 1000, 1, 1, 3 ) 
    end 
end ) 
  
addEventHandler ( 'onMarkerLeave', markGroup, function ( leftElement ) 
    getGroupPlayer() 
    for i,p in ipairs ( tabelPlayerGroup ) do 
        if getElementData ( leftElement,'Group') == 'myGroupName' and not isElementWithinMarker ( p, markGroup ) then -- i am get this from resource 
            moveObject( groupobject, 1000, 1, 1, 1 ) 
        end 
    end 
end ) 
  
  
function getGroupPlayer ( ) 
    for i,v in ipairs ( getElementsByType( 'player' ) ) do 
        if getElementData ( v, 'Group' ) == 'myGroupName' then -- i am get this from resource 
            table.insert( tabelPlayerGroup, v ) 
        end 
    end 
end 

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