Leaderboard
Popular Content
Showing content with the highest reputation on 07/06/20 in Posts
-
pDownloader version 1.2.1 Better looking progress bar and players can play while downloading files. Video: https://streamable.com/bedf40 Documentation moved to GitHub! Go to GitHub...1 point
-
Draw distance v1.0.2 This resource improves the draw distance of all your resources that make use of map files. It makes your maps 10x more beautiful in my opinion! Greatly improves the draw distance of map objects Maxed out the draw-distance for peds and vehicles. (See MTA settings > video: Render vehicles always in high detail + Render peds always in high detail ) Multi-resources support (this effect is applied on every mapRoot element) Parallel loading method is used, but the loading speed is in that case reduced to improve performance. The effect is not only applied on resources that are starting, but also resources that are already running. Download here This resource is uncompiled! Repository: https://gitlab.com/IIYAMA12/draw-distance Video - Created by @Anx1ty Comparison Starting at 200 units distance 400 units distance (this is the distance where a lot of objects will be unloaded, but in this case switched with lowLOD objects) And even on 600 units distance, it is technically visible -> (while the fog is slowly eating it up... ) Download here Can all hardware run this? --> I have no idea... most likely ?. Just give it a try.1 point
-
When I deleted the line, I received an error that indicated to me that there was no line. So I just reinstalled the mta client to a new one. As it turned out, I used the old modified client. Everything works, the script is just perfect. I don’t understand where you have so much patience to bail out fools like me. Thank)1 point
-
I am not sure which version you are using. But the resource might be working fine for your server, if you do the following: Remove the following line from your meta.xml <min_mta_version server="???" client="???" /> But be aware that you might see some warnings, which are related to functions that are not available inside of your server (version). setPedsLODDistance = available ??? setVehiclesLODDistance = available ??? Updating your server, might be handy if you want to be able to use the resources that use the newest features.1 point
-
I did it and now it works, thanks for help ^^ I also had to put the event handlers for colshapes inside the create function to make it work1 point
-
function createTreasure() treasureRadar = createRadarArea( treasurePositions[randomRadar][1] - 25, treasurePositions[randomRadar][2] - 25, 50, 50, 255, 221, 0, 100) treasureArea = createColRectangle( treasurePositions[randomRadar][1] - 25, treasurePositions[randomRadar][2] - 25, 50, 50) treasureObject = createObject(2060, treasurePositions[randomRadar].tabel[randomTreasure][1], treasurePositions[randomRadar].tabel[randomTreasure][2], treasurePositions[randomRadar].tabel[randomTreasure][3] - 1) treasureCol = createColSphere(treasurePositions[randomRadar].tabel[randomTreasure][1], treasurePositions[randomRadar].tabel[randomTreasure][2], treasurePositions[randomRadar].tabel[randomTreasure][3] - 1, 1.5) attachElements(treasureCol, treasureObject) if (treasureObject) then setObjectScale (treasureObject, 2) end end addEventHandler("onResourceStart", getRootElement(), createTreasure) addEventHandler("onColShapeHit", treasureArea, function(thePlayer) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing( treasureRadar, true ) end end ) addEventHandler("onColShapeLeave", treasureArea, function(thePlayer) if (getElementType(thePlayer) == "player") then setRadarAreaFlashing( treasureRadar, false ) end end ) addEventHandler("onColShapeHit", treasureCol, function(thePlayer) local detect = isElementWithinColShape (thePlayer, treasureCol) if detect then outputChatBox("Write /dig to dig", thePlayer, 255,255,255 ) end end ) function playerDigTreasure(thePlayer, command) local detect = isElementWithinColShape (thePlayer, treasureCol) if detect then setPedAnimation(thePlayer, "BOMBER", "BOM_Plant", -1, false, false, nil, false); setTimer( function() givePlayerMoney( thePlayer, 100000) destroyElement(treasureObject) destroyElement(treasureCol) destroyElement(treasureArea) destroyElement(treasureRadar) outputChatBox("Next treasure spawning in 5 seconds", getRootElement(), 255,255,255 ) setTimer(createTreasure, 5000, 1) end, 2000, 1) end end addCommandHandler("dig", playerDigTreasure) delete the locals and the variables will read in the whole events and it will be better if you check the elements before destroy it or put it in events using IsElement + the point that majqq said about resource event1 point
-
You should use locals whenever you can. local col1 = createColSphere(...) local col2 = createColSphere(...) local col3 = createColSphere(...) do col1 = "still local, but it's a string now" col2 = "still local, but it's a string now" col3 = "still local, but it's a string now" end Tip: Attaching resource start event to root will cause that function will be triggered when ANY resource starts, use resourceRoot instead. addEventHandler("onResourceStart", getRootElement(), createTreasure)1 point
-
1 point
-
GetElementVelocity SetElementVelocity you can use OnClientVehicleCollision element theHitElement, float force, int bodypart, float collisionX, float collisionY, float collisionZ, float normalX, float normalY, float normalZ, float hitElementForce, int model The source of this event is the vehicle that collided with something so you can get the velocity of the source and controll the hitElement1 point
-
Currently, I need some help with get type of "vector", I can't get the type of Vector/Vector2/... window is the parent of button1 button1 is the parent of button2 but window is not button2's parent, it is button2's grand parent getChildren only gets parent, exclude grand parent1 point
-
1 point
-
@AlvesMTA o código citado serve para fechar as portas de um veículo quando alguém entrar nele.1 point
-
1 point
-
The CPU usage was normal (average 0.62% in IPB when flying around the map) on my Intel Celeron E3200 (2.40 GHz) This PC only have a integrated video card with 128 MB dedicated video memory, so the only problem is the lower fps because a lot of objects drawed. (Tested on a green venturas map with the forest generator publiced by Essle ~ Total 2124 tree objects created) But yeah, this is a great work1 point
-
بعض اليوزفل فنكشن من مكتبتي كنز والله المكتبة متعوب عليها function dxDrawRoundedRectangle(x,y,width,height,raduis,color,postgui) dxDrawRectangle(x,y+raduis,width+1,height-(raduis*2),color,postgui)--horezantal rectangle dxDrawRectangle(x+raduis,y,width-(raduis*2),height+1,color,postgui)--vertical rectangle for k=180,270 do--left top local co=math.cos(math.rad(k))* raduis local si=math.sin(math.rad(k))* raduis dxDrawLine((x+raduis)+co,(y+raduis)+si,x+raduis,y+raduis,color,1,postgui) end for k=270,360 do--right top local co=math.cos(math.rad(k))* raduis local si=math.sin(math.rad(k))* raduis dxDrawLine((x+width-raduis)+co,(y+raduis)+si,x+width-raduis,y+raduis,color,1,postgui) end for k=90,180 do--left bottom local co=math.cos(math.rad(k))* raduis local si=math.sin(math.rad(k))* raduis dxDrawLine((x+raduis)+co,(y+height-raduis)+si,x+raduis,y+height-raduis,color,1,postgui) end local k=360 while(k<=(360+90))do if k~= 360 then local co=math.cos(math.rad(k))* raduis local si=math.sin(math.rad(k))* raduis dxDrawLine((x-raduis+width)+co,(y+height-raduis)+si,x+width-raduis,y+height-raduis,color,1,postgui) end k=k+1; end end function dxDrawCutUpRectangle(x,y,width,height,color,postgui,topcolor,bordercolor) dxDrawRectangle(x,y+(height*5/100),width,height-(height*5/100),color,postgui)--down dxDrawRectangle(x+(width*6.5/100),y,width-(width*6.5/100),(height*5/100),topcolor,postgui)---top dxDrawRectangle(x,y,(width*6.5/100),(height*5/100),bordercolor,postgui)---chip left dxDrawRectangle(x+(width*93.5/100),y,(width*6.5/100),(height*5/100),bordercolor,postgui)---chip right dxDrawLine(x,y+(height*5/100),x,y+(height),bordercolor,1,postgui)--left dxDrawLine(x+(width)-1,y+(height*5/100),x+width-1,y+(height),bordercolor,1,postgui)--right dxDrawLine(x,y+(height)-1,x+width,y+(height)-1,bordercolor,1,postgui)--bottom end function dxDrawRoundUpRectangle(x, y, width, height,topcolor, color,postgui) local radius=(height*5/100)/2 local width = width - (radius * 2) local height = height -( radius * 2) local x = x + radius local y = y + radius dxDrawCircle(x, y+radius, radius*2, 180, 270, topcolor, topcolor, 7,1,postgui) dxDrawCircle(x + width, y+radius, radius*2, 270, 360, topcolor, topcolor, 7,1,postgui) dxDrawRectangle(x, y-radius, width, radius*2, topcolor,postgui) dxDrawRectangle(x-(radius*2), y+radius, width+(radius*4), height+radius, color,postgui) end function dxDrawDxWindow(x, y, width, height,topcolor, color,bordercolor,postgui) dxDrawRectangle(x,y,width,height,color,postgui) dxDrawRectangle(x,y,width,height*5/100,topcolor,postgui) dxDrawLine(x,y,x+width-1,y,bordercolor,1,postgui)--top top :D dxDrawLine(x,y,x,y+height,bordercolor,1,postgui)--left dxDrawLine(x+width-1,y,x+width-1,y+height,bordercolor,1,postgui)--right dxDrawLine(x,y+height,x+width-1,y+height,bordercolor,1,postgui)--bottom end function getMaxStringForWidth(text,width,isinvers,scale,font) local scale=scale or 1.15 local font=font or 'default-bold' local isinvers= isinvers or false local mystring='' local inverstable={} local num=0 if text~=nil then local txtwidth=dxGetTextWidth( text,scale,font) if width>=txtwidth then return text,text end for v in text:gmatch('.') do if not isinvers then mystring=mystring..v local finalWidth=dxGetTextWidth( mystring,scale,font) if finalWidth>=width then mystring=mystring:gsub("[%z\1-\127\194-\244][\128-\191]*$", "") return mystring,text end else table.insert(inverstable,v) end end if isinvers then num=#inverstable while(num>=1) do mystring=inverstable[num]..mystring local finalWidth=dxGetTextWidth( mystring,scale,font) if finalWidth>=width then return mystring,text end num=num-1 end return mystring,text end end return false,text end وباقي لسا حملو المكتبه ودورو بنفسكم core usefulfunctions.lua1 point
-
يب حقي تقدر تختصره اكتر function dxDrawButton(x, y, w, h, color, text) if isMouseInPosition(x, y, w, h) then dxDrawRectangle(x, y, w, h, tocolor(50, 50, 50, 255), false) dxDrawText(text, x, y, x+w, y+h, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) else dxDrawRectangle(x, y, w, h, color, false) dxDrawText(text, x, y, x+w, y+h, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, false, false) end end1 point
