Jump to content

| Help | setElementPosition | onMarkerHit| isObjectInACL


iPrestege

Recommended Posts

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 :cry:

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 :mrgreen:

Link to comment

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

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