Holympo Posted September 4, 2019 Posted September 4, 2019 Eu estava configurando este emprego e quando ativei ele quando chamava o mecanico tanto como o comando tanto no celular e ai tive a mexer nesses comandos e tentei mexer e do nada deixou de dar entao precisava de meter isto a dar outra vez e aos mecanicos receberem notificaçao de quando o carro avaria setElementData( localPlayer, "Chamado:Mecanico", true ) setElementData(localPlayer,"cliente:mecanico",true) -------------------------------------------------------------------- function localizarMecanico(cn,name) local jobMecanico = getElementData(localPlayer,"Emprego") or false --if type(jobMecanico) == "boolean" then if jobMecanico == "Mecanico" then if type(name) == "string" then local player = getPlayerFromPartialName(name) if isElement(player) then if isElement(testeMecanico) then destroyElement(testeMecanico) end if getElementData ( player, "Chamado:Mecanico" ) == then testeMecanico = createBlipAttachedTo(player,61,2,255,255,255,255,0,999999) exports.Scripts_Dxmessages:createNotification("O Jogador "..getPlayerName(player).." Foi Localizado!, Para Deslocalizar Digite /Deslocalizar", "success") else exports.Scripts_Dxmessages:createNotification("O Jogador "..getPlayerName(player).." Não Solicitou por um Mecânico!", "error") end else exports.Scripts_Dxmessages:createNotification("O Jogador Não Foi Encontrado!", "error") end else exports.Scripts_Dxmessages:createNotification("Digite /Localizar Nick", "warning") end end --end end addCommandHandler("localizar",localizarMecanico) -------------------------------------------------------------------- function deslocalizar(cn,name) if isElement(testeMecanico) then destroyElement(testeMecanico) exports.Scripts_Dxmessages:createNotification("O Jogador foi Deslocalizado com Sucesso!", "success") end end addCommandHandler("deslocalizar",deslocalizar) -------------------------------------------------------------------- function QuebradoMec ( ) exports.Scripts_Dxmessages:createNotification("Esse Veiculo Esta Quebrado, Chame Por um Mecanico digitando /Mecanicos", "warning") end addEvent( "Mecanico>Quebrado", true ) addEventHandler( "Mecanico>Quebrado", localPlayer, QuebradoMec ) -------------------------------------------------------------------- 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 -------------------------------------------------------------------- o que eu mexi foi neste -------------------------------------------------------------------- function MecanicoVem(source) for i, player in ipairs(getElementsByType("player") do local uj = getElementData(player, "Mecanico" ) if type(uj) == "Mecanico" then exports.Scripts_Textos:createNewDxMessage(ThePlayer, "O Jogador "..getPlayerName(source).." Chamou Por um Mecanico! Digite /Localizar "..getPlayerName(source), "warning") end --end end end addCommandHandler(cmd4,MecanicoVem) --------------------------------------------------------------------
beast99 Posted September 4, 2019 Posted September 4, 2019 (edited) 11 minutes ago, Holympo said: Eu estava configurando este emprego e quando ativei ele quando chamava o mecanico tanto como o comando tanto no celular e ai tive a mexer nesses comandos e tentei mexer e do nada deixou de dar entao precisava de meter isto a dar outra vez e aos mecanicos receberem notificaçao de quando o carro avaria setElementData( localPlayer, "Chamado:Mecanico", true ) setElementData(localPlayer,"cliente:mecanico",true) -------------------------------------------------------------------- function localizarMecanico(cn,name) local jobMecanico = getElementData(localPlayer,"Emprego") or false --if type(jobMecanico) == "boolean" then if jobMecanico == "Mecanico" then if type(name) == "string" then local player = getPlayerFromPartialName(name) if isElement(player) then if isElement(testeMecanico) then destroyElement(testeMecanico) end if getElementData ( player, "Chamado:Mecanico" ) == then testeMecanico = createBlipAttachedTo(player,61,2,255,255,255,255,0,999999) exports.Scripts_Dxmessages:createNotification("O Jogador "..getPlayerName(player).." Foi Localizado!, Para Deslocalizar Digite /Deslocalizar", "success") else exports.Scripts_Dxmessages:createNotification("O Jogador "..getPlayerName(player).." Não Solicitou por um Mecânico!", "error") end else exports.Scripts_Dxmessages:createNotification("O Jogador Não Foi Encontrado!", "error") end else exports.Scripts_Dxmessages:createNotification("Digite /Localizar Nick", "warning") end end --end end addCommandHandler("localizar",localizarMecanico) -------------------------------------------------------------------- function deslocalizar(cn,name) if isElement(testeMecanico) then destroyElement(testeMecanico) exports.Scripts_Dxmessages:createNotification("O Jogador foi Deslocalizado com Sucesso!", "success") end end addCommandHandler("deslocalizar",deslocalizar) -------------------------------------------------------------------- function QuebradoMec ( ) exports.Scripts_Dxmessages:createNotification("Esse Veiculo Esta Quebrado, Chame Por um Mecanico digitando /Mecanicos", "warning") end addEvent( "Mecanico>Quebrado", true ) addEventHandler( "Mecanico>Quebrado", localPlayer, QuebradoMec ) -------------------------------------------------------------------- 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 -------------------------------------------------------------------- o que eu mexi foi neste -------------------------------------------------------------------- function MecanicoVem(source) for i, player in ipairs(getElementsByType("player") do local uj = getElementData(player, "Mecanico" ) if type(uj) == "Mecanico" then exports.Scripts_Textos:createNewDxMessage(ThePlayer, "O Jogador "..getPlayerName(source).." Chamou Por um Mecanico! Digite /Localizar "..getPlayerName(source), "warning") end --end end end addCommandHandler(cmd4,MecanicoVem) -------------------------------------------------------------------- Talvez, você usou "exports.Scripts_Textos:createNewDxMessage" em vez de "exports.Scripts_Dxmessages:createNotification".. Edited September 4, 2019 by MesaDowN
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