Jump to content

| Help | setElementPosition | onMarkerHit| isObjectInACL


iPrestege

Recommended Posts

Posted

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:

  

Posted

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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

CiTLh.png
Posted
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.

Ingame nick: Cadu12

Posted
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

  

Posted

My code is pretty much the same as TAPL's, it has to work.

Edit: I just tested it and works.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted (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 :oops::oops: .

Edited by Guest

  

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

CiTLh.png
Posted

Yes, I noticed about that and fixed it before he could see it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 :oops::oops: .

:arrowup::arrowup: I am so sorry Solid Snake

  

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