Jump to content

MrDante

Members
  • Posts

    176
  • Joined

  • Last visited

Everything posted by MrDante

  1. Olá Galera, estou com um problema de xml, eu queria que o elemento da xml name, mostraria todos em uma gridlist, porém ele não aparece na grid e não mostra nenhum erro no debugscript. Sou novo em xml, nunca usei. Se puderem me ajudar ficaria grato! Client: local Grid2 = guiCreateGridList(botX+sizeX+443, botX2+sizeX2+275, 188, 190, false) function vtrs.abrirpmesp (_, estado) if painelpmesp[1] == true and painelpmesp[2] == false then if estado == "down" then if isCursorOnElement(botX+sizeX+210, botX2+sizeX2+289, 210, 32) then setTimer( function () Gridlist:SetVisible(true) end, 2000, 1) local xml = xmlLoadFile("Arquivos/Xml/Veiculos.xml") for _, group in ipairs (xmlNodeGetChildren(xml)) do local id = xmlNodeGetAttribute(group, "id") local veh = xmlNodeGetAttribute(group, "name") guiGridListSetItemText(Grid2, guiGridListGetSelectedItem(Grid2), 1, veh, false, false) end painelpmesp[2] = true painelpmesp[3] = false painelpmesp[4] = false tick = getTickCount() addEventHandler("onClientRender", root, painelcdvpmesp2) removeEventHandler("onClientRender", root, painelcdvpmesp3) removeEventHandler("onClientRender", root, painelcdvpmesp5) playSound("Arquivos/Sons/click.mp3") end end end end addEventHandler("onClientClick", root, vtrs.abrirpmesp) XML: "490" name = "CAR 1" /> "490" name = "CAR 2" /> "490" name = "CAR 3" />
  2. Isso é porque seu raidcall está ligado, para desativar, feche o raidcall e inicie novamente.
  3. Hello Guys, I have Problem. Sorry my bad english I've never used xml anything, I would get all elements name and put in a Gridlist, but by adding to it there are no mistakes, only not appear on the grid If you can help me I will be grateful Client local Grid2 = guiCreateGridList(botX+sizeX+443, botX2+sizeX2+275, 188, 190, false) function vtrs.abrirpmesp (_, estado) if painelpmesp[1] == true and painelpmesp[2] == false then if estado == "down" then if isCursorOnElement(botX+sizeX+210, botX2+sizeX2+289, 210, 32) then setTimer( function () Gridlist:SetVisible(true) end, 2000, 1) local xml = xmlLoadFile("Arquivos/Xml/Veiculos.xml") for _, group in ipairs (xmlNodeGetChildren(xml)) do local id = xmlNodeGetAttribute(group, "id") local veh = xmlNodeGetAttribute(group, "name") guiGridListSetItemText(Grid2, guiGridListGetSelectedItem(Grid2), 1, veh, false, false) end painelpmesp[2] = true painelpmesp[3] = false painelpmesp[4] = false tick = getTickCount() addEventHandler("onClientRender", root, painelcdvpmesp2) removeEventHandler("onClientRender", root, painelcdvpmesp3) removeEventHandler("onClientRender", root, painelcdvpmesp5) playSound("Arquivos/Sons/click.mp3") end end end end addEventHandler("onClientClick", root, vtrs.abrirpmesp) Xml "490" name = "ROX GOSTOSO" /> "490" name = "PRF GddsaO" /> "490" name = "RsaasaasddaTOSO" />
  4. Voce pode utilizar interpolateBetween. exemplo: tick = getTickCount() local cor1, cor2, cor3 = interpolateBetween(math.random(0, 255), math.random(0,255), math.random(0, 255), math.random(0, 255), math.random(0,255), math.random(0, 255), getTickCount()-tick/9000, "Cosinecurve" ) -- Essa função vai ficar sorteado valores de 0 a 255, para usar em dxDrawImage, basta tentar: dxDrawImage(0, 0, 0, 0, "Imagem", 0, 0, 0, tocolor(cor1, cor2, cor3, 255)) Espero que tenha funcionado, pois eu não testei, boa sorte amigão
  5. so, you need destroy two vehicles. when tow player hit mark2? not, it destroys, but it was only to destroy those who enter the marker, not everyone who took the vehicle but already decided, the script is not mine, I tested because my friend was in trouble .. I realize when, who was destroying was restartResource I am a very sluggish person
  6. When two players enter, and go to the mark2 as a result was to destroy the vehicle of those in marker, but when two players, destroy the two vehicles understood?
  7. Friend, you edited a part that does not matter in this topic.
  8. Sorry my bad english Guys is this, I'm kind of horrible mess with tables as there are always mistakes: lol: So wanted to make the player caught the vehicle, typing the command / trabalharaqui, and goes toward another marker after getting it the vehicle destroys, but if two players, if you get to the marker, will destroy your and the other player .. I'm debating about that a long time, someone could help? local marker = createMarker (2211, -2506, 12.8, "cylinder", 1, 255,0,0,255) local mark2 = createMarker (667, -615, 16, "cylinder", 4, 255,0,0,255) local blip = createBlip(667, -615, 17, 0) createBlip (2211, -2506, 12.8, 51) setElementVisibleTo(mark2, root, false) setElementVisibleTo(blip, root, false) veh = {} function entrarmarker(Jogador) if(isElement(Jogador)) and (getElementType(Jogador) == "player") then if (not isPedInVehicle(Jogador)) then if veh[Jogador] and isElement(veh[Jogador]) then destroyElement(veh[Jogador]) veh[Jogador] = nil end veh[Jogador] = createVehicle ( 408, 2200, -2509, 12.5 + 10 ) end end end addEventHandler("onMarkerHit", marker, entrarmarker) function commandMarker(Jogador) if isElementWithinMarker(Jogador, marker) then setElementData(Jogador, "trab", true) warpPedIntoVehicle(Jogador, veh[Jogador]) setElementVisibleTo(mark2, Jogador, true) setElementVisibleTo(blip, Jogador, true) end end addCommandHandler("trabalharaqui", commandMarker) function des (Jogador) if(isElement(Jogador)) and (getElementType(Jogador) == "player") then if getElementData(Jogador, "trab") then if veh[Jogador] and isElement(veh[Jogador]) then destroyElement (veh[Jogador]) end destroyElement(marker) setElementVisibleTo(mark2, Jogador, false) outputChatBox ( "#ff0000PARAB?NS VOC? TERMINOU A ENTREGA DE LIXO E GANHOU 500$ !", source, 255,255,255, true) givePlayerMoney ( Jogador, 500) removeElementData(Jogador, "trab") setTimer(function() restartResource(getThisResource()) end, 100, 1) end end end addEventHandler( "onMarkerHit", mark2, des) And I'd like someone to explain, why create something on the table with the player element, you can use another name? example: veh = {} veh["veiculo"] = createVehicle...;
  9. Galera é o seguinte, sou meio horrivel em mexer com tabelas, pois sempre há erros Assim, queria fazer com que o Jogador pegasse o veiculo, ao digitar o comando /trabalharaqui, e vai em direção a outro marker, após chegar la o veiculo destroi, porém se estiver dois jogadores, se você chegar ao marker, irá destruir o seu e o do outro Jogador.. Estou me debatendo com isso faz um bom tempo, alguem poderia ajudar? local marker = createMarker (2211, -2506, 12.8, "cylinder", 1, 255,0,0,255) local mark2 = createMarker (667, -615, 16, "cylinder", 4, 255,0,0,255) local blip = createBlip(667, -615, 17, 0) createBlip (2211, -2506, 12.8, 51) setElementVisibleTo(mark2, root, false) setElementVisibleTo(blip, root, false) veh = {} function entrarmarker(Jogador) if(isElement(Jogador)) and (getElementType(Jogador) == "player") then if (not isPedInVehicle(Jogador)) then if veh[Jogador] and isElement(veh[Jogador]) then destroyElement(veh[Jogador]) veh[Jogador] = nil end veh[Jogador] = createVehicle ( 408, 2200, -2509, 12.5 + 10 ) end end end addEventHandler("onMarkerHit", marker, entrarmarker) function commandMarker(Jogador) if isElementWithinMarker(Jogador, marker) then setElementData(Jogador, "trab", true) warpPedIntoVehicle(Jogador, veh[Jogador]) setElementVisibleTo(mark2, Jogador, true) setElementVisibleTo(blip, Jogador, true) end end addCommandHandler("trabalharaqui", commandMarker) function des (Jogador) if(isElement(Jogador)) and (getElementType(Jogador) == "player") then if getElementData(Jogador, "trab") then if veh[Jogador] and isElement(veh[Jogador]) then destroyElement (veh[Jogador]) end destroyElement(marker) setElementVisibleTo(mark2, Jogador, false) outputChatBox ( "#ff0000PARAB?NS VOC? TERMINOU A ENTREGA DE LIXO E GANHOU 500$ !", source, 255,255,255, true) givePlayerMoney ( Jogador, 500) removeElementData(Jogador, "trab") setTimer(function() restartResource(getThisResource()) end, 100, 1) end end end addEventHandler( "onMarkerHit", mark2, des) E gostaria que alguem explicasse, o porque criar algo em tabela com o elemento jogador, pode usar outro nome? exemplo: veh = {} veh["veiculo"] = createVehicle...;
  10. Tente isso function SpawnDayZSanchez(thePlayer) if veh and isElement(veh) then -- Se o veiculo existir, em seguida destroyElement(veh) -- vai destruir o elemento veiculo end local x, y, z = getElementPosition(thePlayer) veh = createVehicle(468, x + 5, y, z) vehCol = createColSphere(x + 5, y, z, 4) attachElements(vehCol, veh, 0, 0, 0) setElementData(vehCol, "parent", veh) setElementData(veh, "parent", vehCol) setElementData(vehCol, "vehicle", true) setElementData(vehCol, "MAX_Slots", 6) local tires, engine, parts = getVehicleAddonInfos(getElementModel(veh)) setElementData(vehCol, "Tire_inVehicle", 2) setElementData(vehCol, "Engine_inVehicle", 1) setElementData(vehCol, "Parts_inVehicle", 1) setElementData(vehCol, "spawn", { 468, x, y, z }) setElementData(vehCol, "fuel", 30) end addCommandHandler("sanchez", SpawnDayZSanchez) vehicleAddonsInfo = { { 468, 2, 1, 1 } } function getVehicleAddonInfos(id) for i, veh in ipairs(vehicleAddonsInfo) do if veh[1] == id then return veh[2], veh[3], veh[4] end end end vehicleFuelInfo = { {468, 0.1} } function getVehicleAddonInfos(id) for i, veh in ipairs(vehicleAddonsInfo) do if veh[1] == id then return veh[2], veh[3], veh[4] end end end vehicleFuelTable = { {468, 80} } function getVehicleMaxFuel(loot) local modelID = getElementModel(getElementData(loot, "parent")) for i, vehicle in ipairs(vehicleFuelTable) do if modelID == vehicle[1] then return vehicle[2] end end return false end function onPlayerEnterDayzVehicle(veh, seat) local col = getElementData(dayZVeh, "parent") local id = getElementModel(dayZVeh) if not seat == 1 then return end local tires, engine, parts = getVehicleAddonInfos(id) setVehicleEngineState(dayZVeh, false) setElementData(dayZVeh, "maxfuel", getVehicleMaxFuel(col)) setElementData(dayZVeh, "needtires", tires) setElementData(dayZVeh, "needengines", engine) setElementData(dayZVeh, "needparts", parts) if getElementData(col, "Tire_inVehicle") or 0 < tonumber(tires) then setVehicleEngineState(dayZVeh, false) return end if getElementData(col, "Engine_inVehicle") or 0 < tonumber(engine) then setVehicleEngineState(dayZVeh, false) return end if not getElementData(col, "Parts_inVehicle") then setElementData(col, "Parts_inVehicle", math.random(0, parts)) end if getElementData(col, "fuel") or 1 >= 0 and not getElementModel(dayZVehBob) == 509 then triggerClientEvent(source, "displayClientInfo", source, "Vehicle", "No tank left in this vehicle!", 22, 255, 0) setVehicleEngineState(dayZVehBob, false) return end end
  11. Amigo, até eu que sou o dono do sistema irei de ajudar, então, voce quer usar o primeiro segundo do animation if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Policia") ) then -- Acl Pra Quem Pode Usar o Comando local player_a_ser_algemado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName ( player_a_ser_algemado ) local nick_do_policial = getPlayerName ( thePlayer ) setElementData(player_a_ser_algemado,"algemado", nick_do_jogador) -- Elemento Data setPedAnimation( player_a_ser_algemado, "ped", "pass_Smoke_in_car", 1000, true, true, true, false) -- mudei o argumento para 1000, que de miliseconds convertidos daria 1 segundo, caso você queira deixar em looping, o argumento 5 fará isso, e argumento 6 um update position, para ficar a animação freezada naquele tempo toggleAllControls(player_a_ser_algemado, false) -- Freezar jogador toggleControl(player_a_ser_algemado, "chatbox", true) Espero ter ajudado, caso não der certo me chame pois não o testei o code!
  12. stolen: https://community.multitheftauto.com/in ... s&id=13129 original: https://community.multitheftauto.com/in ... ls&id=6561 DONE
  13. Aleais, esse code não é vazado, e sim eu disponibilizei o mod descompilado
  14. Obg, eu consegui fazer isso, porem tem outro porem, eu tem uma parte desse script que ele edita o value com guiSetText, pensei na função set porém, pelo que entendi, ele usa settings por xml, xml eu não tenho conhecimento existe outra forma para editar?
  15. Olá galera, mais uma vez, é o seguinte, estou querendo fazer um sistema de senha para abrir um tal painel, porém na forma de settings só que, não sei o que acontece que não reconhece no lado do client, pelo que eu sei não necessita ser de um lado side só alguém sabe o que ocorre? No meta '*senhabase' value='ebbiscoito90' friendlyname='Senha Base' /> Client local Senha = get("senhabase") function abrirgerenciador (_,state) if painel == true then if state == "down" then if isCursorOnElement (193, 478, 42, 21) then if guiGetText(edit) == Senha then guiSetVisible(gridlist, true) guiSetVisible(edit2, true) guiSetVisible(edit3, true) guiSetVisible(edit4, true) addEventHandler ("onClientRender", root, gerenciador) else outputChatBox ( "#f00000Senha Incorreta se Persistir será Banido", 231, 217, 176, true ) end end end end end addEventHandler ("onClientClick", root, abrirgerenciador)
  16. attachElement(source. Obj), and this point in this function? It would not be a comma? and this ID? Where's the object ID?
  17. Galera, existe alguma forma de que todos os comandos são bloqueado, menos um que você possa digitar? exemplo, o jogador pode digitar /suborno, mas se ele digitar /cj não vai funcionar. Existe ou não?, eu fiz uma função de bloquear comandos, mas só quero que um comando funcione Função: function bloqsay(commandName) if (commandName ~= 'say') then cancelEvent() end end addEventHandler("onPlayerCommand", root, bloqsay)
  18. Vou testar... mas poderia me explicar o que essa função faz? Só por curiosidade if ( getPlayerMoney ( thePlayer ) >= ( tonumber ( amount ) or math.huge ) )
  19. Me desculpa mais, a função de oferecer eu não entendi nada Eu tentei isso: subornos = {} function subornarpolicial (thePlayer, _, nick, amount) if nick then if getPlayerFromPartialName ( nick ) then if amount then local money_player = getPlayerMoney(thePlayer) if (money_player > 0) then local nick_do_policial = getPlayerName(thePlayer) subornos[ nick ] = { thePlayer, amount } local policial_a_ser_subornado = getPlayerFromPartialName ( nick ) local nick_do_jogador = getPlayerName(policial_a_ser_subornado) if getElementData(thePlayer, "algemado") or getElementData(thePlayer, "navtr") then outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1O Jogador algemado lhe ofereceu "..money_suborno.." para você liberar ele, digite /aceitarsuborno para aceitar ou /recusarsuborno para recusar.", policial_a_ser_subornado, 255, 255, 255,true) setElementData(policial_a_ser_subornado, "subornado", true) else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você precisa estar preso ou algemado para executar este comando!", thePlayer, 255, 255, 255, true) end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Você não tem dinheiro suficiente!", thePlayer, 255, 255, 255, true) end end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Comando correto: /suborno nick_do_policial total_de_dinheiro!", thePlayer, 255, 255, 255, true) end else outputChatBox("#000000[#ff0000POLICIA#000000] #c1c1c1Comando correto: /suborno nick_do_policial total_de_dinheiro!", thePlayer, 255, 255, 255, true) end end addCommandHandler ('suborno', subornarpolicial) function aceitar_suborno(thePlayer) if subornos[thePlayer] then local subornoInfo = subornos[thePlayer] takePlayerMoney ( subornoInfo[1], subornoInfo[2] ); outputChatBox ( "O policial aceitou seu suborno ! Você perdeu $" .. subornoInfo[2], subornoInfo[1], 0, 255, 0 ); subornos[thePlayer] = nil; else -- ninguem esta subornando o jogador. end addCommandHandler("aceitarsuborno", aceitar_suborno)
  20. Entendi. mas então, o ultimo codigo vai ser outra função, que ainda não mexi mas acredito que seria mais ou menos assim, criei um Elemento Data para o policial, agora uso ela na outra funçao function aceitar_suborno(thePlayer, _, nick, amount) if getElementData(thePlayer, "subornado") then takePlayerMoney(nick, tonumber(amount)) removeElementData(thePlayer, "subornado") end end addCommandHandler("aceitarsuborno", aceitar_suborno) não sei se está certo, foi só um teste
×
×
  • Create New...