Jump to content

manawydan

Members
  • Posts

    980
  • Joined

  • Last visited

  • Days Won

    1

manawydan last won the day on August 8 2021

manawydan had the most liked content!

4 Followers

Details

  • Location
    Brazil

Recent Profile Visitors

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

manawydan's Achievements

Hard-@ss

Hard-@ss (35/54)

7

Reputation

  1. 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.
  2. de uma olhada no exemplo da wiki: https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup
  3. 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.
  4. 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.
  5. 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
  6. 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
  7. 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)
  8. what you want do? spawn the 5 peds once time?
  9. 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)
  10. vc quer converter as posicoes x,y dos dx?
  11. 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 )
×
×
  • Create New...