manawydan

Members
  • Content Count

    988
  • Joined

  • Last visited

Community Reputation

5 Neutral

3 Followers

About manawydan

  • Rank
    Hard-@ss

Details

  • Location
    Brazil

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Então amigo começe sempre pela logica e vai avançando aprendendo as funções e eventos do mta, tenho alguns tutoriais bem antigos e simples sobre o assunto: https://www.youtube.com/watch?v=olko71e17qk&list=PLEXOFsnCDCeur5-7EctjCxfxyFkmb9nBq https://www.youtube.com/watch?v=Pcl1ISGa19s&list=PLEXOFsnCDCetyG8OAKLkbQ7DnyRYiHU9c
  2. em lua todo if tem um then e um end para limitar o corpo da função, eu tenho uns tutorias de lua no youtube se achar necessario pode ve-los e tambem uma pequena série sobre mta sa.
  3. de uma olhada no exemplo da wiki: https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup
  4. a funcao get é apenas para o lado do server, mas vc pode usar o get pelo server e usar um setElementData no root, para poder pelo client usar getElementData e retornar o valor da setings, essa é uma das formas, vc pode utilizar triggers tambem.
  5. Eai pessoal blz? fiz um video simples falando sobre logica de programação e lua. se tudo der certo embreve faço a parte 2.
  6. you can use my code or edit Bonus code like this: local peds = { [1] = {1067.0164794922, 2035.6273193359, 10.8203125, 90}, [2] = {1067.0299072266, 2041.1890869141, 10.8203125, 90}, [3] = {-2067.029296875, 2035.0201416016, 9.8203125,90}, [4] = {2067.0295410156, 1032.1505126953, 10.8203125,90}, [5] = {1067.0295410156, 2027.8729248047, 10.8203125,90} } local createdPeds = {} addEventHandler("onResourceStart", resourceRoot, function () for i=1, 3 do local x,y,z,rot = getRandomizePos() -- now you can use x,y,z,rot variables local ped = createPed (0,x,y,z,rot) --createBlip(x,y,z) end end) function getRandomizePos() local rnd = math.random ( #peds ) while createdPeds[rnd] do rnd = math.random ( #peds ) end table.insert(createdPeds,rnd) local x,y,z,rot = peds[rnd][1],peds[rnd][2],peds[rnd][3],peds[rnd][4] return x,y,z,rot end
  7. i make some changes now work: local repeteadIndex = {} local peds = { [1] = {x=1067.0164794922,y=2035.6273193359, z=10.8203125, rot=90}, [2] = {x=1067.0299072266,y=2041.1890869141, z=10.8203125, rot=90}, [3] = {x=-2067.029296875,y=2035.0201416016, z=9.8203125,rot=90}, [4] = {x=2067.0295410156,y=1032.1505126953, z=10.8203125,rot=90}, [5] = {x=1067.0295410156,y=2027.8729248047, z=10.8203125,rot=90} -- the last dont have , } function getRandomizePos() local i repeat i = math.random(#peds) until(table.contains(repeteadIndex,i)==false) table.insert(repeteadIndex,i) local x,y,z,r = peds[i]["x"],peds[i]["y"],peds[i]["z"],peds[i]["rot"] outputChatBox("index: "..i.." value x: "..x.." y: "..y.." z: "..z.." rot: "..r) return x,y,z,r end function table.contains(t,value) for k,v in pairs(t) do if(v==value)then return true end end return false end addEventHandler("onResourceStart", resourceRoot, function () for i=1,3 do local x,y,z,rot = getRandomizePos() local ped = createPed(0,x,y,z,rot) end end) but Bonus code is better
  8. try this no tested: local repeteadIndex = {} local peds = { [1] = {x=1067.0164794922,y=2035.6273193359, z=10.8203125, rot=90}, [2] = {x=1067.0299072266,y=2041.1890869141, z=10.8203125, rot=90}, [3] = {x=-2067.029296875,y=2035.0201416016, z=9.8203125,rot=90}, [4] = {x=2067.0295410156,y=1032.1505126953, z=10.8203125,rot=90}, [5] = {x=1067.0295410156,y=2027.8729248047, z=10.8203125,rot=90} -- the last dont have , } function getRandomizePos() local i repeat i = math.random(#peds) until(table.contains(repeteadIndex,i)==false) table.insert(repeteadIndex,i) local x,y,z,r = peds[i]["x"],peds[i]["y"],peds[i]["z"],peds[i]["rot"] outputChatBox("index: "..i.." value x: "..x.." y: "..y.." z: "..z.." rot: "..r) return x,y,z,r end function table.contains(t,value) for k,v in pairs(t) do if(v==value)then return true end end return false end addEventHandler("onResourceStart", resourceRoot, function () for i=1,3 do local x,y,z,rot = getRandomizePos() peds = createPed(0,x,y,z,rot) end end)
  9. what you want do? spawn the 5 peds once time?
  10. try this: local peds = { [1] = {x=1067.0164794922,y=2035.6273193359, z=10.8203125, rot=90}, [2] = {x=1067.0299072266,y=2041.1890869141, z=10.8203125, rot=90}, [3] = {x=-2067.029296875,y=2035.0201416016, z=9.8203125,rot=90}, [4] = {x=2067.0295410156,y=1032.1505126953, z=10.8203125,rot=90}, [5] = {x=1067.0295410156,y=2027.8729248047, z=10.8203125,rot=90} -- the last dont have , } function getRandomizePos() local i = math.random(#peds) local x,y,z,r = peds[i]["x"],peds[i]["y"],peds[i]["z"],peds[i]["rot"] outputChatBox("index: "..i.." value x: "..x.." y: "..y.." z: "..z.." rot: "..rot) return x,y,z,r end addEventHandler("onResourceStart", resourceRoot, function () local x,y,z,rot = getRandomizePos() peds = createPed(0,x,y,z,rot) end)
  11. vc quer converter as posicoes x,y dos dx?
  12. manawydan

    vehicle damage

    try this: function vehicledamaged (thePlayer) -- source is the vehicle setVehicleDamageProof (source, false) -- damagable fixVehicle (source) end addEventHandler ( "onVehicleEnter", getRootElement(), vehicledamaged ) function vehicleundamaged (thePlayer) setVehicleDamageProof (source, true) -- not damagable fixVehicle (source) end addEventHandler ( "onVehicleExit", getRootElement(), vehicleundamaged )