Jump to content

hawkbr

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by hawkbr

  1. Quero colocar hand de drift pra alguns carros..Vou dar uma olhada ! Valeu !!
  2. Olá, eu tava dando uma olhada no setVehicleHandling, e ví que tem um exemplo para alterar o handling de um carro atravez da ID dele etc. Eu tentei fazer com que assim que o carro fosse spawnado, ele iria ficar com aquela handling (no meu caso, servidor de drift/corrida). Bom, quando fiz o teste, o handling não foi ativado. Alguém poderia me ajudar?? s-side local predefinedHandling = { [527] = { ["driveType"] = "rwd", ["engineAcceleration"] = 500, ["dragCoeff"] = 1.5, ["maxVelocity"] = 300, ["tractionMultiplier"] = 0.7, ["tractionLoss"] = 0.8, ["collisionDamageMultiplier"] = 0.4, ["engineInertia"] = -175, ["steeringLock"] = 75, ["numberOfGears"] = 4, ["suspensionForceLevel"] = 0.8, ["suspensionDamping"] = 0.8, ["suspensionUpperLimit"] = 0.33, ["suspensionFrontRearBias"] = 0.3, ["mass"] = 1800, ["turnMass"] = 3000, ["centerOfMass"] = { [1]=0, [2]=-0.2, [3]=-0.5 }, }, } for i,v in pairs (predefinedHandling) do if i then for handling, value in pairs (v) do if not setModelHandling (i, handling, value) then outputDebugString ("* Predefined handling '"..tostring(handling).."' for vehicle model '"..tostring(i).."' could not be set to '"..tostring(value).."'") end end end end for _,v in ipairs (getElementsByType("vehicle")) do if v and predefinedHandling[getElementModel(v)] then for k,vl in pairs (predefinedHandling[getElementModel(v)]) do setVehicleHandling (v, k, vl) end end end function resetHandling() for model in pairs (predefinedHandling) do if model then for k in pairs(getOriginalHandling(model)) do setModelHandling(model, k, nil) end end end for _,v in ipairs (getElementsByType("vehicle")) do if v then local model = getElementModel(v) if predefinedHandling[model] then for k,h in pairs(getOriginalHandling(model)) do setVehicleHandling(v, k, h) end end end end end addEventHandler("onResourceStop", resourceRoot, resetHandling)
  3. Com esses problemas, tivemos outra ideia. Não tem como adicionar uma função separada desta, com o mesmo comando do mecanico, com o destroy? dai lá no final ficaria a função sei la "desmarcar" com o command /reparar ?? eu tentei fazer mas não consegui
  4. Apareceu isto: comando /reparar executado! @theUser: userdata: 000000A0 @mecanico.solicitation 1#: false
  5. Apareceu no chat assim: Comando /reparar executado! @theUser: userdata:00000097 @mecanico.solicitation 1#: false
  6. Não entendi muito bem ao certo.. como funcionaria pra ver? Eu coloquei mas o comando de reparar não estava funcionanmdo.. ficou assim: ... else if isElement(BlipsMEC[theUser]) then destroyElement(BlipsMEC[theUser]) end damagedVehs[theUser] = veh setElementData (theUser, "mecanico.solicitation", thePlayer) ...
  7. Quando o mecanico solicita, ainda ta continuando o blip.. teria outra forma de fazer o blip desaparecer quando ele digitar o comando /reparar ???
  8. 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 local damagedVehs = {} function solicitaPay (thePlayer, cmd, user) local accName = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("Mec") ) then if not user then outputChatBox ("Erro de sintaxe, use /consertar <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else local veh = getPedOccupiedVehicle(thePlayer) if not (veh) then return outputChatBox( "Você precisa estar dentro de um veículo", thePlayer, 255, 255, 0 ) end local theUser = getPlayerFromPartialName (user) if getElementData (theUser, "mecanico.solicitation") then outputChatBox ("Alguém já está solicitando pagamento mecânico a este jogador.", thePlayer, 255, 255, 0) else damagedVehs[theUser] = veh setElementData (theUser, "mecanico.solicitation", thePlayer) outputChatBox ("Você solicitou pagamento para consertar o veículo de "..user, thePlayer, 0, 255, 0, true) outputChatBox (getPlayerName (thePlayer).."#FFFF00 está pedindo $800 para consertar seu veículo. Use /aceitar ou /recusar", theUser, 255, 255, 255, true) mechTimer[thePlayer] = setTimer (function () if isElement(BlipsMEC[theUser]) then destroyElement(BlipsMEC[theUser]) if getElementData (theUser, "mecanico.solicitation") then setElementData (theUser, "mecanico.solicitation", false) outputChatBox ("O pedido de pagamento de "..getPlayerName (thePlayer).."#FFFF00 expirou.", theUser, 255, 255, 0, true) end end, 10000, 1) end end else outputChatBox("#FF0000Você não tem permissão para executar este comando!", thePlayer, 255, 255, 255, true ) end end addCommandHandler ("reparar", solicitaPay) function aceitaPay (thePlayer, cmd) local mech = getElementData (thePlayer, "mecanico.solicitation") if mech and damagedVehs[thePlayer] and isElement(damagedVehs[thePlayer]) then if getPlayerMoney (thePlayer) >= 2500 and getPedOccupiedVehicle(mech) == damagedVehs[thePlayer] then takePlayerMoney (thePlayer, 2500) givePlayerMoney (mech, 2500) outputChatBox ("Seu pedido foi aceito. Voce recebeu R$2.500 pelo conserto.", mech, 0, 255, 0) fixVehicle (damagedVehs[thePlayer]) damagedVehs[thePlayer] = nil setElementData (thePlayer, "mecanico.solicitation", false) outputChatBox ("Seu veículo foi consertado.", thePlayer, 0, 255, 0) else outputChatBox ("Você não tem dinheiro suficiente.", thePlayer, 255, 0, 0) end end end addCommandHandler ("aceitar", aceitaPay) addEventHandler( "onPlayerQuit", root, function() if damagedVehs[source] then damagedVehs[source] = nil end end ) --- Mensagem /mec function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); for _,v in ipairs(getElementsByType("player")) do outputChatBox("#FF0000[AJUDA]#00FF00"..name.." #FFFFFFPrecisa de um MECÂNICO"..message,v, 255, 255, 255, true) end end addCommandHandler("mec", globalMessage); function recusaPay (thePlayer, cmd) if getElementData (thePlayer, "mecanico.solicitation") then outputChatBox ("Seu pedido foi recusado.", getElementData (thePlayer, "mecanico.solicitation"), 255, 0, 0) setElementData (thePlayer, "mecanico.solicitation", false) outputChatBox ("Você recusou o pagamento. Seu veículo não foi consertado.", thePlayer, 255, 0, 0) end end addCommandHandler ("recusar", recusaPay) function marcarplayer(thePlayer, cmd, user) if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("Mec") ) ~= true then return outputChatBox ("Você não tem permissão para executar este comando!", thePlayer, 255, 0, 0) end if not user then outputChatBox ("Erro: use /marcar <nick>", thePlayer, 255, 255, 0) elseif user and not isElement(getPlayerFromPartialName (user)) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) elseif isElement(getPlayerFromPartialName (user)) then local player = getPlayerFromPartialName (user) BlipsMEC[player] = createBlipAttachedTo (player, 0, 2, 0, 0, 250, 210) outputChatBox ("O cliente "..getPlayerName(player).."#FFFF00 foi marcado no mapa!", thePlayer, 255, 255, 0, true) end end addCommandHandler ("marcar", marcarplayer) addEventHandler ( "onPlayerQuit", root, function ( ) if BlipsMEC[source] then if isElement(BlipsMEC[source]) then destroyElement(BlipsMEC[source]) end BlipsMEC[source] = nil end end ) Linha 43: unexpected symbol near ","
  9. Não está saindo o blip quando o mecanico manda a solicitação. 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 local damagedVehs = {} function solicitaPay (thePlayer, cmd, user) local accName = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("Mec") ) then if not user then outputChatBox ("Erro de sintaxe, use /consertar <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else local veh = getPedOccupiedVehicle(thePlayer) if not (veh) then return outputChatBox( "Você precisa estar dentro de um veículo", thePlayer, 255, 255, 0 ) end local theUser = getPlayerFromPartialName (user) if getElementData (theUser, "mecanico.solicitation") then outputChatBox ("Alguém já está solicitando pagamento mecânico a este jogador.", thePlayer, 255, 255, 0) else damagedVehs[theUser] = veh setElementData (theUser, "mecanico.solicitation", thePlayer) outputChatBox ("Você solicitou pagamento para consertar o veículo de "..user, thePlayer, 0, 255, 0, true) outputChatBox (getPlayerName (thePlayer).."#FFFF00 está pedindo $800 para consertar seu veículo. Use /aceitar ou /recusar", theUser, 255, 255, 255, true) mechTimer[thePlayer] = setTimer (function () if isElement(BlipsMEC[theUser]) then destroyElement(BlipsMEC[theUser]) if getElementData (theUser, "mecanico.solicitation") then setElementData (theUser, "mecanico.solicitation", false) outputChatBox ("O pedido de pagamento de "..getPlayerName (thePlayer).."#FFFF00 expirou.", theUser, 255, 255, 0, true) end end end, 10000, 1) end end else outputChatBox("#FF0000Você não tem permissão para executar este comando!", thePlayer, 255, 255, 255, true ) end end addCommandHandler ("reparar", solicitaPay) function aceitaPay (thePlayer, cmd) local mech = getElementData (thePlayer, "mecanico.solicitation") if mech and damagedVehs[thePlayer] and isElement(damagedVehs[thePlayer]) then if getPlayerMoney (thePlayer) >= 2500 and getPedOccupiedVehicle(mech) == damagedVehs[thePlayer] then takePlayerMoney (thePlayer, 2500) givePlayerMoney (mech, 2500) outputChatBox ("Seu pedido foi aceito. Voce recebeu R$2.500 pelo conserto.", mech, 0, 255, 0) fixVehicle (damagedVehs[thePlayer]) damagedVehs[thePlayer] = nil setElementData (thePlayer, "mecanico.solicitation", false) outputChatBox ("Seu veículo foi consertado.", thePlayer, 0, 255, 0) else outputChatBox ("Você não tem dinheiro suficiente.", thePlayer, 255, 0, 0) end end end addCommandHandler ("aceitar", aceitaPay) addEventHandler( "onPlayerQuit", root, function() if damagedVehs[source] then damagedVehs[source] = nil end end ) --- Mensagem /mec function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ); local name = getPlayerName(thePlayer); for _,v in ipairs(getElementsByType("player")) do outputChatBox("#FF0000[AJUDA]#00FF00"..name.." #FFFFFFPrecisa de um MECÂNICO"..message,v, 255, 255, 255, true) end end addCommandHandler("mec", globalMessage); function recusaPay (thePlayer, cmd) if getElementData (thePlayer, "mecanico.solicitation") then outputChatBox ("Seu pedido foi recusado.", getElementData (thePlayer, "mecanico.solicitation"), 255, 0, 0) setElementData (thePlayer, "mecanico.solicitation", false) outputChatBox ("Você recusou o pagamento. Seu veículo não foi consertado.", thePlayer, 255, 0, 0) end end addCommandHandler ("recusar", recusaPay) function marcarplayer(thePlayer, cmd, user) if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ("Mec") ) ~= true then return outputChatBox ("Você não tem permissão para executar este comando!", thePlayer, 255, 0, 0) end if not user then outputChatBox ("Erro: use /marcar <nick>", thePlayer, 255, 255, 0) elseif user and not isElement(getPlayerFromPartialName (user)) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) elseif isElement(getPlayerFromPartialName (user)) then local player = getPlayerFromPartialName (user) BlipsMEC[player] = createBlipAttachedTo (player, 0, 2, 0, 0, 250, 210) outputChatBox ("O cliente "..getPlayerName(player).."#FFFF00 foi marcado no mapa!", thePlayer, 255, 255, 0, true) end end addCommandHandler ("marcar", marcarplayer) 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 addEventHandler ( "onPlayerQuit", root, function ( ) if BlipsMEC[source] then if isElement(BlipsMEC[source]) then destroyElement(BlipsMEC[source]) end BlipsMEC[source] = nil end end )
  10. FUNCIONOU ! Muito obrigado. Agora pra tirar o blip, eu usei o destroyElement(BlipsMEC[source]) na hora do mecanico solicitar, porem o blip não ta sendo removido. Teria como me ajudar ?? function solicitaPay (thePlayer, cmd, user) local accName = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("Mec") ) then if not user then outputChatBox ("Erro de sintaxe, use /reparar <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else local veh = getPedOccupiedVehicle(thePlayer) if not (veh) then return outputChatBox( "Você precisa estar dentro de um veículo", thePlayer, 255, 255, 0 ) end local theUser = getPlayerFromPartialName (user) if getElementData (theUser, "mecanico.solicitation") then outputChatBox ("Alguém já está solicitando pagamento mecânico a este jogador.", thePlayer, 255, 255, 0) else damagedVehs[theUser] = veh setElementData (theUser, "mecanico.solicitation", thePlayer) outputChatBox ("Você solicitou pagamento para consertar o veículo de "..user, thePlayer, 0, 255, 0, true) outputChatBox (getPlayerName (thePlayer).."#FFFF00 está pedindo $800 para consertar seu veículo. Use /aceitar ou /recusar", theUser, 255, 255, 255, true) mechTimer[thePlayer] = setTimer (function () destroyElement(BlipsMEC[source]) if getElementData (theUser, "mecanico.solicitation") then setElementData (theUser, "mecanico.solicitation", false) outputChatBox ("O pedido de pagamento de "..getPlayerName (thePlayer).."#FFFF00 expirou.", theUser, 255, 255, 0, true) end end, 10000, 1) end end else outputChatBox("#FF0000Você não tem permissão para executar este comando!", thePlayer, 255, 255, 255, true ) end end addCommandHandler ("reparar", solicitaPay)
  11. Usei o debug, aparecel algo sobre nill value na linha 100 Precisamente: Attempt to concatenate global 'accName' (a nill value) eu não consegui entender muito bem .. e não entendi isso do valor do user continuar sendo passado if isObjectInACLGroup ("user."..accName, aclGetGroup ("Mec") ) then
  12. E sobre tirar o blip ?Que eu adicionei, porem o script parou de funcionar fizemos os testes.. não marcou function marcarplayer(thePlayer, cmd, user) local user = getPlayerFromPartialName (user) if isObjectInACLGroup ("user."..accName, aclGetGroup ("Mec") ) then if not user then outputChatBox ("Erro: use /marcar <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else BlipsMEC[thePlayer] = createBlipAttachedTo (user, 0, 2, 0, 0, 250, 210) outputChatBox ("O cliente "..getPlayerFromPartialName (user).."#FFFF00 foi marcado no mapa!", thePlayer, 255, 255, 0, true) end else outputChatBox ("Você não tem permissão para executar este comando!", thePlayer, 255, 0, 0) end end addCommandHandler ("marcar", marcarplayer)
  13. Opa, beleza ? Fiz aqui a função usando aquela ajuda que nos deu, mas tivemos dois problemas: Nessa função, o player que está sendo marcado é o mecanico function marcarplayer(thePlayer, cmd, user) local accName = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("Mec") ) then if not user then outputChatBox ("Erro: use /marcar <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else BlipsMEC[thePlayer] = createBlipAttachedTo(thePlayer,0,2,0,0,250,210) outputChatBox ("O cliente "..getPlayerName (thePlayer).."#FFFF00 foi marcado no mapa!", theUser, 255, 255, 0, true) end else outputChatBox ("Você não tem permissão para executar este comando!", thePlayer, 255, 0, 0) end end addCommandHandler ("marcar", marcarplayer) E eu tentei adicionar uma função na solicitaplay de tirar o blip, mas dai nem o script funcionou function solicitaPay (thePlayer, cmd, user) local accName = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..accName, aclGetGroup ("Mec") ) then if not user then outputChatBox ("Erro de sintaxe, use /repararr <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else local veh = getPedOccupiedVehicle(thePlayer) if not (veh) then return outputChatBox( "Você precisa estar dentro de um veículo", thePlayer, 255, 255, 0 ) end local theUser = getPlayerFromPartialName (user) if getElementData (theUser, "mecanico.solicitation") then outputChatBox ("Alguém já está solicitando pagamento mecânico a este jogador.", thePlayer, 255, 255, 0) else damagedVehs[theUser] = veh setElementData (theUser, "mecanico.solicitation", thePlayer) outputChatBox ("Você solicitou pagamento para consertar o veículo de "..user, thePlayer, 0, 255, 0, true) outputChatBox (getPlayerName (thePlayer).."#FFFF00 está pedindo $800 para consertar seu veículo. Use /aceitar ou /recusar", theUser, 255, 255, 255, true) mechTimer[thePlayer] = setTimer (function () destroyElement(BlipsMEC[source]) if getElementData (theUser, "mecanico.solicitation") then setElementData (theUser, "mecanico.solicitation", false) outputChatBox ("O pedido de pagamento de "..getPlayerName (thePlayer).."#FFFF00 expirou.", theUser, 255, 255, 0, true) end end, 10000, 1) end end else outputChatBox("#FF0000Você não tem permissão para executar este comando!", thePlayer, 255, 255, 255, true ) end end addCommandHandler ("reparar", solicitaPay) Se puder me dizer o que fiz de errado e me mostrar uma possivel correção ou algo do tipo, eu ficaria muito grato !
  14. Ok.. vou tentar aqui com aquela dica que você deu. No caso, para a função de desmarcar como eu faria para desativar o blip ??
  15. Olá, eu estou me interessando bastante por script e a melhor forma que achei por agora de aprender foi vendo scripts e tentando entender como eles funcionam e editando. Pessoal, eu e meu amigo @KingBC estamos editando um script de taxi convertendo ele pra uber. Usamos o comando /uber para que o player possa chamar. O problema é que fizemos algumas alterações e não estamos conseguindo ver onde está o erro. Alguém pode ajudar ??? Já criamos o time Uber, e mesmo assim não funcionou. Não sei se tem haver com grupo na ACL, mas creio que não. Script: **Não tiramos os créditos. Não somos os criadores, estamos apenas editando e aprendendo. Já criamos scripts mais simples e ate mesmo alguns mais complexo com ajuda de integrantes aqui do Fórum e agora queremos nos aprofundar ainda mais. -- by manawydan taxi_system lado = server local PrecoTaxi = "1000" local BlipsTaxi = {} addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() if not TimeTaxi then TimeTaxi = createTeam("Uber",20,100,20) end end) function PedirTaxi(thePlayer) if (getElementData(thePlayer,"TaxiClient")) then return end --else if (getPlayerMoney(thePlayer) >= tonumber(PrecoTaxi)) then setElementData(thePlayer,"TaxiClient",true) BlipsTaxi[thePlayer] = createBlipAttachedTo(thePlayer,0,2,0,0,250,210) JogadoresTaxistaTabela(thePlayer) outputChatBox("[Uber]: Seu Uber logo chegara, por favor aguarde.",thePlayer) end end addCommandHandler("uber",PedirTaxi) function JogadoresTaxistaTabela(Player) local Jogadores = getElementsByType("player") for _,Jogad in ipairs(Jogadores) do if (getElementData(Jogad,"Uber")) and (getElementData(Jogad,"TaxistaStat") == vazio) and getPlayerTeam(Jogad) == getTeamFromName("Uber") then local NomeTaxiClient = getPlayerName(Player) outputChatBox("Uber solicitado por: "..NomeTaxiClient,Jogad) end end end function TaxiSystemEntrarNoTaxi(Carro,assento,jacked) if not (getElementModel(Carro) == 420) then return end if not (getElementData(source,"TaxiClient")) then return end if not (assento == 0) then local Taxista = getVehicleController(Carro) if Taxista and getElementData(Taxista,"Uber") and (getPlayerTeam(Taxista) == getTeamFromName("Uber")) then destroyElement(BlipsTaxi[source]) setElementData(Taxista,"TaxistaStat",ocupado) end end end addEventHandler ("onPlayerVehicleEnter",getRootElement(),TaxiSystemEntrarNoTaxi) -- function TaxiSystemSairTaxi(Carro,assento,jacked) if not (getElementModel(Carro) == 420) then return end if not (getElementData(source,"TaxiClient")) then return end if not (assento == 0) then local Taxista = getVehicleController(Carro) if Taxista and getElementData(Taxista,"Uber") and (getPlayerTeam(Taxista) == getTeamFromName("Uber")) then removeElementData(source,"TaxiClient") setElementData(Taxista,"TaxistaStat",vazio) takePlayerMoney(source,tonumber(PrecoTaxi)) givePlayerMoney(Taxista,tonumber(PrecoTaxi)) end end end addEventHandler ("onPlayerVehicleExit",getRootElement(),TaxiSystemSairTaxi) function TaxistaSer(Carro,assento,jacked) if not (getElementModel(Carro) == 420) then return end if (getElementData(source,"Uber")) then return end --not if (getPlayerTeam(source) == getTeamFromName("Uber")) then if (assento == 0) then setElementData(source,"Uber",true) setElementData(source,"TaxistaStat",vazio) outputChatBox("[Uber]: Você agora é um Uber. Fique atento para não perder clientes!",source) end end end addEventHandler ("onPlayerVehicleEnter",getRootElement(),TaxistaSer) Obrigado!
  16. Sem palavras para você! Despertou toda minha vontade de me aprofundar em scripts! Valeu mano, você é fera demais!!!
  17. Nós fizemos! Mas não funcionou. As vezes, com algumas alterações, Ou funciona só a parte do uber ou as vezes só a do cliente que solicita. Código: **Não somos donos do script. Apenas editamos. Não retiramos os créditos.** -- by manawydan taxi_system lado = server local PrecoTaxi = "1000" local BlipsTaxi = {} addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() if not TimeTaxi then TimeTaxi = createTeam("Uber",20,100,20) end end) function PedirTaxi(thePlayer) if (getElementData(thePlayer,"TaxiClient")) then return end --else if (getPlayerMoney(thePlayer) >= tonumber(PrecoTaxi)) then setElementData(thePlayer,"TaxiClient",true) BlipsTaxi[thePlayer] = createBlipAttachedTo(thePlayer,0,2,0,0,250,210) JogadoresTaxistaTabela(thePlayer) outputChatBox("[Uber]: Seu Uber logo chegara, por favor aguarde.",thePlayer) end end addCommandHandler("uber",PedirTaxi) function JogadoresTaxistaTabela(Player) local Jogadores = getElementsByType("player") for _,Jogad in ipairs(Jogadores) do if (getElementData(Jogad,"Uber")) and (getElementData(Jogad,"TaxistaStat") == vazio) and getPlayerTeam(Jogad) == getTeamFromName("Uber") then local NomeTaxiClient = getPlayerName(Player) outputChatBox("Uber solicitado por: "..NomeTaxiClient,Jogad) end end end function TaxiSystemEntrarNoTaxi(Carro,assento,jacked) if not (getElementModel(Carro) == 420) then return end if not (getElementData(source,"TaxiClient")) then return end if not (assento == 0) then local Taxista = getVehicleController(Carro) if Taxista and getElementData(Taxista,"Uber") and (getPlayerTeam(Taxista) == getTeamFromName("Uber")) then destroyElement(BlipsTaxi[source]) setElementData(Taxista,"TaxistaStat",ocupado) end end end addEventHandler ("onPlayerVehicleEnter",getRootElement(),TaxiSystemEntrarNoTaxi) -- function TaxiSystemSairTaxi(Carro,assento,jacked) if not (getElementModel(Carro) == 420) then return end if not (getElementData(source,"TaxiClient")) then return end if not (assento == 0) then local Taxista = getVehicleController(Carro) if Taxista and getElementData(Taxista,"Uber") and (getPlayerTeam(Taxista) == getTeamFromName("Uber")) then removeElementData(source,"TaxiClient") setElementData(Taxista,"TaxistaStat",vazio) takePlayerMoney(source,tonumber(PrecoTaxi)) givePlayerMoney(Taxista,tonumber(PrecoTaxi)) end end end addEventHandler ("onPlayerVehicleExit",getRootElement(),TaxiSystemSairTaxi) function TaxistaSer(Carro,assento,jacked) if not (getElementModel(Carro) == 420) then return end if (getElementData(source,"Uber")) then return end --not if (getPlayerTeam(source) == getTeamFromName("Uber")) then if (assento == 0) then setElementData(source,"Uber",true) setElementData(source,"TaxistaStat",vazio) outputChatBox("[Uber]: Você agora é um Uber. Fique atento para não perder clientes!",source) end end end addEventHandler ("onPlayerVehicleEnter",getRootElement(),TaxistaSer)
  18. beleza.. mas valeu mesmo assim cara !
  19. Assim?? Não precisa de client né? function solicitaPay (thePlayer, cmd, user) if not user then outputChatBox ("Erro de sintaxe, use /consertar <nick>", thePlayer, 255, 255, 0) elseif not getPlayerFromPartialName (user) then outputChatBox ("Jogador não encontrado.", thePlayer, 255, 255, 0) else local theUser = getPlayerFromPartialName (user) if getElementData (theUser, "mecanico.solicitation") then outputChatBox ("Alguém já está solicitando pagamento mecânico a este jogador.", thePlayer, 255, 255, 0) else setElementData (theUser, "mecanico.solicitation", thePlayer) outputChatBox ("Você solicitou pagamento para consertar o veículo de "..user, thePlayer, 0, 255, 0, true) outputChatBox (getPlayerName (thePlayer).."#FFFF00 está pedindo $800 para consertar seu veículo. Use /aceitar ou /recusar", theUser, 255, 255, 255, true) setTimer (function () if getElementData (theUser, "mecanico.solicitation") then setElementData (theUser, "mecanico.solicitation", false) outputChatBox ("O pedido de pagamento de "..getPlayerName (thePlayer).."#FFFF00 expirou.", theUser, 255, 255, 0, true) end end, 10000, 1) end end end addCommandHandler ("consertar", solicitaPay) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "MEC" ) ) then
  20. E como a gente adcionaria o sistema de ACL?
×
×
  • Create New...