New programmer Posted May 3, 2013 Share Posted May 3, 2013 Hi How Can i Make Group Base By resource ( Group System (groupsystem) ) https://community.multitheftauto.com/ind ... ls&id=6911 Link to comment
PaiN^ Posted May 3, 2013 Share Posted May 3, 2013 You need to create a map, It dosn't come with the group system . Link to comment
New programmer Posted May 3, 2013 Author Share Posted May 3, 2013 I am creating map i need to gate open to the group Link to comment
iPrestege Posted May 3, 2013 Share Posted May 3, 2013 I Think there's a data use : getElementData Link to comment
New programmer Posted May 3, 2013 Author Share Posted May 3, 2013 thanks i am testing Link to comment
Baseplate Posted May 3, 2013 Share Posted May 3, 2013 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
New programmer Posted May 3, 2013 Author Share Posted May 3, 2013 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
New programmer Posted May 3, 2013 Author Share Posted May 3, 2013 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
Baseplate Posted May 3, 2013 Share Posted May 3, 2013 You should move the object back by adding a timer and using moveObject again and change the arguements. Link to comment
New programmer Posted May 3, 2013 Author Share Posted May 3, 2013 (edited) You should move the object back by adding a timer and using moveObject again and change the arguements. no i am using event "onMarkerLeave" is my code true ? Edited May 3, 2013 by Guest Link to comment
iPrestege Posted May 3, 2013 Share Posted May 3, 2013 The arguments make no sense read the wiki again . Link to comment
Baseplate Posted May 3, 2013 Share Posted May 3, 2013 He wrote "test" means he'll change them, think already and use your brain. Link to comment
New programmer Posted May 3, 2013 Author Share Posted May 3, 2013 The arguments make no sense read the wiki again . This is just an example Link to comment
New programmer Posted May 3, 2013 Author Share Posted May 3, 2013 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
PaiN^ Posted May 3, 2013 Share Posted May 3, 2013 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
New programmer Posted May 3, 2013 Author Share Posted May 3, 2013 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
PaiN^ Posted May 3, 2013 Share Posted May 3, 2013 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
New programmer Posted May 3, 2013 Author Share Posted May 3, 2013 if ( exports.groupsystem:getElementData(element,"Group") == "name" ) then What's wrong here Link to comment
PaiN^ Posted May 3, 2013 Share Posted May 3, 2013 getPlayerGang ( element ) -- or getElementData ( element, 'Gang' ) No need for exports Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now