Jump to content

Bad argument @ 'getElementData' [Expected element at argument 1, got boolean]


Recommended Posts

Olá, estou com um problema neste código, já tentei algumas coisas porém após eu tentar arrumar o mod não funciona como deveria funcionar (não acusa nenhum erro no debug), se alguém conseguir me ajudar, agradeço! :) 

Tentei usar if mrk then

WARNING: Casa\core\core_server.lua:13: Bad argument @ 'getElementData' [Expected element at argument 1, got boolean]

 

function onPlayerHouseMarkerHit( player, mrk, cursor )
  local acc = getPlayerAccount( player );
  if isGuestAccount( acc ) then
    outputChatBox( '#ffffffVocê precisa estar logado para entrar na casa!', player, 255, 51, 36, true);
    setElementData( player, 'mrk_in', nil );
    setElementFrozen( player, false );
    return false;
  end;
  local tts = { [1] = true, [2] = false, [3] = false, [4] = true, [5] = false, [6] = false };
  if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( 'admin' ) ) then
    tts[6] = true;
  end;
  local owner = getElementData( mrk, 'HS_INFO' )[7];
  local accName = getAccountName( acc );
  if owner == accName then
    tts[1] = false;
    tts[2] = true;
    tts[3] = true;
    tts[4] = true;
    tts[5] = true;
  end;
  if owner ~= accName and owner ~= '' then
    tts[1] = false;
  end;
  if owner == '' then
    if isObjectInACLGroup( 'user.'..getAccountName( acc ), aclGetGroup( 'admin' ) ) then
      tts[4] = true;
    else
      tts[4] = false;
    end;
  end;
  tts[7] = getElementData( mrk, 'HS_INFO' )[9];
  tts[8] = getElementData( mrk, 'HS_INFO' )[7];
  tts[9] = getElementData( mrk, 'HS_INFO' )[6];
  triggerClientEvent( player, 'openHouseManagementWnd', root, tts, cursor );
end;

 

Link to comment
21 minutes ago, Lord Henry said:

Claramente vc está mexendo no resource da internet, o House System. Oq vc está tentando fazer?

Sim, é um resource da internet. Ele está acusando esse WARNING que falei acima, estou tentando arrumar todos esses erros, pois está de certa forma me incomodando, pelo conhecimento que eu tenho, tentei algumas formas, usando o if mrk then, porém após eu mexer nisso ele está alterando as permissões da casa. Exemplo: Uma pessoa já consegue comprar uma casa que já está comprada, sendo que isso não era pra acontecer.

Link to comment
  • Other Languages Moderators

Já tentou baixar essa versão superior aqui? Me avise se depois de testar, esse resource estiver com esse erro também.

Obs: Ele funciona diferente dessa sua versão original aí, leia a descrição dele.

  • Like 1
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...