Jump to content

HELP AVISO


Recommended Posts

Pessoal ja postei 1 topico com esse aviso mais ele voltou 



os avisos

 

Bad argument @ 'getPlayerAccount' [Expected element at argument 1]  [DUP x2]
Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean]  [DUP x2]
attempt to concatenate a boolean value  [DUP x2]
Bad argument @ 'getPlayerAccount' [Expected element at argument 1]
Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean]
attempt to concatenate a boolean value


=====================================================================================================================
-- LINHA QUE DA O AVISO

if not((checkPlayerPermission(player,"A08") and getElementData(player,"Group") == getGroupNameFromBaseName(baseName)) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))) then 

=====================================================================================================================



Script - server.Lua

function chePlayergr(player,x,y,z,baseName)
	if isElement(player) and getElementType(player) == "player" and baseName then
		if isTimer(cheTimer) then return end
		cheTimer = setTimer(function(player,baseName)
			if not((checkPlayerPermission(player,"A08") and getElementData(player,"Group") == getGroupNameFromBaseName(baseName)) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))) then 
				if isTimer(cheTimer) then
					killTimer(cheTimer)
				end
				setElementPosition(player,x,y,z+1)
				outputChatBox("Você não tem mais acesso a Base!",player,255,255,255,true)
        	end
		end,2000, 0,player,baseName)
	end
end

 

Link to comment
  • Other Languages Moderators

Quando o player desloga, o timer dele continua mas o elemento do jogador não existe mais, gerando erro. Vc tem 2 opções:

  • Não faça com setTimer.
  • Adicione uma verificação no setTimer, que vai verificar se o player ainda existe, se não existir, cancela o timer com killTimer e cancela a função com um return.
Edited by Lord Henry
Link to comment
function chePlayergr(player,x,y,z,baseName)
	cheTimer = setTimer(function(player,baseName)
		if isElement(player) and getElementType(player) == "player" and baseName then
			if not((checkPlayerPermission(player,"A08") and getElementData(player,"Group") == getGroupNameFromBaseName(baseName)) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))) then 
				if isTimer(cheTimer) then
					killTimer(cheTimer)
				end
				setElementPosition(player,x,y,z+1)
				outputChatBox("Você não tem mais acesso a Base!",player,255,255,255,true)
        	end
        else
			killTimer(cheTimer)
		end
	end,2000, 0,player,baseName)
end

 

 

 

 FICARIA ASSIM?

Edited by felipebaidoloko
Link to comment
  • Other Languages Moderators
function chePlayergr(player,x,y,z,baseName)
	cheTimer = setTimer(function(player,baseName)
		if isElement(player) and getElementType(player) == "player" and baseName then
			if not((checkPlayerPermission(player,"A08") and getElementData(player,"Group") == getGroupNameFromBaseName(baseName)) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)),aclGetGroup("Admin"))) then 
				if isTimer(cheTimer) then
					killTimer(cheTimer)
				end
				setElementPosition(player,x,y,z+1)
				outputChatBox("Você não tem mais acesso a Base!",player,255,255,255,true)
			end
		else
			killTimer(cheTimer)
		end
	end, 2000, 0, player, baseName)
end

 

Já vou logo adiantando que vai dar uma série de problemas por usar setTimer server-side e sem indexar no jogador. Outros jogadores causarão conflito neste setTimer.

  • Thanks 1
Link to comment

deu certo, so que anulei essa função, pois tinha alguns bug nela, que dava pra bugar se reloga-se ai coloquei 

 

setTimer(function()
	for i,col in pairs(getElementsByType("colshape"))do
		if getElementData(col,"BaseCol") then
			for i,player in pairs(getElementsWithinColShape(col,"player"))do
				-- FUNÇÃO...
			end
		end
	end
end,1000,0)

MUITO OBRIGADO PELA AJUDA.

Edited by felipebaidoloko
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...