Machine Posted August 15, 2012 Share Posted August 15, 2012 this dont work! aRadarArea = createRadarArea ( 1024, 1024, 30, 140, 255, 255, 0, 85 ) -- create the radar area flag = setRadarAreaSize ( aRadarArea, 50, 90 ) if ( flag ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then --check if hes admin setElementPosition ( source, x, y, z ) -- that he stay where he is and dont teleport if not then setElementPosition ( source, 1549.88953, -1685, 13 )-- if hes not admin then teleprot him to other postion end end Link to comment
TAPL Posted August 15, 2012 Share Posted August 15, 2012 Where is the function and the event? i can't see where source and thePlayer define. Link to comment
AMARANT Posted August 15, 2012 Share Posted August 15, 2012 Your code is absolutely wrong! Tell us what are you trying to do in order to get some help. Link to comment
Machine Posted August 15, 2012 Author Share Posted August 15, 2012 im trying make a base that when admin enter it he can stay in it but if player try to go enter it he teleport to x y z postion Link to comment
TAPL Posted August 15, 2012 Share Posted August 15, 2012 You need to create ColShape, and use event https://wiki.multitheftauto.com/wiki/OnColShapeHit Link to comment
CheiN Posted August 15, 2012 Share Posted August 15, 2012 this dont work! aRadarArea = createRadarArea ( 1024, 1024, 30, 140, 255, 255, 0, 85 ) -- create the radar area flag = setRadarAreaSize ( aRadarArea, 50, 90 ) if ( flag ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then --check if hes admin setElementPosition ( source, x, y, z ) -- that he stay where he is and dont teleport if not then setElementPosition ( source, 1549.88953, -1685, 13 )-- if hes not admin then teleprot him to other postion end end see what are u writing. u forgot the if "if isObjectInAclGroup" not "isObjectInAclGroup" u forgot : local aRadarArea = createRadarArea local flag = setRadarAreaSize Link to comment
Machine Posted August 16, 2012 Author Share Posted August 16, 2012 tried didnt work local aRadarArea = createRadarArea ( 1024, 1024, 30, 140, 255, 255, 0, 85 ) -- create the radar area local flag = setRadarAreaSize ( aRadarArea, 50, 90 ) if ( flag ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then --check if hes admin setElementPosition ( source, x, y, z ) -- that he stay where he is and dont teleport if not then setElementPosition ( source, 1549.88953, -1685, 13 )-- if hes not admin then teleprot him to other postion end end if Link to comment
TAPL Posted August 16, 2012 Share Posted August 16, 2012 Somehow my posts got ignore. Link to comment
Flaker Posted August 16, 2012 Share Posted August 16, 2012 Machine, what u want to do in this code? If u want warp admin to base, then u should set any event... For example: 1) Create Col shape. https://wiki.multitheftauto.com/wiki/CreateColCuboid Then u should addEvent for this colshape... 2) Add Event OnColshapeHit (https://wiki.multitheftauto.com/wiki/OnColShapeHit) Example: local Colshape = createColCuboid ( 1024, 1024, 0, 500, 500, 500 ) --Create colshape function OnHit ( hitElement, matchingDimension ) if ( source == Colshape ) then --If Source is our colshape then if ( matchingDimension and getElementType ( hitElement ) == "player" ) then -- chech if hit element is player if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(hitElement)), aclGetGroup ( "Admin" ) ) then --If player is admin setElementPosition ( hitElement, 1549.88953, -1685, 13 ) --Warp to admin's position else setElementPosition ( hitElement, 0, 0, 0 ) --Warp to not admin's position end end end end addEventHandler ( "onColShapeLeave", root, OnHit) 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