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