Big Smoker Posted December 24, 2019 Share Posted December 24, 2019 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 Lord Henry Posted December 24, 2019 Other Languages Moderators Share Posted December 24, 2019 (edited) 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 December 24, 2019 by Lord Henry Link to comment
Big Smoker Posted December 24, 2019 Author Share Posted December 24, 2019 eu coloquei essa função num colhit, quando player entra em uma col ele executa essa função, para identificar se o player existe é essa função aqui? getElementType(player) == "player" and baseName then Link to comment
Other Languages Moderators Lord Henry Posted December 24, 2019 Other Languages Moderators Share Posted December 24, 2019 Não. É com isElement. Link to comment
Big Smoker Posted December 24, 2019 Author Share Posted December 24, 2019 (edited) 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 December 24, 2019 by felipebaidoloko Link to comment
Other Languages Moderators Lord Henry Posted December 24, 2019 Other Languages Moderators Share Posted December 24, 2019 Corrija a indentação. Está difícil de ler assim. Link to comment
Big Smoker Posted December 24, 2019 Author Share Posted December 24, 2019 eu corrigi mais nao corrigi aqui olhe https://ibb.co/gRWS2Lw Link to comment
Other Languages Moderators Lord Henry Posted December 24, 2019 Other Languages Moderators Share Posted December 24, 2019 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. 1 Link to comment
Big Smoker Posted December 25, 2019 Author Share Posted December 25, 2019 (edited) 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 December 25, 2019 by felipebaidoloko Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now