Jump to content

wesssley

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by wesssley

  1. Opa @androksi! Tentei fazer isso, mas continuou do mesmo jeito, apenas o piloto do veiculo está caindo para fora do veículo, aparece a mensagem para o jogador que está no passageiro, porém, ele não sai do veiculo igual o piloto. Tentei usar local player = getVehicleOccupant(source,0) na primeira linha após a função no Client, mas não consegui fazer com que todos saíssem do veículo também
  2. Estou com um pequeno problema, estou com um código no qual faço com que se o player não estiver com certo ElementData ele iria ser jogado para fora do veiculo ao bater, porém, só está funcionando para o piloto, o jogador que está no passageiro sem o ElementData continua no veículo, queria uma ajuda sobre isso! (irei colocar apenas o necessário, não a script completa!) Client function handleVehicleDamage(attacker, weapon, loss, x, y, z, tyre) local vehicle = getPedOccupiedVehicle(getLocalPlayer()) if ( moto[getElementModel ( source )] ) then elseif ( boat[getElementModel ( source )] ) then elseif ( air[getElementModel (source )] ) then else if tonumber(loss) > 100 then if getElementData(localPlayer,"remeshok") == "шешілді" then triggerServerEvent("removeMe", vehicle, vehicle) c_lasthealth = getElementHealth(localPlayer) - 15 if c_lasthealth <= 0 then c_lasthealth = 0 end setElementHealth(localPlayer , c_lasthealth) outputChatBox("Você foi jogado para fora do veículo devido a forte batida!", 255,255,255,true) end end end end addEventHandler("onClientVehicleDamage", root, handleVehicleDamage) Server function removerr() if source then local occupants = getVehicleOccupants ( source ) local seats = getVehicleMaxPassengers( source ) if occupants[0] == client then for seat = 0, seats do local occupant = occupants[seat] -- Get the occupant if occupant and getElementType(occupant) == "player" then -- If the seat is occupied by a player... removePedFromVehicle(occupant, vehicle) setPedAnimation( occupant, "dildo", "dildo_hit_3",-1,false,false,true,true) setTimer(setPedAnimation, 5000, 1, occupant) end end end end end addEvent("removeMe", true) addEventHandler("removeMe", getRootElement(), removerr)
  3. Estou tendo que copiar e colar várias vezes o mesmo código para mudar somente a posição, como faço para criar apenas uma tabela onde ficaria todos os markers sem ter que copiar e colar o código direto? Tenho o seguinte código pegarT = createMarker(-2409.32764, -600.28540, 132.64844 -1, "cylinder", 1.1,255,255,255,50) -- Marker Policial createPickup(-2409.32764, -600.28540, 132.64844 , 3, 1247, 1) ------------------------------------------ function salariopm(player) -- Policial if isElementWithinMarker(player, pegarT) then if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)), aclGetGroup ( Grupo1 )) then if getElementData(player, "TrabalhoPolicial") then setElementData(player, "TrabalhoPolicial", false) outputChatBox("Você #ff0000saiu #009affde serviço!", player, 0, 154, 255, true) setElementModel(player, 0) else setElementData(player, "TrabalhoPolicial", true) outputChatBox("Você #006effentrou #009affem serviço, bom trabalho!", player, 0, 154, 255, true) setElementModel(player, 283) end else outputChatBox("Você não tem permissão para isso.", source, 255,0,0, true) end end end addCommandHandler("trabalhar", salariopm) -------------------------------------------- MENSAGEM MARKER POLICIAL addEventHandler("onMarkerHit", pegarT, function(player) if getElementType(player) == "player" then outputChatBox(" ", player, 255,255,255, true) outputChatBox("Para começar a trabalhar, digite #ffff00/trabalhar ", player, 255,255,255, true) outputChatBox(" ", player, 255,255,255, true) end end)
  4. Como faço para abrir uma tabela para markers? para não ficar tendo que copiar e colocar o mesmo script várias vezes? Tenho o seguinte código: pegarT = createMarker(-2409.32764, -600.28540, 132.64844 -1, "cylinder", 1.1,255,255,255,50) -- Marker Policial createPickup(-2409.32764, -600.28540, 132.64844 , 3, 1247, 1) ------------------------------------------ function salariopm(player) -- Policial if isElementWithinMarker(player, pegarT) then if isObjectInACLGroup ( "user." ..getAccountName(getPlayerAccount(player)), aclGetGroup ( Grupo1 )) then if getElementData(player, "TrabalhoPolicial") then setElementData(player, "TrabalhoPolicial", false) outputChatBox("Você #ff0000saiu #009affde serviço!", player, 0, 154, 255, true) setElementModel(player, 0) else setElementData(player, "TrabalhoPolicial", true) outputChatBox("Você #006effentrou #009affem serviço, bom trabalho!", player, 0, 154, 255, true) setElementModel(player, 283) end else outputChatBox("Você não tem permissão para isso.", source, 255,0,0, true) end end end addCommandHandler("trabalhar", salariopm) -------------------------------------------- MENSAGEM MARKER POLICIAL addEventHandler("onMarkerHit", pegarT, function(player) if getElementType(player) == "player" then outputChatBox(" ", player, 255,255,255, true) outputChatBox("Para começar a trabalhar, digite #ffff00/trabalhar ", player, 255,255,255, true) outputChatBox(" ", player, 255,255,255, true) end end) Atualmente oque estou fazendo é copiando e colando, mudando o nome da função e do marker, queria saber como faço para colocar uma tabela com os markers, para não ter que tá fazendo isso e deixando o código longo.
  5. Muito bom, e deixa eu perguntar, em relação a tabela, é possível fazer uma "tabela" na qual ficaria os ids das skins, caso seja mais de uma skin? para o script não ficar com vários " getElementModel(player) == local IDSKIN = { {2}, {122} } e em getElementModel(player) == 0 tentei getElementModel(player) == ..IDSKIN tentei de outras formas porém não consegui fazer de forma alguma (Não sei se tabela é o termo certo pra isso)
  6. Obrigado @Lord Henry e ScriptNovato. Queria tirar outra dúvida, como faço a checagem de skin tambem? Queria fazer o seguinte: Se o jogador possui o ElementData "TrabalhoPolicia" e estiver com certa skin, por exemplo, skin de id 2 ele recebesse certa quantidade de valor depois de um determinado tempo. Tentei getElementModel, mas não consegui, irei colocar o código normal aqui. Dinheiroganho = 5000 PlayersM = 1 function salario (thePlayer) for i,player in ipairs(getElementsByType("player")) do if ( player ) then if getElementData(player, "TrabalhoPolicia") then local players = getPlayerCount() if players >= PlayersM then givePlayerMoney(player,Dinheiroganho) outputChatBox("Você recebeu seu salário", player, 255,0,0, true) -- output teste else outputChatBox("Você não tem recebeu seu salário por não ter mais de 10 players online", player, 255,0,0, true) -- output teste end end end end end setTimer(salario,3000,0) ----- milissegundos
  7. queria saber se é possível obter por algum comando quantas pessoas estão com certo ElementData, alguém poderia me ajudar com isso? Exemplo: tem uma ElementData no meu servidor que seta no player quando o mesmo entra em serviço quando dá certo comando em tal local. O ElementData é "TrabalhoPolicia" Queria saber se através de um comando, como por exemplo "/policiais", tem como mostrar quantos jogadores estão com este ElementData.
  8. Queria por esse chat para somente se a pessoa tem tal element data conseguir visualizar e escrever, ele está por acl, tentei por por element data mais não consegui, entendo um pouco sobre, fiz para aparecer blip e mensagem no chat, porém não consigo fazer um bate papo. ComandoDoChatGlobal = "copom" function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) if ( isPlayerOnGroup ( thePlayer ) ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( isPlayerOnGroup ( player ) ) then conta = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Policial" ) ) then if getElementData ( source, "TrabalhoPolicial", true ) then outputChatBox("#FF0000[Facção#FF0000]#ffffff "..getPlayerName(thePlayer).. "#FF0000:#ffffff "..message, player, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Policial" ) ) then if getElementData ( source, "TrabalhoPolicial", true ) then outputChatBox("#FF0000[Facção#FF0000]#ffffff "..getPlayerName(thePlayer).. "#FF0000:#ffffff "..message, player, 255, 255, 255, true) end end end end end end setElementData ( thePlayer, "Chat:Avisado", true ) setElementData ( thePlayer, "Chat:Delay1",true ) setTimer ( setElementData, 5000, 1, thePlayer, "Chat:Delay1", false ) end addCommandHandler ( ComandoDoChatGlobal, adminchat ) -------------------------------------------------------------------------------------------- function isPlayerOnGroup ( thePlayer ) local account = getPlayerAccount ( thePlayer ) local inGroup = false for _, group in ipairs ( { "Policial" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( "Policial" ) ) then inGroup = true break end end return inGroup end
×
×
  • Create New...