Jump to content

ajuda com erro


Recommended Posts

bom ta tendo uma quantidade enorme de erro no meu serve como esses e todos eles são esse mesmo erro envolvendo  'getPlayerAccount 'getAccountName'  não sei se e a falta de um banco de dados se alguem puder me ajudar 

 WARNING: [CORPS]/[BOPE]/[BOPE]Map2/gatescript.Lua:5: Bad argument @ 'getPlayerAccount' [Expected player or console at argument 1, got vehicle]
WARNING: [CORPS]/[BOPE]/[BOPE]Map2/gatescript.Lua:5: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean]
ERROR: [CORPS]/[BOPE]/[BOPE]Map2/gatescript.Lua:5: attempt to concatenate a boolean value

 

local gate = createObject(980, 1810.9000244141, -1891.1999511719, 15.39999961853, 0, 0, 90) 
local marker = createMarker(1810.9000244141, -1891.1999511719, 9.6000003814697, "cylinder", 8, 0, 0, 0, 0) 
  
function moveGate(thePlayer) 
     if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("BOPE")) then 
          moveObject(gate, 3000, 1810.9000244141, -1891.1999511719, 9.6000003814697) 
     end 
end 
addEventHandler("onMarkerHit", marker, moveGate) 
  
function move_back_gate() 
     moveObject(gate, 3000, 1810.9000244141, -1891.1999511719, 15.39999961853) 
end 
addEventHandler("onMarkerLeave", marker, move_back_gate) 

 

Link to comment
  • Other Languages Moderators

Ele está reclamando que thePlayer não é um jogador. Isso acontece quando vc colide no marker com um veículo ou qualquer outro objeto que não seja um jogador.

Em vez disso, faça a função assim:

function moveGate (hitElement, matchingDimension)
    if (getElementType (hitElement) == "player" and matchingDimension) then -- Se o elemento que colidiu no marker for um jogador e ele estiver na mesma dimensão que o marker, então:
        if isObjectInACLGroup ("user."..getAccountName (getPlayerAccount (hitElement)) , aclGetGroup("BOPE")) then -- Se o jogador que colidiu no marker estiver na ACL Group BOPE, então:
            moveObject (gate, 3000, 1810.9, -1891.2, 9.6) -- Move o portão para essa posição. 
        end
    end
end
addEventHandler ("onMarkerHit", marker, moveGate)

 

Link to comment
local gate = createObject(980, 1810.9000244141, -1891.1999511719, 15.39999961853, 0, 0, 90) 
local marker = createMarker(1810.9000244141, -1891.1999511719, 9.6000003814697, "cylinder", 8, 0, 0, 0, 0) 
  
function moveGate(hitElement) 
  if getElementType( hitElement ) == "player" then
     if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)) , aclGetGroup("BOPE")) then 
          moveObject(gate, 3000, 1810.9000244141, -1891.1999511719, 9.6000003814697) 
     end 
    end
end 
addEventHandler("onMarkerHit", marker, moveGate) 
  
function move_back_gate() 
     moveObject(gate, 3000, 1810.9000244141, -1891.1999511719, 15.39999961853) 
end 
addEventHandler("onMarkerLeave", marker, move_back_gate) 

 

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