-
Posts
372 -
Joined
-
Last visited
-
Days Won
11
Posts posted by Hydra
-
-
unii stiu ca lucram la acest proiect de tip nfs, din pacate am pierdut toate resursele din cauza unui reboot la laptop
Insa ca sa nu las oamenii care au intrat pe serverul de discord si au reactionat la fiecare actualizare dezamagiti ca nu mi-am tinut promisiunea, am inceput un proiect de tip RPG in stilul la GTA:V Online
Discord: https://discord.gg/XcPJeahDQEPreview:
- 2
-
10 hours ago, Molvine said:
Hello! I tried to do something similar, but even without animation, the code came out hard to read. I'm sure it's not optimal, but at least it works.
Sorry, but my knowledge is hardly enough to create an animation. But I can try if you still need it!
Video:
Code:local image = dxCreateTexture(":nfsmw/assets/icon.png") local selected = 1 local count = 5 local elementOffset = 10*scaleValue --padding between items in a menu list local w, h = 100*scaleValue, 100*scaleValue local offsetX, offsetY = 550*scaleValue, 50*scaleValue local x, y = getScreenStartPositionFromBox(w, h, offsetX, offsetY, "right", "bottom") function render() local selectedPos = x for i=1, count do local difference = i-selected --get the difference between the selected element and the rendered element local differenceCopy = difference if difference < 0 then differenceCopy = -difference end local height = h - (differenceCopy*20*scaleValue) --here we decrease the size as we move away from the selected element local width = w - (differenceCopy*20*scaleValue) local offset = 0 local step = 1 if difference < 0 then step = -step end if difference ~= 0 then for k=0, difference, step do --the loop calculates the offset using the width for each element. I didn't come up with a formula how to calculate it without a loop offset = offset + (20*scaleValue)*k end end if difference > 0 then offset = offset - 20*scaleValue*differenceCopy end --if the element is further than the selected one, then we decrease the offset by one point. without it, elements after the selected one have an offset one point less than required local xImage = selectedPos + (w*difference) - offset + 10*scaleValue*difference --the actual position of the x-axis of the element local yImage = y+(h-height)/2 --the actual y-axis position of the element local alpha = 255 - 100*(differenceCopy) --transparency decreases with distance from the selected element if alpha < 0 then alpha = 0 end dxDrawImage(xImage, yImage, width, height, image, _, _, tocolor(255,255,255,alpha)) --element rendering end end function startRender() addEventHandler("onClientRender", root, render) end startRender() function selectElementInMenu(key, keyState, turn) --element select function if turn == "right" then if selected >= count then selected = count return end selected = selected + 1 elseif turn == "left" then if selected <= 1 then selected = 1 return end selected = selected - 1 end end bindKey("o", "up", moveMenu, "right") bindKey("i", "up", moveMenu, "left")
Thank you so much!
-
43 minutes ago, FlorinSzasz said:
Well i dont know if this might help you but if u mean something like this i can give u some ideas i think, also i used
dxDrawImage() dxDrawRectangle()
https://drive.google.com/drive/folders/1vF7AlP8S1ggWoi7DZa60vZRxWRLnzDlQ?usp=sharing
I know about drawing functions, i don't know how to make the effect to be exactly like in the video
-
Hello, can someone give me an example on how I could make this effect?
I tried to do it but without success, can't figure it out how to make it to be like in the video above- 1
-
Would be cool to see gta 4 project come back :))
-
Singura optiune e sa cauti prin resursele respective si sa schimbi locatia blipurilor si markerelor cu locatiile din LV pe care le vrei tu.
-
Nu se mai merita sa faci pe MTA nimic, mai ales la noi. Comunitatea e moarta, daca vreti sa faceti ceva schimbati-va pe FiveM chiar daca si pe FiveM in comunitatea romaneasca domina Roleplayu, atat putem ce sa facem
-
Sperăm ca jucătorii de atunci să revină și acum la un freeroam frumos cum e în imaginiile prezentate mai sus
-
Salut, dacă cauți un server de freeroam și pe comunitatea romanească țin să te anunț că serverul RPP-Gaming se redeschide azi de către fondatorul original (Dany Alex). Serverul va fi asa cum vi-l amintiti voi inainte să se inchidă.Serverul Conține:
- Moduri pe mașini, arme si skin-uri reale (/mods în joc)
-Tot felul de mape: Fun, Drift, DM-Race, Race etc.. (/teles în joc)
- Sistem Anti-Deathmatch în F1
- Arenă doar pentru deathmatch (/aa în joc)
- Serverul este optimizat și pentru cei cu PC-uri slabe (61 FPS constant)
- În fiecare săptămâna o să apară ceva nou pe server
Mai multe veți descoperi voi pe server
Câteva poze ca să vedeți cum era atmosfera pe server:
Discord Server: https://discord.gg/PbPxrF5jV6
Serverul și-a făcut pentru prima dată apariția pe data de 15 martie 2012.- 1
-
-
If I'm not mistaken, the possibility of using cheats/hacks on the MTA tends to 0% because the MTA uses a fairly good Anti-Cheat and does not allow entry to the servers with any kind of cheat or hack. On the contrary, you will be kicked automatically or banned from joining on any server on for a period of time or in the worse scenario, PERMANENT. I heard about 2 or 3 cheats that worked on MTA but I think the admins resolved that so you don't need to worry.
-
You can do that with fetchRemote:
https://wiki.multitheftauto.com/wiki/FetchRemote -
If you want to print it only for one time use the example above but if you want to print it infinite change 1 to 0
-
On 18/10/2022 at 21:26, MissCrow said:
@TekkenI found the problem that causes this, now I have this problem in the code
Ninja.lua:44 Bad argument @'engineReplaceAnimation' [Expected element at argument 1, got nil]
Read the example posted on the wiki and you will see what you did wrong.
https://wiki.multitheftauto.com/wiki/EngineReplaceAnimation -
You can look at the hydra model in blender and see how is done for the 2 flight modes. Maybe I'm wrong so I can say you will find something
-
function ShamalWeapons() if not s then s = true bindKey("lctrl", "down", ShamalProjectiles) else s = false unbindKey("lctrl", "down", ShamalProjectiles) end end addCommandHandler("tweap", ShamalWeapons) local projectiles = {} local antispam = {} function ShamalProjectiles() local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then if getElementModel(vehicle) == 519 then if not antispam[localPlayer] or antispam[localPlayer] + 500 <= getTickCount() then antispam[localPlayer] = getTickCount() local px, py, pz = getElementPosition(vehicle) local rx, ry, rz = getElementRotation(vehicle) projectiles[1] = createProjectile(vehicle, 19, px+2, py, pz-2, 3) projectiles[2] = createProjectile(vehicle, 19, px-2, py, pz-2, 3) else cancelEvent() end end end end
You will need to do something like this and if I'm not wrong you will need to use trigger event in a server-side script for the rockets to be visible for everyone.
NOTE: this script will work only if you are using shamal aircraft
-
--// Quick Example local ped = createPed(0, 0, 0, 10) local vehicle = createVehicle(411, 10, 0, 10) function lookAtVehicle() local px, py, pz = getElementPosition(ped) local vx, vy, vz = getElementPosition(vehicle) local rx, ry, rz = findRotation3D(px, py, pz, vx, vy, vz) setElementRotation(ped, rx, ry, rz) end addCommandHandler("trot", lookAtVehicle) function findRotation3D( x1, y1, z1, x2, y2, z2 ) local rotx = math.atan2 ( z2 - z1, getDistanceBetweenPoints2D ( x2,y2, x1,y1 ) ) rotx = math.deg(rotx) local rotz = -math.deg( math.atan2( x2 - x1, y2 - y1 ) ) rotz = rotz < 0 and rotz + 360 or rotz return rotx, 0,rotz end
this will make the ped to rotate and look at vehicle every time
-
23 minutes ago, Kamran3478 said:
I got these errors:
attempt to perform arithmetic on local 'x2' (a boolean value) [DUP x4]
Bad argument @ 'getElementPosition' [Expected element at argument 1, got nil]
Bad argument @ 'getElementRotation' [Expected element at argument 1, got nil]
Bad argument @ 'getDistanceBetweenPoints3D' [Expected vector3 at argument 1, got boolean]setTimer(function(localPlayer) setPedFollow(myPed, localPlayer) end, 1000, 0) function setPedFollow(theElement, theTarget) if theElement then local x, y, z = getElementPosition(theTarget) local rx, ry, rz = getElementRotation(theTarget) local ex, ey, ez = getElementPosition(theElement) local distance = getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) local rotation = findRotation(ex, ey, x, y) setPedRotation(theElement, rotation) if distance > 2 then setPedControlState(theElement, "forwards", true) else setPedControlState(theElement, "forwards", false) end end end 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
Thats the script. Why its not working
why did you put setTimer(function(localPlayer) lmao when I put it only setTimer(function()
-
7 minutes ago, Kamran3478 said:
what is timer? can you show a example for this?
local myPed = createPed(skinID, posX, posY, posZ) setTimer(function() setPedFollow(myPed, localPlayer) end, 1000, 0) function setPedFollow(theElement, theTarget) if theElement then local x, y, z = getElementPosition(theTarget) local rx, ry, rz = getElementRotation(theTarget) local ex, ey, ez = getElementPosition(theElement) local distance = getDistanceBetweenPoints3D(x, y, z, ex, ey, ez) local rotation = findRotation(ex, ey, x, y) setPedRotation(theElement, rotation) if distance > 2 then setPedControlState(theElement, "forwards", true) else setPedControlState(theElement, "forwards", false) end end end 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
-
it works only with timer or onClientRender. Also you need to put findRotation function too
-
local blip local teams = { {name = "Red Team", r = 255, g = 0, b = 0}, {name = "Blue Team", r = 0, g = 0, b = 255} } function onTeam() local team = getPlayerTeam(source) if team then if getTeamName(team) == teams[1].name then for _, v in ipairs(getPlayersInTeam(team)) do blip = createBlipAttachedTo(v, 0, 2, teams[1].r, teams[1].g, teams[1].b, 255) end elseif getTeamName(team) == teams[2].name then for _, v in ipairs(getPlayersInTeam(team)) do blip = createBlipAttachedTo(v, 0, 2, teams[2].r, teams[2].g, teams[2].b, 255) end end end end addEventHandler("onPlayerSpawn", root, onTeam)
-
Here is a useful library you can use: https://forum.multitheftauto.com/topic/133212-rel-add-new-models-library/
-
--// Quick Example local myCol = createColRectangle(1024, 512, 20, 20) --// this is how you create the col local myRadar = createRadarArea(1024, 512, 20, 20, 0, 255, 0, 255, root) --// with radar area you can detect your col easier function onColHit(hit, dim) if getElementType(hit) == "player" then killPed(hit) outputChatBox("You were killed", hit, 255, 0, 0, true) end end addEventHandler("onColShapeHit", root, onColHit)
You have 6 types of colshapes, in this example I used the Rectangle one
- 1
-
Try using the texture name from wiki:
https://wiki.multitheftauto.com/wiki/CJ_Clothes\Hats_(16) -
Hello, did used this resource to get the texture name? https://wiki.multitheftauto.com/wiki/Shader_examples#Texture_names
I think that each hat has a different name and you will have to put the exact name
|| SA:MW - San Andreas Most Wanted ||
in Servere
Posted
Sneak Peek #1
https://streamable.com/bn5x5j