MrDante Posted January 17, 2016 Share Posted January 17, 2016 (edited) Bom, muita gente está pedindo um algemar estilo do bvz, algo que seja semelhante, fui tentar algo, como não sei muito o que fazer pensei em uma forma de attach elements e doorstate, porem deu um erro, juntei algumas funçoes de um outro mod meu, creio que isso n faria nenhuma alteração no script, tentei colocar isso e deu esse erro: attempt to call global 'getPlayerFromPartialName' ( a nil value ) alguem sabe oque tem de erro nesse script? function doesVehicleHaveDoorOpen(thePlayer, comando, nick, vehicle) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ComandosPolicia") ) then -- Acl Pra Quem Pode Usar o Comando local player_a_ser_algemado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_algemado ) local nick_do_policial = getPlayerName ( thePlayer ) local vehicle = getPedOccupiedVehicle(thePlayer) local isDoorAjar = false for i=0,5 do local doorState = getVehicleDoorState(vehicle, i) if doorState == 6 then isDoorAjar = true attachElements ( isDoorAjar, thePlayer, 0, 0, 2 ) end end return isDoorAjar end end end end addCommandHandler("algemar", doesVehicleHaveDoorOpen) Edited January 17, 2016 by Guest Link to comment
#RooTs Posted January 17, 2016 Share Posted January 17, 2016 Olha, acho que seu script está faltando a função getPlayerFromPartialName que está na WIKI.. tente isso function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end --------------------- function doesVehicleHaveDoorOpen(thePlayer, comando, nick, vehicle) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "ComandosPolicia") ) then -- Acl Pra Quem Pode Usar o Comando local player_a_ser_algemado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_algemado ) local nick_do_policial = getPlayerName ( thePlayer ) local vehicle = getPedOccupiedVehicle(thePlayer) local isDoorAjar = false for i=0,5 do local doorState = getVehicleDoorState(vehicle, i) if doorState == 6 then isDoorAjar = true attachElements ( isDoorAjar, thePlayer, 0, 0, 2 ) end end return isDoorAjar end end end end addCommandHandler("algemar", doesVehicleHaveDoorOpen) Link to comment
MrDante Posted January 17, 2016 Author Share Posted January 17, 2016 Eh, eu esqueci de minimos detalhes, me confundo mt rs, mas obg #RooTs Link to comment
#RooTs Posted January 17, 2016 Share Posted January 17, 2016 Eh, eu esqueci de minimos detalhes, me confundo mt rs, mas obg #RooTs de nada deu certo ? Link to comment
MrDante Posted January 17, 2016 Author Share Posted January 17, 2016 Eh, eu esqueci de minimos detalhes, me confundo mt rs, mas obg #RooTs de nada deu certo ? Nao por enquanto kkk, mas o error do nil foi resolvido , e nao sei se vai dar mt certo , talvez uma bela gambiarra eu consiga Link to comment
#RooTs Posted January 17, 2016 Share Posted January 17, 2016 Nao por enquanto kkk, mas o error do nil foi resolvido , e nao sei se vai dar mt certo , talvez uma bela gambiarra eu consiga Ahh, sim.. então tá. mandei uma PM pra você Link to comment
#RooTs Posted January 17, 2016 Share Posted January 17, 2016 Nao por enquanto kkk, mas o error do nil foi resolvido , e nao sei se vai dar mt certo , talvez uma bela gambiarra eu consiga Ahh, sim.. então tá. mandei uma PM pra você 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