Jump to content

Maruchan

Members
  • Posts

    91
  • Joined

  • Last visited

Everything posted by Maruchan

  1. I have problems with this code, the problem happens that the passenger can be lowered even if he is wearing a seat belt. Everything else works fine. local SizeX, SizeY = guiGetScreenSize() local px,py = 1680,1050 local x,y = (SizeX/px), (SizeY/py) local Fade = true local Pulso = 0 -- Cinturón local key = "B" local interval = 1.05 local moto = { [522]=true,[521]=true,[461]=true,[462]=true,[463]=true, [586]=true,[581]=true,[468]=true,[471]=true,[523]=true, [448]=true,[481]=true,[510]=true,[509]=true } local boat = { [430]=true,[446]=true,[452]=true,[453]=true,[454]=true, [472]=true,[473]=true,[484]=true,[493]=true,[595]=true } local air = { [417]=true,[425]=true,[447]=true,[460]=true,[469]=true, [476]=true,[487]=true,[488]=true,[497]=true,[511]=true, [512]=true,[513]=true,[519]=true,[520]=true,[548]=true, [553]=true,[563]=true,[577]=true,[592]=true,[593]=true } function toggleRemen() if getElementInterior(getLocalPlayer()) == 0 and getElementDimension(getLocalPlayer()) == 0 then local veh = getPedOccupiedVehicle(getLocalPlayer()) if veh then if (moto [getElementModel (veh)]) then elseif (boat [getElementModel (veh)]) then elseif (air [getElementModel (veh)]) then else if Fade then Pulso = Pulso - 20 if (Pulso <= 0) then Pulso = 0 Fade = false end else Pulso = Pulso + 20 if (Pulso >= 255) then Pulso = 255 Fade = true end end if getElementData(getLocalPlayer(),"remeshok") == "Cinturón_abrochado" then dxDrawImage(SizeX - 410,SizeY - 83, 30, 22,"Imagenes/Vehiculos/con-cinturon.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) setElementData(getLocalPlayer(),"remeshok","Cinturón_desabrochado") triggerEvent("Información", getLocalPlayer(), "Inventory", "¡Cinturón desabrochado!", 0, 255, 0) else setElementData(getLocalPlayer(),"remeshok","Cinturón_abrochado") triggerEvent("Información", getLocalPlayer(), "Inventory", "¡Cinturón abrochado!", 0, 255, 0) dxDrawImage(SizeX - 410,SizeY - 83, 30, 22,"Imagenes/Vehiculos/sin-cinturon.png",0.0,0.0,0.0,tocolor(255,255,255,Pulso),false) end end end end end bindKey(key, "down", toggleRemen) addCommandHandler("cinturon", toggleRemen) addEvent("Denegar",true) addEventHandler("Denegar",getRootElement(),function() playSound("Sonidos/Denegar/Denegar.mp3") end) function updateCamera() if getElementInterior(getLocalPlayer()) == 0 and getElementDimension(getLocalPlayer()) == 0 then local veh = getPedOccupiedVehicle(getLocalPlayer()) if veh then if (moto [getElementModel (veh)]) then elseif (boat [getElementModel (veh)]) then elseif (air [getElementModel (veh)]) then else if Fade then Pulso = Pulso - 20 if (Pulso <= 0) then Pulso = 0 Fade = false end else Pulso = Pulso + 20 if (Pulso >= 255) then Pulso = 255 Fade = true end end if getElementData(getLocalPlayer(),"remeshok") == "Cinturón_abrochado" then dxDrawImage(SizeX - 410,SizeY - 83, 30, 22,"Imagenes/Vehiculos/con-cinturon.png",0.0,0.0,0.0,tocolor(255,255,255,255),false) else dxDrawImage(SizeX - 410,SizeY - 83, 30, 22,"Imagenes/Vehiculos/sin-cinturon.png",0.0,0.0,0.0,tocolor(255,255,255,Pulso),false) end end else setElementData(getLocalPlayer(),"remeshok","Cinturón_desabrochado") end end end addEventHandler("onClientRender", root, updateCamera) function handleVehicleDamage(attacker, weapon, loss, x, y, z, tyre) local player = getVehicleOccupant(source,0) if (moto [getElementModel (source)]) then elseif (boat [getElementModel (source)]) then elseif (air [getElementModel (source)]) then else if tonumber(loss) > 170 then if getElementData(getLocalPlayer(),"remeshok") == "Cinturón_desabrochado" then triggerServerEvent("removeMe", player, player) end end end end addEventHandler("onClientVehicleDamage", root, handleVehicleDamage) setTimer(function() local veh = getPedOccupiedVehicle(getLocalPlayer()) if veh then if getElementData(getLocalPlayer(),"remeshok") == "Cinturón_desabrochado" then if (moto [getElementModel (veh)]) then elseif (boat [getElementModel (veh)]) then elseif (air [getElementModel (veh)]) then else playSound("Sonidos/Alarma-cinturon/Cinturon.mp3",false) end end end end, interval * 1000 , 0)
  2. Solo vengo hacer una simple pregunta, relacionado con servidores DAYZ. Tengo un problema que cada vez que spawneo un auto ya sea por medio de un panel o de un comando, y tengo que resetar mi servidor porque ando testeando cosas, los autos se me duplican. Realmente no tengo ni la menor idéa de que podría ser, quizás alguno de ustedes mas expertos en DAYZ sepa guiarme para tener una noción por donde buscar . ¡Desde ya mil disculpas por las molestías que este post pueda ocasionar!
  3. Ya logré hacerlo, de todos modos muchas gracias por tu preocupación.
  4. People the messages are not displayed ... what is wrong ?, I need your help to fix it. local Fade = true local Pulso = 0 Textos = {} function startRollMessage(text,r,g,b) mensaje = true table.insert(Textos,{text,r,g,b}) checkTimers() if #Textos == 2 then table.remove(Textos,1) end end addEvent("onRollMessageStart",true) addEventHandler("onRollMessageStart",getLocalPlayer(),startRollMessage) function startRollMessage2(head,text,r,g,b) mensaje = true table.insert(Textos,{text,r,g,b}) checkTimers() if #Textos == 2 then table.remove(Textos,1) end end addEvent("Información", true) addEventHandler("Información",getLocalPlayer(),startRollMessage2) destruir = false function DestruirTexto () destruir = true end TiempoDelTexto = {} function checkTimers() if isTimer(TiempoDelTexto["destroy"]) then killTimer(TiempoDelTexto["destroy"]) end TiempoDelTexto["destroy"] = setTimer(DestruirTexto,5000,1) end SIDE = 50 toYpos = 0 function MensajesDx() if Fade then Pulso = Pulso - 20 if (Pulso <= 0) then Pulso = 0 playerBlipFade = false end else Pulso = Pulso + 20 if (Pulso >= 255) then Pulso = 255 Fade = true end end Textos = {} -- AGREGADO if mensaje == true then x,y = guiGetScreenSize() for i,data in next,(Textos) do length = dxGetTextWidth(data[1],1.0,"default-bold") dxDrawRectangle(x*0.450-length/2,y*0.000-SIDE+toYpos,x*0.100+length,y*0.010,tocolor(255, 0, 0, Pulso)) dxDrawRectangle(x*0.450-length/2,y*0.010-SIDE+toYpos,x*0.100+length,y*0.025,tocolor(0, 0, 0)) dxDrawText(data[1],x*0.900,y*0.014-SIDE+toYpos,x*0.100,y*0.100,tocolor(255, 255, 255, math.random(200,255)),1,"default-bold","center") if destruir == false then for to = 1,10 do toYpos = toYpos + 0.50 if toYpos >= 60 then toYpos = 60 end end end -- if destruir == true then for to = 1,10 do toYpos = toYpos - 0.50 if toYpos <= 0 then toYpos = 0 mensaje = false destruir = false end end end -- end end end addEventHandler("onClientRender",getRootElement(),MensajesDx) if fileExists("Barra-cliente.lua") == true then fileDelete("Barra-cliente.lua") end
  5. What I would like is for the weather to be logical according to the schedule. But since I am a newbie, I am not sure which IDs to use to achieve this.
  6. Is that, when you are inside the vehicle and it explodes there is no error. The problem occurs when you explode because of a vehicle being outside ... But in debugscript 3 it does not show any errors.
  7. Bro, I do not understand much, but, this does not fulfill the same function ? function notifyAboutExplosion2() for i, player in pairs(getVehicleOccupants(source)) do triggerEvent("kilLDayZPlayer", player) end end addEventHandler("onVehicleExplode", getRootElement(), notifyAboutExplosion2) SERVER spawn.lua DAYZ I use the typical free dayz game mode and they all come with the same function in the spawn.lua file
  8. What I am looking for is a real time with images. That one image appears in the morning, another in the afternoon, etc.
  9. Now??? function Seleccion() fadeCamera(false,0.0) showChat(false) for i = 1, 8 do guiSetVisible(buttons[i],true) end local time = getRealTime() local hour = time.hour if hour >= 6 and hour <= 11 then guiSetVisible(Temprano,true) elseif hour >= 12 and hour <= 17 then guiSetVisible(Tarde,true) elseif hour >= 18 and hour <= 23 then guiSetVisible(Noche,true) elseif hour >= 1 and hour <= 5 then guiSetVisible(Madrugada,true) end showCursor(true) end addEvent("Seleccion",true) addEventHandler("Seleccion",getRootElement(),Seleccion)
  10. function Seleccion() fadeCamera(false,0.0) showChat(false) for i = 1, 8 do guiSetVisible(buttons[i],true) end local time = getRealTime() local hours = time.hour local minutes = time.minute local seconds = time.second if hour >= 6 and hour <= 11 then guiSetVisible(Temprano,true) elseif hour >= 12 and hour <= 17 then guiSetVisible(Tarde,true) elseif hour >= 18 and hour <= 23 then guiSetVisible(Noche,true) elseif hour >= 1 and hour <= 5 then guiSetVisible(Madrugada,true) end showCursor(true) end addEvent("Seleccion",true) addEventHandler("Seleccion",getRootElement(),Seleccion) this?
  11. I have tried to fix this problem but have not succeeded. Please hope someone can help me with this erorr. ERROR: attempt to compare number with nil function Seleccion() fadeCamera(false,0.0) showChat(false) for i = 1, 8 do guiSetVisible(buttons[i],true) end if hour >= 6 and hour <= 11 then -- ERROR HERE guiSetVisible(Temprano,true) elseif hour >= 12 and hour <= 17 then guiSetVisible(Tarde,true) elseif hour >= 18 and hour <= 23 then guiSetVisible(Noche,true) elseif hour >= 1 and hour <= 5 then guiSetVisible(Madrugada,true) end showCursor(true) end addEvent("Seleccion",true) addEventHandler("Seleccion",getRootElement(),Seleccion)
  12. Es que no comprendo porque jode cuando mueres cerca de un auto que explota... ¿sabes cúal es el error?, que si tu disparas aun auto lo dejas encendido fuego y te mueres cerca del auto... en la pantalla respawn, los segundos paran super rapidos... es como que se bugea.... ¿No sé si alguna vez has visto algo así?.
  13. ¡Perfect bro!..... And finally, I would like each image to have a different movement effect, would this be possible? local images = math.max(math.ceil(7 * ((getTickCount() % 14000) / 14000)), "CosineCurve", 1)
  14. And the people ?, I need help in this resource that I am doing. Random images pass very fast, I thought they would happen little by little but the truth is that I don't know how to make them happen every 2 or 5 seconds and with some effect. Could you give me a hand to finish it please? local screenW, screenH = guiGetScreenSize() local startTicking = getTickCount() Efect = 0 function Intro_Con_Imagenes() if Efect >= 0 then Efect = Efect + 1 end if Efect >= 255 then Efect = 255 end local move = interpolateBetween(3, 0, 0, -06, 0, 0, ((getTickCount() - startTicking) / 5000), "InElastic") local images = math.random(1,7) dxDrawImage(screenW*0,screenH*0 + move,screenW,screenH,"Imagenes/Login/intro-"..images..".png",0,0,0,tocolor(255,255,255,Efect),true) end addEventHandler('onClientRender',root,Intro_Con_Imagenes)
  15. Guys I really need your help, because of this feature my humble DAYZ server is not working well. I have problems when the survivor dies from an explosion, but I'm not sure if the overall function is failing or just part of it. I hope you can help me and I am very sorry if the code is a bit long. function playerGetDamageDayZ(attacker, weapon, bodypart, loss) cancelEvent() local occupiedvehicle = getPedOccupiedVehicle(localPlayer); if occupiedvehicle and getElementModel(occupiedvehicle) == 528 then return; end showPlayerDamageScreen(0,"up"); local headshot = false; if weapon == 37 then setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-10000) return end if attacker and getElementType(attacker) == "player" then setElementData(localPlayer,"lastattacker",attacker) end damage = 100 headshot = false if attacker then if isElement(sleepText) then setElementData(localPlayer,"isSleeping",false) destroyElement(sleepText) triggerServerEvent("getDamageSleep", localPlayer) end if attacker and getElementType(attacker) and getElementType(attacker) == "vehicle" and not getElementData(getLocalPlayer(), "godmode") and not getElementData(getLocalPlayer(), "greenzone") then speedx, speedy, speedz = getElementVelocity(attacker) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = actualspeed * 180 if kmh >= 100 then setElementData(getLocalPlayer(),"blood",-10) else setElementData(getLocalPlayer(), "blood", getElementData(getLocalPlayer(), "blood") - 500) end setElementData(localPlayer,"lastattacker",getVehicleOccupant(attacker)) end if attacker then if getElementData(attacker, "zombie") then setElementData(getLocalPlayer(),"blood",getElementData(getLocalPlayer(),"blood")-gameplayVariables["zombiedamage"]) sendClientMessage ( '-'..gameplayVariables["zombiedamage"], 1, 'left' ) local number = math.random(1, 9) playSound("Sonidos/Ataque-Zombies/attack_"..number..".mp3") if number == 4 then setElementData(getLocalPlayer(),"infection",true) setElementData(getLocalPlayer(), "bleeding", getElementData(getLocalPlayer(), "bleeding") + math.floor(loss*10)) end end end end -- DAÑO DE LOS PUÑOS if attacker then if weapon == 0 and getElementType(attacker) == "player" then setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-150) end end -- if (weapon == 16) then local aX,aY,aZ = getElementPosition(attacker) local tX,tY,tZ = getElementPosition(localPlayer) if isLineOfSightClear(aX,aY,aZ,tX,tY,tZ,true,false,false,true) then setElementData(localPlayer, "blood", getElementData(localPlayer, "blood") - math.random(20000*0.8, 20000*1.2)); end end -- if weapon == 49 then if loss > 30 then setElementData(getLocalPlayer(),"brokenbone",true) setPedControlState ("jump",true) setElementData(getLocalPlayer(),"blood",getElementData(getLocalPlayer(),"blood")-math.floor(loss*10)) sendClientMessage ( '-'..math.floor(loss*10), 1, 'left' ) setElementData(getLocalPlayer(),"blood",getElementData(getLocalPlayer(),"blood")-math.floor(loss*5)) sendClientMessage ( '-'..math.floor(loss*5), 1, 'left' ) end end if weapon == 63 or weapon == 51 or weapon == 19 or weapon == 50 then local aX,aY,aZ = getElementPosition (localPlayer) local tX,tY,tZ = getElementPosition (localPlayer) if isLineOfSightClear(aX, aY, aZ, tX, tY, tZ, true, false, false, true) then setElementData(getLocalPlayer(), "blood", -300) if getElementData(getLocalPlayer(), "blood") <= 1 then if not getElementData(getLocalPlayer(), "isDead") == true then triggerServerEvent("kilLDayZPlayer",getLocalPlayer(), attacker, headshot) end end end if weapon and weapon > 1 and attacker and getElementType(attacker) == "player" then setElementData(localPlayer,"lastAttacker",attacker) damage = getWeaponDamage(weapon,attacker) local x1,y1,z1 = getElementPosition(localPlayer) local x2,y2,z2 = getElementPosition(attacker) local distancia = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2) local damage = math.random(distancia*5, distancia*6) if bodypart == 9 then damage = damage*gameplayVariables["headshotdamage_player"] sendClientMessage ( '-'..gameplayVariables["headshotdamage_player"], 1, 'left' ) headshot = true end if attacker then if weapon == 17 and getElementType(attacker) == "player" then setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-10) end end if bodypart == 7 or bodypart == 8 then setElementData(localPlayer,"brokenbone",true) end if getElementData(localPlayer,"humanity") >= 5000 then if damage <= 1000 then damage = 0 else damage = damage end end setElementData(localPlayer,"blood",getElementData(localPlayer,"blood")-math.floor(damage)) if damage >= 6000 then end local number = math.random(1,8) if number >= 6 and number <= 8 then if damage > 0 then setElementData(localPlayer,"bleeding",getElementData(localPlayer,"bleeding") + math.floor(loss*10)) end end local number = math.random(1,7) if number == 2 then setElementData(localPlayer,"pain",true) end ----------------------------------------- playRandomHitSound() local myKills = 200 - ((getElementData(localPlayer,"murders") / 3) * 150) local rawDamage = math.floor(math.sqrt((damage/55.55))) local humanityHit = -(myKills * rawDamage) if humanityHit > -800 then humanityHit = -800 end if not getElementData(localPlayer,"bandit") then triggerServerEvent("onPlayerChangeStatus",attacker,"humanity",math.floor(humanityHit)) if getElementData(attacker,"humanity") < 0 then setElementData(attacker,"bandit",true) end else triggerServerEvent("onPlayerChangeStatus",attacker,"humanity",math.floor(humanityHit)) if getElementData(attacker,"humanity") > 5000 then setElementData(attacker,"humanity",5000) end if getElementData(attacker,"humanity") > 2000 then setElementData(attacker,"bandit",false) end end if getElementData(localPlayer,"blood") <= 0 then if not getElementData(localPlayer,"isDead") then triggerServerEvent("kilLDayZPlayer",localPlayer,attacker,headshot,getWeaponNameFromID(weapon)) setElementData(localPlayer,"isDead",true) end end if weapon == 54 or weapon == 63 or weapon == 49 or weapon == 51 then local sangre = math.random( 100, 1000 ) setElementData(getLocalPlayer(),"blood",getElementData( getLocalPlayer(),"blood") - sangre ) sendClientMessage ( '-'..sangre, 1, 'left' ) local number = math.random(1,5) if loss > 30 then setElementData(localPlayer,"brokenbone",true) setPedControlState("jump",true) end if loss >= 100 then setElementData(localPlayer,"blood",49) setElementData(localPlayer,"bleeding",50) end local number = math.random(1,11) if number == 3 then setElementData(localPlayer,"pain",true) end end if getElementData(getLocalPlayer(),"blood")<= 0 and not getElementData(getLocalPlayer(),"isDead")== true then triggerServerEvent("kilLDayZPlayer",getLocalPlayer(),(getElementData(localPlayer, "lastattacker") or attacker),headshot,getWeaponNameFromID (weapon)) setElementData(getLocalPlayer(),"isDead",true) end end end addEventHandler("onClientPlayerDamage", getLocalPlayer(), playerGetDamageDayZ) [Click and drag to move]
  16. I really appreciate you, I have one last little thing that I can't fix. Is it possible to add a font to this? I have tried it this way but it doesn't work: gridlistItems["loot_colum"] = guiGridListAddColumn(gridlistItems["loot"],"LOOT",0.7) gridlistItems["loot_colum_amount"] = guiGridListAddColumn(gridlistItems["loot"],"",0.2) guiSetFont(gridlistItems["loot_colum"],Fuente)
×
×
  • Create New...