iPrestege Posted December 14, 2012 Share Posted December 14, 2012 Hi all, I want to do Marker moves the player to another marker using setElementPosition | onMarkerHit | isObjectInACLGroup i do it Server Side But Didn,t Work My Script : theMarker = createMarker ( x,y,z, "cylinder", 2, 255, 255, 0, 170 ) addEventHandler( "onMarkerHit", theMarker, function ( source, thePlayer ) if ( source == thePlayer ) and ( theMarker ) then if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup ( "Police" ) ) then setElementPosition( source , x,y,z ) end end ) I know that I have weak English in language Link to comment
Castillo Posted December 14, 2012 Share Posted December 14, 2012 onMarkerHit has only ONE player argument, 'source' is the marker that got hit, and is already defined by itself. theMarker = createMarker ( x, y, z, "cylinder", 2, 255, 255, 0, 170 ) addEventHandler ( "onMarkerHit", theMarker, function ( thePlayer ) if ( getElementType ( thePlayer ) == "player" ) then if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Police" ) ) then setElementPosition ( thePlayer, x, y, z ) end end end ) Link to comment
TAPL Posted December 14, 2012 Share Posted December 14, 2012 theMarker = createMarker ( x,y,z, "cylinder", 2, 255, 255, 0, 170 ) addEventHandler("onMarkerHit", theMarker, function (player) if (getElementType(player) == "player") then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup( "Police")) then setElementPosition(player, x, y, z) end end end) Link to comment
Cadu12 Posted December 14, 2012 Share Posted December 14, 2012 theMarker = createMarker ( x, y, z, "cylinder", 2, 255, 255, 0, 170 ) addEventHandler ( "onMarkerHit", theMarker, function ( hitElement ) if getElementType ( hitElement ) ~= "player" then return end if isGuestAccount ( getPlayerAccount ( hitElement ) ) then if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( hitElement ) ), aclGetGroup ( "Police" ) ) then setElementPosition ( hitElement, x, y, z ) end end end ) Next, read the wiki. Link to comment
iPrestege Posted December 14, 2012 Author Share Posted December 14, 2012 onMarkerHit has only ONE player argument, 'source' is the marker that got hit, and is already defined by itself. theMarker = createMarker ( x, y, z, "cylinder", 2, 255, 255, 0, 170 ) addEventHandler ( "onMarkerHit", theMarker, function ( thePlayer ) if ( getElementType ( thePlayer ) == "player" ) then if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Police" ) ) then setElementPosition ( thePlayer, x, y, z ) end end end ) Solidsnake14 Didn,t Work TAPL Work Thank You Cadu12 I do not know the code is true or not I have not tested Link to comment
Castillo Posted December 14, 2012 Share Posted December 14, 2012 My code is pretty much the same as TAPL's, it has to work. Edit: I just tested it and works. Link to comment
iPrestege Posted December 14, 2012 Author Share Posted December 14, 2012 (edited) My code is pretty much the same as TAPL's, it has to work.Edit: I just tested it and works. I am so sorry Solid Snake I forgot to change the name of the group . Edited December 14, 2012 by Guest Link to comment
TAPL Posted December 14, 2012 Share Posted December 14, 2012 My code is pretty much the same as TAPL's, it has to work.Edit: I just tested it and works. Your code was moving the marker (source) instead of the player but you edited it it later. Link to comment
Castillo Posted December 14, 2012 Share Posted December 14, 2012 Yes, I noticed about that and fixed it before he could see it. Link to comment
iPrestege Posted December 14, 2012 Author Share Posted December 14, 2012 My code is pretty much the same as TAPL's, it has to work.Edit: I just tested it and works. I am so sorry Solid Snake I forgot to change the name of the group . I am so sorry Solid Snake 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