Jump to content

help


Recommended Posts

i made tp script but when i go to marker nothing happens :(

marker = createMarker (177.48828125, 1453.826171875, 10.591223716736,"cylinder",1.5,255,0,111,255) 
  
function teleport (hitElement) 
local accName = getAccountName ( getPlayerAccount (player) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
setElementPosition (hitElement,182.4287109375, 1451.6865234375, 33.012893676758) 
else 
outputChatBox ("#123456Fuck off!You are not admin.") 
end 
addEventHandler ("onMarkerHit",marker,hitElement) 

Link to comment
marker = createMarker (177.48828125, 1453.826171875, 10.591223716736,"cylinder",1.5,255,0,111,255) 
  
function teleport (hitElement) 
local accName = getAccountName ( getPlayerAccount (player) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
setElementPosition (hitElement,182.4287109375, 1451.6865234375, 33.012893676758) 
else 
outputChatBox ("# off!You are not admin.") 
end 
addEventHandler ("onMarkerHit",marker,teleport) 

Link to comment
marker = createMarker (177.48828125, 1453.826171875, 10.591223716736,"cylinder",1.5,255,0,111,255) 
  
function teleport (hitElement) 
local accName = getAccountName ( getPlayerAccount (player) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
setElementPosition (hitElement,182.4287109375, 1451.6865234375, 33.012893676758) 
else 
outputChatBox ("# off!You are not admin.") 
end 
addEventHandler ("onMarkerHit",marker,teleport) 

now the marker is not showing up

Link to comment
local accName = getAccountName ( getPlayerAccount (player) ) 

Change player to hitElement

addEventHandler ("onMarkerHit",marker,hitElement) 

Change hitElement to your function name

You're also missing an end.

function teleport (hitElement) 
    local accName = getAccountName ( getPlayerAccount (hitElement) ) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
        setElementPosition (hitElement,182.4287109375, 1451.6865234375, 33.012893676758) 
    else 
        outputChatBox ("# off!You are not admin.") 
    end 
end 
addEventHandler ("onMarkerHit",marker,teleport) 

Also, put it server-side. Tip: type /debugscript 3 in-game, it'll tell you what's wrong with your code when you run it.

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