Jump to content

hawkbr

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by hawkbr

  1. Opa cara, ajudou demais! Porém ao colocar a função de reparar não funcionou Consegue nos ajudar?? **Também queriamos colocar pra que apenas quem estiver no grupo da ACL "Mecanico" poderia usar este comando. Mas todos pudessem usar o /aceitar ou /recusar. Sabe se tem como?? 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 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) function aceitaPay (thePlayer, cmd) if getElementData (thePlayer, "mecanico.solicitation") then if getPlayerMoney (thePlayer) >= 800 then takePlayerMoney (thePlayer, 800) givePlayerMoney (getElementData (thePlayer, "mecanico.solicitation"), 800) outputChatBox ("Seu pedido foi aceito. Voce recebeu $800 pelo conserto.", getElementData (thePlayer, "mecanico.solicitation"), 0, 255, 0) function fix (playerSource) local theVehicle = getPedOccupiedVehicle (playerSource) if theVehicle and getVehicleController ( theVehicle ) == playerSource then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !" , thePlayer) end end addCommandHandler ("fix" , fix) 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) 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) Valeu DEMAIS!
  2. Então, eu dei uma lida sobre takeplayermoney, mas eu só achei exemplos bem simples. Queriamos fazer um sistema que o Mecanico (jogador) digite: /cobrar [nick] e que apareça no chat do player mencionado assim: [nick mecanico] está cobrando [valorfixo: exemplo:800]Reais pelo trabalho. Para aceitar, digite /aceitar. O mais perto que consegui de achar foi cobrar uma pessoa que está no seu veículo.. eu li sobre takeplayermoney e giveplayermoney mas nao achei nada ajudando.
  3. Hello guys, I would like to know if anyone could help me with the spawn and respawn system on my roleplay mta server? *When I enter the server for the first time, I'm going to the city hall next to the police station in LS. *the problem comes up when I die and instead of going to a hospital, I go to the city hall in the standard spawn. * I die in any city, I return to the LS hospital and after 1 second I go back to the normal spawn in city hall. * Another problem is that I can not remove the car spawn on the map that comes standard with mta. (On spawn locations) *** I'm using GM Play What I wanted for the server is: - Remove Spawn Cars - When I entered the server, the player went to the city hall (next to the police station) in LS. - The player will be moved to the hospital in the city from which he died. (Example): I die in the city of LV, and I go to the hospital of LV Someone to help? I'm using gm play. I'm Very beginner in script Thanks!
×
×
  • Create New...