Jump to content

βurak

Members
  • Posts

    376
  • Joined

  • Last visited

  • Days Won

    22

βurak last won the day on June 1

βurak had the most liked content!

6 Followers

Recent Profile Visitors

7,284 profile views

βurak's Achievements

Mack

Mack (28/54)

162

Reputation

2

Community Answers

  1. It's working even worse. Anyway, thanks for answering. I guess I'll have to find it myself
  2. You can use the vertex painting method to adjust the brightness of the object. You can find information about this in the forum
  3. How can I code a proper zombie system? I'm trying to do this using a single timer and loop in the code, but I'm having trouble controlling the animations and flow. This is the first time I've done something like this. If anyone has done something like this before, I'd appreciate some help function findRotation(x1, y1, x2, y2) local t = -math.deg( math.atan2(x2 - x1, y2 - y1)) return t < 0 and t + 360 or t end local zombies = {} function createZombie(x, y, z, firstTarget) local tx,ty = getElementPosition(firstTarget) local zombie = createPed(0, x, y, z, findRotation(x,y,tx,ty), true) zombies[zombie] = { target = firstTarget, updateFirstDelay = getTickCount(), state = "idle" } setTimer(doZombieGetupAnim, 50, 1, zombie) end function zombieLookTarget(zombie, target) if not isElement(target) then return end if not isElement(zombie) then return end if isPedDead(zombie) then return end local tx,ty = getElementPosition(target) local zx,zy = getElementPosition(zombie) setElementRotation(zombie, 0, 0, findRotation(zx,zy,tx,ty), "default", true) end function zombieFollowTarget(zombie) if not isElement(zombie) then return end if isPedDead(zombie) then return end local tx,ty,tz = getElementPosition(zombies[zombie].target) local zx,zy,zz = getElementPosition(zombie) local distance = getDistanceBetweenPoints3D(tx,ty,tz, zx,zy,zz) if distance > 1.5 then setPedAnimation(zombie, "ped", "run_fatold", -1, true, true, true, false) end end function zombieAttackTarget(zombie) if not isElement(zombie) then return end local tx,ty,tz = getElementPosition(zombies[zombie].target) local zx,zy,zz = getElementPosition(zombie) local distance = getDistanceBetweenPoints3D(tx,ty,tz, zx,zy,zz) if distance <= 1.5 and isPedDead(zombies[zombie].target) then setPedAnimation(zombie, "medic", "cpr", -1, true, true, true, false) end end function stopAnimation(zombie) if not isElement(zombie) then return end local tx,ty,tz = getElementPosition(zombies[zombie].target) local zx,zy,zz = getElementPosition(zombie) local distance = getDistanceBetweenPoints3D(tx,ty,tz, zx,zy,zz) if distance <= 1.5 then setPedAnimation(zombie) end end function doZombieGetupAnim(zombie) if not isElement(zombie) then return end if isPedDead(zombie) then return end setPedAnimation(zombie, "ped", "getup_front", 1000, false, true, true, false) end --I think this is the main problem function updateZombies() for zombie,data in pairs(zombies) do zombieLookTarget(zombie, data.target) if getTickCount() - data.updateFirstDelay > 1000 then zombieFollowTarget(zombie) end end end local updateTimer = setTimer(updateZombies, 150, 0) addCommandHandler("zombie", function() local x,y,z = getElementPosition(localPlayer) createZombie(x, y+4, z, localPlayer) end)
  4. o dediğin mümkün değil malesef bu silahlar c++ ile oyunun içinde gömülü bir şekilde kodlanmıştır o kodlara erişip değiştirmek gerekir mtanın bu kadar erişimi yok zaten belkide istediğin şey bu değildir? eklemek istediğin silah için normal silahı görünmez yapıp seslerini ve objesini ayarlamaya ne dersin?
  5. Someone had shared the offline version of the wiki, but if you want to download the updated version of the wiki, you can use the httrack app https://www.httrack.com/
  6. local exampleTable = {"stringitem1", "stringitem22", "stringitem333", "The Longest String Of Text", "abcde"} function getLongestString(strTable) local str = strTable[1] for i=1,#strTable do if string.len(strTable[i]) > string.len(str) then str = strTable[i] end end return str end print(getLongestString(exampleTable)) --result : The Longest String Of Text try this
  7. can you try this local pedVoices = {} local pedIds = {} local updateTimer local currentSkinIndex = 0 function configureTable() local skinids = getValidPedModels() for i=1,#skinids do pedIds[skinids[i]] = true end end function writeTableDataToFile() local voiceFile = fileCreate("voices.csv") -- file located mods/deathmatch/resources folder fileWrite(voiceFile, "PEDMODEL, VOICETYPE, VOICENAME;\n") for _,v in pairs(pedVoices) do local formattedData = string.format("%s %s %s;\n", v.model_id, v.voice_type, v.voice_name) fileWrite(voiceFile, formattedData) end fileClose(voiceFile) pedVoices = {} pedIds = {} currentSkinIndex = nil end function setPlayerSkinAndAssignTable() if pedIds[currentSkinIndex] then setElementModel(localPlayer, currentSkinIndex) local voiceType, voiceName = getPedVoice(localPlayer) if voiceType and voiceName then data = {model_id=currentSkinIndex, voice_type=voiceType, voice_name=voiceName} table.insert(pedVoices, data) print(data.model_id, data.voice_type, data.voice_name) else data = {model_id=currentSkinIndex, voice_type="none", voice_name="none"} table.insert(pedVoices, data) print(data.model_id, data.voice_type, data.voice_name) end end if currentSkinIndex == 312 then if isTimer(updateTimer) then killTimer(updateTimer) updateTimer = nil end print("saving finished now writing file...") writeTableDataToFile() return end currentSkinIndex = currentSkinIndex + 1 end addCommandHandler("gv", function() if isTimer(updateTimer) then killTimer(updateTimer) updateTimer = nil end configureTable() updateTimer = setTimer(setPlayerSkinAndAssignTable, 1000, 0) end)
  8. I think this function takes into account things like the player's video settings and the size of the object, so try to set a low value. from wiki
  9. The object ID you use in your code cannot be used in mta, maybe that is why these inconsistencies
  10. https://community.multitheftauto.com/index.php?p=resources&s=details&id=1873
  11. No, this is a code sample, it will not work directly, you need to edit the admin panel.
  12. here is an example onPlayerScreenShot event does not carry who took the screenshot addCommandHandler("takess", function(player,_,targetName) if not targetName then return end local targetPlayer = getPlayerFromName(targetName) if not targetPlayer then return end local isScreenShot = takePlayerScreenShot(targetPlayer, 1920, 1080) if isScreenShot then outputChatBox(getPlayerName(player).." taked screenshot to "..targetName) end end)
  13. I'm not sure but check this out https://wiki.multitheftauto.com/wiki/CreateLight
  14. Yes, ids up to 1938 are working, 1938 is not working I think the situation is like this, I created this in a second variable and it worked thanks problem solved
  15. Hello, I am adding texture to the models using engineImportTXD, but when I enter the 8th id, no texture is assigned to this model. What is the reason for this? local txd = engineLoadTXD ("burlova_city.txd") engineImportTXD(txd, 1879,1947,1881,1902,1930,1880,1905,1938) --not working local txd = engineLoadTXD ("burlova_city.txd") engineImportTXD(txd, 1938) --working bug image https://ibb.co/2gJRrJm
×
×
  • Create New...