Jump to content

[ERROR]ERROR NO DEBUGSCRIPT


Recommended Posts

------------------------------------------------------------------------------
-------------------------------[PORTÃO PRENDER]-------------------------------
------------------------------------------------------------------------------

--- MARKERS ---

local gate3 = createObject(986, 1588.599609375, -1638.2998046875, 13.199999809265, 0, 0, 0) 
local marker3 = createMarker(1588.599609375, -1638.2998046875, 13.199999809265, "cylinder", 5, 0, 0, 0, 0) 

--- FUNÇÃO ABRIR ---

function moveGate3(thePlayer) 
     if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("Policial")) then -- LINHA 16 QUE DA O ERRO DO DEBUG
          moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 4.5) 
     end 
end 
addEventHandler("onMarkerHit", marker3, moveGate3) 
 
--- FUNÇÃO FECHAR ---

function move_back_gate3() 
     moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 13.199999809265) 
end 
addEventHandler("onMarkerLeave", marker3, move_back_gate3) 

Sempre que alguem com veiculo que possui  a acl policial tenta passar pelo portão dá os seguintes erros:

WARNING: [MAPA]DP/Portao/portaoPrender.lua:16: Bad argument @'getPlayerAccount'[Expected player or console at argument 1, got vehicle]
WARNING: [MAPA]DP/Portao/portaoPrender.lua:16: Bad argument @'getAccountName'[Expected account at argument 1, got boolean]
ERROR: [MAPA]DP/Portao/portaoPrender.lua:16: attempt to concatenate a boolean value
 
Como posso resolver? Tenho que especificar que ele ta no veiculo ou algo do tipo?
Edited by FpX
Link to comment
5 hours ago, FpX said:
------------------------------------------------------------------------------
-------------------------------[PORTÃO PRENDER]-------------------------------
------------------------------------------------------------------------------

--- MARKERS ---

local gate3 = createObject(986, 1588.599609375, -1638.2998046875, 13.199999809265, 0, 0, 0) 
local marker3 = createMarker(1588.599609375, -1638.2998046875, 13.199999809265, "cylinder", 5, 0, 0, 0, 0) 

--- FUNÇÃO ABRIR ---

function moveGate3(thePlayer) 
     if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("Policial")) then -- LINHA 16 QUE DA O ERRO DO DEBUG
          moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 4.5) 
     end 
end 
addEventHandler("onMarkerHit", marker3, moveGate3) 
 
--- FUNÇÃO FECHAR ---

function move_back_gate3() 
     moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 13.199999809265) 
end 
addEventHandler("onMarkerLeave", marker3, move_back_gate3) 

Sempre que alguem com veiculo que possui  a acl policial tenta passar pelo portão dá os seguintes erros:

WARNING: [MAPA]DP/Portao/portaoPrender.lua:16: Bad argument @'getPlayerAccount'[Expected player or console at argument 1, got vehicle]
WARNING: [MAPA]DP/Portao/portaoPrender.lua:16: Bad argument @'getAccountName'[Expected account at argument 1, got boolean]
ERROR: [MAPA]DP/Portao/portaoPrender.lua:16: attempt to concatenate a boolean value
 
Como posso resolver? Tenho que especificar que ele ta no veiculo ou algo do tipo?

Olá, boa tarde tudo bem?
Você pode resolver verificando se o elemento que hitou o marker é um player, e se for se ele está logado.
Teste desta maneira:

------------------------------------------------------------------------------
-------------------------------[PORTÃO PRENDER]-------------------------------
------------------------------------------------------------------------------

--- MARKERS ---

local gate3 = createObject(986, 1588.599609375, -1638.2998046875, 13.199999809265, 0, 0, 0) 
local marker3 = createMarker(1588.599609375, -1638.2998046875, 13.199999809265, "cylinder", 5, 0, 0, 0, 0) 

--- FUNÇÃO ABRIR ---

function moveGate3(thePlayer) 
	if thePlayer and isElement(thePlayer) and getElementType(thePlayer) == "player" then
		if not isGuestAccount(getPlayerAccount(thePlayer)) then
     		if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("Policial")) then 
          		moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 4.5) 
			end
     	end 
	end
end 
addEventHandler("onMarkerHit", marker3, moveGate3) 
 
--- FUNÇÃO FECHAR ---

function move_back_gate3() 
     moveObject(gate3, 1000, 1588.599609375, -1638.2998046875, 13.199999809265) 
end 
addEventHandler("onMarkerLeave", marker3, move_back_gate3) 


 

  • Thanks 1
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...