-
Posts
911 -
Joined
-
Last visited
-
Days Won
61
Everything posted by Shady1
-
Hello, when I reviewed your code I came across many issues, and I fixed them through testing. You can check again if you’d like. Let me tell you about the changes I made: The requested "proper zombie system" is now ready: Uses a single timer Controlled animations Smooth flow Performance optimized 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 zombie = createPed(0, x, y, z, 0, true) zombies[zombie] = { target = firstTarget, state = "spawning", lastAnimation = nil, spawnTime = getTickCount(), updateDelay = getTickCount() } setPedAnimation(zombie, "ped", "getup_front", 2000, false, true, true, false) setTimer(function() if isElement(zombie) and zombies[zombie] then zombies[zombie].state = "idle" end end, 2000, 1) end function setZombieAnimation(zombie, anim) if not isElement(zombie) or isPedDead(zombie) then return end local data = zombies[zombie] if not data then return end if data.lastAnimation == anim then return end setPedAnimation(zombie) if anim == "idle" then setPedAnimation(zombie, "ped", "WALK_drunk", -1, true, true, true, false) elseif anim == "chase" then setPedAnimation(zombie, "ped", "run_fatold", -1, true, true, true, false) elseif anim == "attack" then setPedAnimation(zombie, "medic", "cpr", -1, true, true, true, false) end data.lastAnimation = anim end function updateZombieState(zombie, data) if not isElement(zombie) or isPedDead(zombie) then zombies[zombie] = nil return end if not isElement(data.target) or isPedDead(data.target) then data.target = findNearestPlayer(zombie) if not data.target then data.state = "idle" return end end local tx, ty, tz = getElementPosition(data.target) local zx, zy, zz = getElementPosition(zombie) local distance = getDistanceBetweenPoints3D(tx, ty, tz, zx, zy, zz) setElementRotation(zombie, 0, 0, findRotation(zx, zy, tx, ty), "default", true) if distance <= 1.5 then if data.state ~= "attack" then data.state = "attack" setZombieAnimation(zombie, "attack") end elseif distance <= 50 then if data.state ~= "chase" then data.state = "chase" setZombieAnimation(zombie, "chase") end local angle = findRotation(zx, zy, tx, ty) local moveX = math.cos(math.rad(angle)) * 0.1 local moveY = math.sin(math.rad(angle)) * 0.1 setElementPosition(zombie, zx + moveX, zy + moveY, zz) else if data.state ~= "idle" then data.state = "idle" setZombieAnimation(zombie, "idle") end end end function findNearestPlayer(zombie) local nearestPlayer = nil local nearestDistance = math.huge local zx, zy, zz = getElementPosition(zombie) for _, player in ipairs(getElementsByType("player")) do if player ~= zombie and isElement(player) and not isPedDead(player) then local px, py, pz = getElementPosition(player) local distance = getDistanceBetweenPoints3D(zx, zy, zz, px, py, pz) if distance < nearestDistance then nearestDistance = distance nearestPlayer = player end end end return nearestPlayer end function updateZombies() for zombie, data in pairs(zombies) do if data.state == "spawning" then if getTickCount() - data.spawnTime > 2000 then data.state = "idle" setZombieAnimation(zombie, "idle") end else if getTickCount() - data.updateDelay > 100 then updateZombieState(zombie, data) data.updateDelay = getTickCount() end end end end local updateTimer = setTimer(updateZombies, 200, 0) addEventHandler("onClientElementDestroy", root, function() if zombies[source] then zombies[source] = nil end end) addCommandHandler("zombie", function() local x, y, z = getElementPosition(localPlayer) createZombie(x, y + 4, z, localPlayer) end)
-
Welcome to the eoL Gaming Multigamemode Server Launch! Hello everyone! We are thrilled to announce the launch of our eoL Gaming Multigamemode server and would like to share some preview images and showrooms with you. Our team is working tirelessly with great teamwork to deliver the best experience possible. You will be greeted with amazing interfaces and game modes. Initially, during the Beta release, you will see a few game modes, and more will be added afterwards. Discord : https://discord.gg/EwEcShqTuW Current Game Modes (Beta): • Deathmatch • Destruction Derby • Hunter • Shooter • Race • Protect the President • Training • Freeroam • Trials Upcoming Game Modes (After Beta): • Carball • Stuntage • Minigames • 2 Surprise Game Modes (to be revealed after Beta) If we talk about game content, the Freeroam mode is designed as a mix of roleplay and freeroam. You will spawn in a city where gangs and mafias interact and fight each other. You can join a gang/mafia or live a civilian life completing missions. Police and security forces will do their best to stop organized crime gangs and complete their duties effectively. In Deathmatch, players compete for top positions in the leaderboards. The 1st, 2nd, and 3rd place winners will earn great rewards . With its smooth gameplay and dynamic system, players will enjoy an incredible gaming experience. The Protect the President (PTP) mode is simplified for Beta but will be fully enhanced after launch. As for the other game modes, we prefer to keep them a surprise . We ask you to be patient, as everything will be revealed gradually for the ultimate excitement! Now, we would like to share some in-game screenshots with you. : Lobby : : Scoreboard : : HUD : : Settings : : Clans :
-
- multigamemode
- eol
-
(and 1 more)
Tagged with:
-
Some people have had partial success with UTM + Windows 11 x86 emulation, but expect low FPS and frequent crashes, especially on M-series Macs. Parallels Desktop might be useful.
-
Hello , regarding your issue I must say that you are using a cracked version of GTA:SA. Instead, you should purchase the original version. MTA does not recommend using a cracked GTA:SA
-
Discord : shady.lua dm me
-
ama bunu istiyorsanız yapmalısınz bence bir developer bulunuz ve bu konu için size yardımcı olsun,benim hazırladığım cws de istediğim silahı istediğim kadar model ekleyebilir ve sesleride değiştirebilirsin aslında bir nevi senin istediğin işlevler burada mevcut, ancak kodu iyi analiz edip okuman gerek kod bilgin yoksa zaten anlayamazsın
-
yapamazsın oyun mekanizmasına bağlayamazsın ama custom weapon sistemi yaparsan baston silahının idsini kullanıp fireweapon olan Fire Extinguisher 42 silahını kullanabilirsin bunun için ben bir çalışma yapmıştım github'umda mevcut göz atabilirsin https://github.com/F2BShady/CustomWeaponSystem
-
hmm Baston bir object ise, onu weapon tipine çevirmek mümkün değil. Eğer baston aslında MTA’da bir weapon model ID (örneğin silah modelleri gibi) olarak tanımlıysa, sadece modelini değiştirip görünüşünü değiştirebilir. Ama bir object ID’yi direkt olarak silaha çeviremez.
-
-- Example: Replacing a vehicle model with a custom one -- This only changes the model and texture, not the element type (it stays a vehicle) function replaceModel() -- Load custom TXD local txd = engineLoadTXD("mycar.txd", true) if txd then engineImportTXD(txd, 411) -- 411 = Infernus end -- Load custom DFF (3D model) local dff = engineLoadDFF("mycar.dff", 411) if dff then engineReplaceModel(dff, 411) end -- Load custom COL (collision file) local col = engineLoadCOL("mycar.col") if col then engineReplaceCOL(col, 411) end outputChatBox("Custom model applied to Infernus!", 0, 255, 0) end addEventHandler("onClientResourceStart", resourceRoot, replaceModel)
-
Good Luck
- 1 reply
-
- 1
-
-
Hello and welcome to the MTA:SA Forum. Regarding your issue, I should point out that you are using a CRACKED version of GTA:SA, which means you’ll experience a lot of errors and crashes. There’s only one permanent solution: purchase the legitimate version and reinstall MTA.
-
32 bit 64 bit try this one
-
discord : shady.lua
-
Yes, you’re right. I was thinking maybe you could just add explosives.
-
Yes, your new updates look absolutely great. As I mentioned before, the sound effects have really enriched the script and made it look fantastic. You could categorize your weapons and add an extra page, allowing you to include different weapons or equipment.
-
Yes, this could be quite interesting. You could carefully choose sound effects, and additionally, use animations. For example, when a money transfer takes place or a weapon deal is completed, you could trigger a handshake animation or something similar to add realism.
-
Looks great, I can definitely say it’s a solid script. There are just a few small things that could make it even better if improved. For example, you could add a dialogue system with Arms Dealers, letting players buy weapons through that. Maybe also throw in some 3D sound effects when purchasing a weapon it’d give the whole thing a richer, more immersive feel.
-
https://help.multitheftauto.com/sa/trouble/serial-validation/
-
Good job, I like it
-
good job, if you have a different problem please post it here or create a new topic and tag m
-
There are two kinds of methods, one with setTimer and the other with the alternative onClientRender setTimer : The cursor always appears in the center for one frame after showCursor(true). function openPanel() showCursor(true) -- Save the last cursor position (values between 0 and 1) local x, y = getCursorPosition() -- Get the screen resolution local sx, sy = guiGetScreenSize() -- After 50ms, set the cursor back to its previous position setTimer(function() setCursorPosition(x * sx, y * sy) end, 50, 1) end onClientRender: Use a timer or onClientRender to set the position after showing the cursor. function panelAc() showCursor(true) local x, y = getCursorPosition() local sx, sy = guiGetScreenSize() local function imlecDuzelt() setCursorPosition(x * sx, y * sy) removeEventHandler("onClientRender", root, imlecDuzelt) end addEventHandler("onClientRender", root, imlecDuzelt) end your fixed code : local toggle = false local savedCursorX, savedCursorY local function togglePanel() toggle = not toggle if toggle then showCursor(true) if savedCursorX and savedCursorY then local screenX, screenY = guiGetScreenSize() -- Wait one frame before setting the cursor position setTimer(function() setCursorPosition(savedCursorX * screenX, savedCursorY * screenY) end, 50, 1) end else savedCursorX, savedCursorY = getCursorPosition() showCursor(false) end end bindKey("k", "down", togglePanel) I think you understand, if you have a different problem please post it here or create a new topic and tag me
-
player was informed about the other.
-
Merbahalar, USB'nizi tehdit olarak algılıyor olabilir bu yüzden ilk başta internet sağlayıcınızla görüşüm bir an önce internetini bağlatmalısınız.