Jump to content

Erro no Debugscript


Archz

Recommended Posts

local gate = createObject(16773, 978.79998779297, -1693, 14.699999809265, 0, 0, 0) 
local marker = createMarker(978.79998779297, -1693, 14.699999809265, "cylinder", 8, 0, 0, 0, 0) 
  
function moveGate(thePlayer) 
     if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("pm")) then 
          moveObject(gate, 3000, 978.79998779297, -1693, 8.1999998092651) 
     end 
end 
addEventHandler("onMarkerHit", marker, moveGate) 
  
function move_back_gate() 
     moveObject(gate, 3000, 978.79998779297, -1693, 14.699999809265) 
end 
addEventHandler("onMarkerLeave", marker, move_back_gate) 

 

Mensagem no Debug: WARNING lua:5: Bad Argument @ 'getPlayerAccount' [Expected player or console at argument  1, got vehicle

                                    WARNING lua:5: Bad Argument @ 'getPlayerAccountName' [Expected account at argument  1, got boolean

                                    ERROR: lua:5: attempt to concatenate a boolean value Warning

 

Nesse script de portão por acl quando chego a frente dele a pé funciona normalmente sem nenhum erro, más quando pego um carro e chego no portão aparece isso no debug

Link to comment

Hello, make sure that to check that the source of the marker hit event is a player, cause vehicles also trigger the event which cause the error you have.

function moveGate(thePlayer)
  if getElementType(thePlayer) == "player" then
     if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("pm")) then 
          moveObject(gate, 3000, 978.79998779297, -1693, 8.1999998092651) 
     end
   end
end 
addEventHandler("onMarkerHit", marker, moveGate) 
  
Edited by Spakye
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...