-
Posts
636 -
Joined
-
Days Won
8
Everything posted by ds1-e
-
Yeah, it's it, thanks again Patrick
-
Hey. I need to make effect on player hit, but i don't know how this effect it's called. Or it's multiple effects used?
-
Looks like both of this eliminated error, before it wasn't working due of my mistake. If something will change i will notice. Thank you very much.
-
Hey, it's me again and i have another questions. 1. How can i make something like blood splash when player get hit, and after 150~ ms it should disappear. 2. Is there a way to replace standard effect from GTA on custom? F.e blood splash above.
-
Hey, i need to scale weapon [which is custom object] in hands. Any ideas how can i do it?
-
I will test it today, later.
-
After: bone_attach\attach_func.lua:119: bad argument #1 to 'status' (coroutine expected) [DUP x2]
-
Hey, i have noticed a problem with that event. Weapons which cause explosions, for example: 51, 19, as topic say execute 1-4 times. Any idea how to fix it? Another question associated with this, it's possible/worth to move damage system (functions) on server side? It happens mostly with car explosion, example function below. function damage(attacker, weapon, bodypart, loss) cancelEvent() outputChatBox(weapon) end addEventHandler("onClientPlayerDamage", getLocalPlayer(), damage)
-
Thank you very much
-
Hey, as the topic say, i need idea how to make something like this: custom effect which will follow bullet to the hitposition and after it, it will disappear. F.e bullet tracer or plasma effect.
-
I'll try it out soon and i give you answer if it works, thank you.
-
Any idea how to fix this ? bone_attach/attach_func.lua:117: cannot resume dead coroutine [string "?"] [DUP x5] attached_ped = {} attached_bone = {} attached_x = {} attached_y = {} attached_z = {} attached_rx = {} attached_ry = {} attached_rz = {} function attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz) if not (isElement(element) and isElement(ped)) then return false end if getElementType(ped) ~= "ped" and getElementType(ped) ~= "player" then return false end bone = tonumber(bone) if not bone or bone < 1 or bone > 20 then return false end x,y,z,rx,ry,rz = tonumber(x) or 0,tonumber(y) or 0,tonumber(z) or 0,tonumber(rx) or 0,tonumber(ry) or 0,tonumber(rz) or 0 attached_ped[element] = ped attached_bone[element] = bone attached_x[element] = x attached_y[element] = y attached_z[element] = z attached_rx[element] = rx attached_ry[element] = ry attached_rz[element] = rz if setElementCollisionsEnabled then setElementCollisionsEnabled(element,false) end if script_serverside then triggerClientEvent("boneAttach_attach",root,element,ped,bone,x,y,z,rx,ry,rz) end return true end function detachElementFromBone(element) if not element then return false end if not attached_ped[element] then return false end clearAttachmentData(element) if setElementCollisionsEnabled then setElementCollisionsEnabled(element,true) end if script_serverside then triggerClientEvent("boneAttach_detach",root,element) end return true end function isElementAttachedToBone(element) if not element then return false end return isElement(attached_ped[element]) end function getElementBoneAttachmentDetails(element) if not isElementAttachedToBone(element) then return false end return attached_ped[element],attached_bone[element], attached_x[element],attached_y[element],attached_z[element], attached_rx[element],attached_ry[element],attached_rz[element] end function setElementBonePositionOffset(element,x,y,z) local ped,bone,ox,oy,oz,rx,ry,rz = getElementBoneAttachmentDetails(element) if not ped then return false end return attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz) end function setElementBoneRotationOffset(element,rx,ry,rz) local ped,bone,x,y,z,ox,oy,oz = getElementBoneAttachmentDetails(element) if not ped then return false end return attachElementToBone(element,ped,bone,x,y,z,rx,ry,rz) end if not script_serverside then function getBonePositionAndRotation(ped,bone) bone = tonumber(bone) if not bone or bone < 1 or bone > 20 then return false end if not isElement(ped) then return false end if getElementType(ped) ~= "player" and getElementType(ped) ~= "ped" then return false end if not isElementStreamedIn(ped) then return false end local x,y,z = getPedBonePosition(ped,bone_0[bone]) local rx,ry,rz = getEulerAnglesFromMatrix(getBoneMatrix(ped,bone)) return x,y,z,rx,ry,rz end end ------------------------------------ function clearAttachmentData(element) attached_ped[element] = nil attached_bone[element] = nil attached_x[element] = nil attached_y[element] = nil attached_z[element] = nil attached_rx[element] = nil attached_ry[element] = nil attached_rz[element] = nil end function forgetDestroyedElements() if not attached_ped[source] then return end clearAttachmentData(source) end addEventHandler(script_serverside and "onElementDestroy" or "onClientElementDestroy",root,forgetDestroyedElements) function forgetNonExistingPeds() local checkedcount = 0 while true do for element,ped in pairs(attached_ped) do if not isElement(ped) then clearAttachmentData(element) end checkedcount = checkedcount+1 if checkedcount >= 1000 then coroutine.yield() checkedcount = 0 end end coroutine.yield() end end clearing_nonexisting_peds = coroutine.create(forgetNonExistingPeds) setTimer(function() coroutine.resume(clearing_nonexisting_peds) end,1000,0) -- line 117
-
I need something like unique timer for each car, because on server players spawn a lot of cars, and f.e if player leave a car with id 411 it set up a timer which should destroy vehicle if noone was inside, after X seconds. However if player spawn 2 same vehicles there's a problem with the timer, as i said above one vehicle will disappear and other not.
-
with function createVehicle(model, x,y,z, rz) - standard from DayZ
-
Well i wanna fix the timer. For now if u spawn another or same car while timer is running, another vehicle don't blow up. Only the last which was used.
-
function onPlayerExitDayzVehicle(veh, seat) if isVehicleBlown(veh) then return end if isTimer(vehTimer) then return end if not isVehicleEmpty(veh) then return end local vehTimer = setTimer(function () local col = getElementData(veh, "parent") if col then setElementData(veh, "vehicle:station", 0) setElementPosition(veh, 2490.99316, -1666.45313, 13.34375) blowVehicle(veh, false) end end, 20000, 1) end if seat == 0 then setVehicleEngineState(veh, false) unbindKey(source, "k", "down", setEngineState) unbindKey(source, "l", "down", consoleVehicleLights) end addEventHandler("onPlayerVehicleExit", getRootElement(), onPlayerExitDayzVehicle)
-
Hey, i have a problem. When player leave from vehicle, timer starts and after it blow vehicle. My problem is that if i spawn 2 cars with same ID, one of them will explode, and another one will stay in a place. So my question is how to do one or more timer for the same ID cars, because i don't have any idea.
-
Hey. I have one big problem. Well i want to do something like, if we loss a lot of HP, then our screen will change colors, starting from minimal color changes, ends at this almost blackwhite screen. I wanna do similar thing as one MTA server have. Unfortunately i know nothing about using .fx files. So here i have 4 files, first it's script which use it, original blackwhite.fx and modified one and also grayscale.fx maybe it should help with something but i am not sure about it.
-
So it's the only way to detect bullets?
-
Hey, does something like "bullets" colshape exists in MTA? I'm asking because i have function which bypass players and i don't know how to make that this function will avoid bullets.