Jump to content

manawydan

Members
  • Posts

    980
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by manawydan

  1. sorry puedes tentar con: createObject createFire
  2. acredito que seja esse: --[[ BackWeapons script By Gothem Feel free to use and change it as you want, obviously keeping the credit to the creator.--]] local jugadores = {} local lplayer = getLocalPlayer() local info = {} local sx,sy = guiGetScreenSize() function crearArma(jug,arma) local model = obtenerObjeto(arma) local slot = getSlotFromWeapon(arma) jugadores[jug][slot] = createObject(model,0,0,0) setElementCollisionsEnabled(jugadores[jug][slot],false) end function destruirArma(jug,slot) destroyElement(jugadores[jug][slot]) jugadores[jug][slot] = nil end addEventHandler("onClientResourceStart",getResourceRootElement(),function() for k,v in ipairs(getElementsByType("player",root,true)) do jugadores[v] = {} info[v] = {true,isPedInVehicle(v)} end end,false) addEventHandler("onClientPlayerQuit",root,function() if jugadores[source] and source ~= lplayer then for k,v in pairs(jugadores[source]) do destroyElement(v) end jugadores[source] = nil info[source] = nil end end) addEventHandler("onClientElementStreamIn",root,function() if getElementType(source) == "player" and source ~= lplayer then jugadores[source] = {} info[source] = {true,isPedInVehicle(source)} end end) addEventHandler("onClientElementStreamOut",root,function() if jugadores[source] and source ~= lplayer then for k,v in pairs(jugadores[source]) do destroyElement(v) end jugadores[source] = nil info[source] = nil end end) addEventHandler("onClientPlayerSpawn",root,function() if jugadores[source] then info[source][1] = true end end) addEventHandler("onClientPlayerWasted",root,function() if jugadores[source] then for k,v in pairs(jugadores[source]) do destruirArma(source,k) end info[source][1] = false end end) addEventHandler("onClientPlayerVehicleEnter",root,function() if jugadores[source] then for k,v in pairs(jugadores[source]) do destruirArma(source,k) end info[source][2] = true end end) addEventHandler("onClientPlayerVehicleExit",root,function() if jugadores[source] then info[source][2] = false end end) addEventHandler("onClientPreRender",root,function() for k,v in pairs(jugadores) do local x,y,z = getPedBonePosition(k,3) local rot = math.rad(90-getPedRotation(k)) local i = 15 local wep = getPedWeaponSlot(k) local ox,oy = math.cos(rot)*0.22,-math.sin(rot)*0.22 local alpha = getElementAlpha(k) for q,w in pairs(v) do if q == wep then destruirArma(k,q) else setElementRotation(w,0,70,getPedRotation(k)+90) setElementAlpha(w,alpha) if q==2 then local px,py,pz = getPedBonePosition(k,51) local qx,qy = math.sin(rot)*0.11,math.cos(rot)*0.11 setElementPosition(w,px+qx,py+qy,pz) elseif q==4 then local px,py,pz = getPedBonePosition(k,41) local qx,qy = math.sin(rot)*0.06,math.cos(rot)*0.06 setElementPosition(w,px-qx,py-qy,pz) else setElementPosition(w,x+ox,y+oy,z-0.2) setElementRotation(w,-17,-(50+i),getPedRotation(k)) i=i+15 end end end if info[k][1] and not info[k][2] then for i=1,7 do local arma = getPedWeapon(k,i) if arma~=wep and arma>0 and not jugadores[k][i] then crearArma(k,arma) end end end end end) function obtenerObjeto(arma) local m if arma > 1 and arma < 9 then m = 331 + arma elseif arma == 9 then m = 341 elseif arma == 15 then m = 326 elseif (arma > 21 and arma < 30) or (arma > 32 and arma < 39) or (arma > 40 and arma < 44) then m = 324 + arma elseif arma > 29 and arma < 32 then m = 325 + arma elseif arma == 32 then m = 372 end return m end
  3. local Pe = { } Pe.R = {} Pe.L = {} CaminharAgua = function(P,c) local x,y,z = getElementPosition(P) Pe.R[P] = createObject(2001,x,y,z) Pe.L[P] = createObject(2001,x,y,z) --setElementCollisionsEnabled exports [ "bone_attach" ]:attachElementToBone(Pe.R[P],P,20,0,0,-1) exports [ "bone_attach" ]:attachElementToBone(Pe.L[P],P,19,0,0,-1) outputChatBox("lol",P) end addCommandHandler("agua",CaminharAgua) i try, but no work, with -1 and 0 any help?
  4. acredito que seja apenas usar getElementModel()
  5. Thanks guys, I'll try.
  6. addEvent("tiredAnimation",true) addEventHandler("tiredAnimation",root,function(target) setPedAnimation ( target, "FAT", "IDLE_tired", -1, true, false ) setElementData(target, "tired", true) toggleControl(target,'sprint',false) setTimer(triggerEvent, 10000, 1, "switchToNormal", root, target ) end) event 'switToNormal" use toggleControl? if not, use toggleControl(target,'sprint',true) try
  7. manawydan

    Water walk

    it is possible to walk on water? any idea how to do? thank you!
  8. addEventHandler("onPlayerJoin",root, function() toggleControl(source,"sprint",false) end) try
  9. toggleControl("sprint",false) cliente side for all
  10. try( no tested) function onPlayerJoin() local joinedPlayerName = getPlayerName ( source ) setCameraMatrix(source, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) setTimer(function() setCameraTarget(source)end,5000,1) end addEventHandler("onPlayerJoin",root,onPlayerJoin)
  11. setPedAnimation setPedControlState setTimer i think
  12. try (example) ZombieKill = 0 function teste() for i=1,50 do exports [ "zombies" ]:createZombie(x+math.random(-4,4),y+math.random(-4,4),z) end end addEventHandler("onZombieWasted",root, function() if (ZombieKill ~= 30) then ZombieKill = ZombieKill+1 else ZombieKill = 0 teste() end end)
  13. ola, queria saber se tem como checar quando um jogador se agacha. To tentando atacha um chapeu "objeto" no jogador, e quando ele se abacha o chapeu não muda de posição. Alguma ideia? obrigado!
  14. tente da restart na hud (pode ser que a hud do gta apareça quando spawna)
  15. try CrateMarker = createMarker(unpack(BoxPos[math.random(1,3)]),"cylinder")
  16. opa amigo, lua não é dificil não, a sintaxe é bem mais simples que muitas linguagens. Eu nunca "scriptei" nada, e vi uns links que o pessoal daqui da comunidade passou e a wiki, agora ja consigo faze alguns scripts, basta tem um pouco de tempo e dedicação, boa sorte! http://www.lua.org/manual/5.1/pt/manual.html
  17. group exports [ "heroinventory" ]:addInventoryGroup( "Weapons", "Weapons.png" ) item you change "g_items" table
  18. Boa sorte stanley ( só n te ajudo pq n posso, tenho um server de zombie e nem host tem)
×
×
  • Create New...