• Content Count

  • Joined

  • Last visited

  • Days Won


majqq last won the day on May 2

majqq had the most liked content!

Community Reputation

123 Excellent


About majqq

  • Rank
    Playa Partner

Recent Profile Visitors

1,737 profile views
  1. I don't think it's a mods issue, i remember that i had similiar case on tactics gamemode. Tested it without replaced models and seems like it's the same.
  2. Either there is no damage, body part is invalid (unknown) or hit counts but damage doesn't. Test code: local vHits = 0 local tMuzzle = {} local vParts = { [3] = "Torso", [4] = "Ass", [5] = "Left arm", [6] = "Right arm", [7] = "Left leg", [8] = "Right leg", [9] = "Head", } function onClientPlayerWeaponFire(pWeapon, pAmmo, pAmmoInClip, pHitX, pHitY, pHitZ, pHitElement, pStartX, pStartY, pStartZ) if not pHitElement then return end local vStartX, vStartY, vStartZ = getPedWeaponMuzzlePosition(source) local vCol = {processLineOfSight(pStartX, pStartY, pStartZ, pHitX, pHitY, pHitZ, true, true, true, true, false, true, true, false, nil, false, false)} local vHitPart = vParts[vCol[11]] or "UNKNOWN" tMuzzle = {pStartX, pStartY, pStartZ, pHitX, pHitY, pHitZ} vHits = vHits + 1 outputChatBox("[HIT #"..vHits.."]: X, Y, Z: "..pHitX..", "..pHitY..", "..pHitZ.." | Hit element: "..tostring(pHitElement).." | Hit bodypart: "..vHitPart) end addEventHandler("onClientPlayerWeaponFire", root, onClientPlayerWeaponFire) -- function onClientPlayerDamage() outputChatBox("Damage confirmed at hit: "..vHits) end addEventHandler("onClientPlayerDamage", root, onClientPlayerDamage) -- function onClientRender() if #tMuzzle == 6 then dxDrawLine3D(tMuzzle[1], tMuzzle[2], tMuzzle[3], tMuzzle[4], tMuzzle[5], tMuzzle[6], tocolor(200, 0, 0, 255), 3) end end addEventHandler("onClientRender", root, onClientRender) On screen below, there was no collision check. But hits #6, #7 confirmed that element got hit, but no damage was given. (don't mind bodypart, there was no collision check on it)
  3. Hi. I've just found out that it's a task. Is there any way to disable it? It cause some hits to not confirm.
  5. Still not possible to download.
  6. Script isn't accessible from link.
  7. Show your code and i might help you with optimisation. (if possible)
  8. You don't check if this gridlist exists. About this part of code, you are destroying your server network. for k,v in ipairs(getElementsByType("ped") do if getElementData(v, "created") then pedsToTrigger = {} table.insert(pedsToTrigger, v) triggerClientEvent(thePlayer, "someEvent", resourceRoot, pedsToTrigger) end end Trigger will be called 1 * count of peds, it's very bad. Because it could be done with just 1 trigger. -- Client local pedsGridlist = false -- function customEvent(serverTable) if not pedsGridlist then pedsGridlist = guiCreateGridList(200, 100, 50, 50, false) end -- Finish your code end addEvent("customEvent", true) addEventHandler("customEvent", resourceRoot, customEvent) local peds = { {11, 0, 0, 3, "NPC 1"}, {11, 0, 0, 4, "NPC 2"}, } -- function createPeds() local ped = false local pedData = false local dataToSend = {} for i = 1, #peds do pedData = peds[i] ped = createPed(pedData[1], pedData[2], pedData[3], pedData[4]) dataToSend[#dataToSend + 1] = {ped, pedData[5]} end setTimer(function() triggerClientEvent(root, "customEvent", resourceRoot, dataToSend) end, 1000, 1) end addEventHandler("onResourceStart", resourceRoot, createPeds)
  9. You didn't passed table. I prefer adding elements manually. local someTable = {} local somePed = createPed(11, 0, 0, 3) -- 1st way, ped will be accessible via number, mostly you will need to loop whole table if there's more elements someTable[#someTable + 1] = somePed print(tostring(someTable[1])) -- output: ped userdata -- 2nd way, ped will be accessible via reference someTable[somePed] = somePed print(tostring(someTable[somePed])) -- output: ped userdata
  10. Use vehicle variants maybe?
  12. I've received different results when testing them one at once. In 2019 i had completely different CPU (and bad PC with Windows 7 - now i'm using Windows 10), it was AMD Athlon II x2 2.70 GHz. bone_attach_original stands for main version which uses pairs, and coroutines. bone_attach_2k19 stands for "optimized" version which i was pretty sure, that it works well (seems i was wrong), uses for i = 1, #tableSize do loop, localized math methods, all tables, all resource functions. bone_attach_2k20 stands for version which i've rewrited today. Uses aswell for i = 1, #tableSize do loop, localized math methods, all tables, all resource functions, mostly called functions (setElementPosition/getElementPosition; setElementRotation/getElementRotation), variables inside of functions scope are declared in main one (they aren't recreating every frame, so script just overwrite values - excluding one variable; i've exceeded upvalues limit - they aren't so fast as in function scope, but it's still better solution to overwrite rather than create new ones - correct me if i'm wrong), however - between 2020 version and original; 2019 there's small (?) difference in logic, in newest version i've implemented fix for CJ skin, which uses math.round method (solution from haron4igg -, besides that, data is stored in sub-tables (+ 1 indexing count) - by data i mean attachments, bone 0/T/F offsets. However, i've greatly reduced count of accessing render data. Latest difference between 2020 version and others is that, it doesn't use server-side at all (creates objects via client-side and attach them directly there) Used to be: local element = bone_attach[i][1] local ped = bone_attach[i][2] local attached_x = bone_attach[i][4] local attached_y = bone_attach[i][5] local attached_z = bone_attach[i][6] local attached_rx = bone_attach[i][7] local attached_ry = bone_attach[i][8] local attached_rz = bone_attach[i][9] Now it's: CLocalRenderData = CLocalRenderAttachments[i] local CLocalRenderElement = CLocalRenderData[1] CLocalRenderPed = CLocalRenderData[2] CLocalRenderBone = CLocalRenderData[3] CLocalRenderAttachX = CLocalRenderData[4] CLocalRenderAttachY = CLocalRenderData[5] CLocalRenderAttachZ = CLocalRenderData[6] CLocalRenderAttachRX = CLocalRenderData[7] CLocalRenderAttachRY = CLocalRenderData[8] CLocalRenderAttachRZ = CLocalRenderData[9] IPB results: 50 objects: 100 objects: Maybe i made something wrong, in 2019, honestly, i don't know
  13. Hi. So after all i've decided to play with bone attach once again, had to fix CJ skin bug, and decided to squeeze out even more performance CPU: i5-9400F 1 attached object: 100 attached objects: