Hize Posted March 28, 2019 Share Posted March 28, 2019 Esta dando erro na linha 15,16,17,18,20 function flipVehicle(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local vehicle = getPedOccupiedVehicle(thePlayer) if vehicle then if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then local rX, rY, rZ = getElementRotation(vehicle) setElementRotation(vehicle, 0, 0, (rX > 90 and rX < 270) and (rZ + 180) or rZ) end end end addCommandHandler('desvirar', flipVehicle) function ChamarPolicia (source) local x, y, z = getElementPosition(source) local loc = getZoneName ( x, y, z ) local city = getZoneName ( x, y, z, true ) outputChatBox("#bebebeVocê chamou a policia, aguarde.", source, 255, 255, 255, true) for theKey,player in ipairs (getElementsByType("player")) do local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin") ) then outputChatBox("#bebebe"..getPlayerName(source).." precisa de um policial em "..loc.." ("..city..")", player, 255, 255, 255, true) local blip = createBlipAttachedTo ( source, 30 ) setElementVisibleTo(blip, root, false) setElementVisibleTo(blip, player, true) setTimer ( function() destroyElement(blip) end, 270000, 1) end end end addCommandHandler("192", ChamarPolicia) Link to comment
Other Languages Moderators Lord Henry Posted March 28, 2019 Other Languages Moderators Share Posted March 28, 2019 (edited) Quais erros? Mande por texto, sua imagem não pegou. Edited March 28, 2019 by Lord Henry Link to comment
Hize Posted March 28, 2019 Author Share Posted March 28, 2019 Warning s.lua15: Bad argument @ 'getElementPosition' [Expected element at argument 1,got string'192'] Warning s.lua16: Bad argument @ 'getZoneName' [Expected vector3 at argument 1,got boolean] Warning s.lua17: Bad argument @ 'getZoneName' [Expected vector3 at argument 1,got boolean] Warning s.lua18: Bad argument @ 'outputChatBox' ['Expected boot at argument 5,got number "255"] ERROR s.lua20: attempt to call global 'getPlayerAccount' (a nil value) Link to comment
DNL291 Posted March 29, 2019 Share Posted March 29, 2019 Resource está como cliente no meta.xml. 1 Link to comment
Other Languages Moderators Lord Henry Posted March 31, 2019 Other Languages Moderators Share Posted March 31, 2019 Troque para server. Pois vc está usando funções server-side, que no client não funcionam. 1 Link to comment
Hize Posted April 2, 2019 Author Share Posted April 2, 2019 (edited) Server-side function Virar_Veiculo ( source, Car ) local cx, cy, cz = getElementPosition ( Car ) local px, py, pz = getElementPosition ( source ) local distance = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) outputChatBox("Carro Virado Com Sucesso.", player, 255, 255, 255, true) if ( distance <= 5 ) then local rX, rY, rZ = getElementRotation(Car) setElementRotation(Car, 0, 0, (rX > 90 and rX < 270) and (rZ + 180) or rZ) end end addEvent ("DNL:Virar_Veiculo", true) addEventHandler ("DNL:Virar_Veiculo", root, Virar_Veiculo) function ChamarB (source) local x, y, z = getElementPosition(source) local loc = getZoneName ( x, y, z ) local city = getZoneName ( x, y, z, true ) outputChatBox("#bebebeVocê chamou Uma Equipe de Policia, aguarde.", source, 255, 255, 255, true) for theKey,player in ipairs (getElementsByType("player")) do local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then exports.Scripts_Dxmessages:outputDx ( player, "#FF0000[COBOM] #FFFFFF"..getPlayerName(source).." #FFFFFF precisa de uma Equipe de Policia em "..loc.." ("..city..")", "warning" ) local blip = createBlipAttachedTo ( source, 30 ) setElementVisibleTo(blip, root, false) setElementVisibleTo(blip, player, true) setTimer ( function() destroyElement(blip) end, 270000, 1) end end end addCommandHandler("190", ChamarB) Client-Side function Click_Repair ( _, state, _, _, _, _, _, ClickCar) if state == "down" then if ( ClickCar ) then if ( getElementType ( ClickCar ) == "vehicle" ) then triggerServerEvent("DNL:Virar_Veiculo", root, localPlayer, ClickCar ) end end end end addEventHandler("onClientClick", root, Click_Repair) Como faço pra adicionar um tempo junto com uma animaçao Para o carro virar e pra uma certa acl poder ter esse acesso do Click Edited April 2, 2019 by Hize Link to comment
Jonas^ Posted April 2, 2019 Share Posted April 2, 2019 (edited) getPlayerAccount - Para obter a conta do jogador, para usar na função abaixo: getAccountName - Para obter o nome da conta do jogador, para usar na função abaixo: isObjectInACLGroup - Para verificar qual ACL Group cada jogador está. SetTimer - Para determinar um tempo para a ação ser executada. Edited April 2, 2019 by Jonas^ Link to comment
Hize Posted April 2, 2019 Author Share Posted April 2, 2019 Sim isso eu sei so que em todo lugar que eu coloco ou o click nao funciona ou da erro Link to comment
Hize Posted April 2, 2019 Author Share Posted April 2, 2019 28 minutes ago, Jonas^ said: Mostre como você tentou. function Virar_Veiculo ( source, Car ) local cx, cy, cz = getElementPosition ( Car ) local px, py, pz = getElementPosition ( source ) local distance = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) outputChatBox("Carro Virado Com Sucesso.", player, 255, 255, 255, true) if ( distance <= 5 ) then local rX, rY, rZ = getElementRotation(Car) setTimer(function() setElementRotation(Car, 0, 0, (rx > 90 and rx < 270) and (rz + 100) or rz) end, 120000, 1) end end addEvent ("DNL:Virar_Veiculo", true) addEventHandler ("DNL:Virar_Veiculo", root, Virar_Veiculo) 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