Jump to content

HELP


Recommended Posts

How can i get the player who hit a marker??

Code: (see line 8 )

  
-- Server Side! 
local marker1 = createMarker(-2421, -608, 131, "cylinder", 2, 255, 0, 0, 255) 
local accountname = nil 
  
addEventHandler("onMarkerHit", marker1, 
    function() 
        accountname = getAccountName (getPlayerAccount( thePlayerWhoHitMarker1 )) 
        if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then 
            outputChatBox("Admin!") 
        end 
    end 
) 

Link to comment

You want to get Account name or show on the chat only "Admin" ?

Choose one :

local marker1 = createMarker(-2421, -608, 131, "cylinder", 2, 255, 0, 0, 255) 
  
addEventHandler("onMarkerHit", marker1, 
    function(player) 
    if (getElementType(player) == "player") then 
        if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("admin")) then 
            outputChatBox("You're Account Name is : "..getAccountName(getPlayerAccount(player)).." ") 
        end 
    end 
end 
) 
  

or :

local marker1 = createMarker(-2421, -608, 131, "cylinder", 2, 255, 0, 0, 255) 
  
addEventHandler("onMarkerHit", marker1, 
    function(player) 
    if (getElementType(player) == "player") then 
        if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("admin")) then 
            outputChatBox("Admin") 
        end 
    end 
end 
) 
  

Server Side !!

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