-
Posts
1,131 -
Joined
-
Last visited
-
Days Won
2
Everything posted by MIKI785
-
Hi, I have a problem with this function, when I remove some building, there is still low quality and non-collidable object. I think it's called LOD object. How to delete it? How to get its ID? thanks. I searched on wiki, but I can't find anything.
-
Did you edit the ACL.xml manually? If so, use aclReload(). Next time use admin or webadmin, it's much simplier editing and also faster.
-
It's stored in MTA Server/mods/deathmatch/ in file internal.db
-
Ok, this is my first time working with table.sort... thanks.
-
Wafamde, Ok, thanks. About the nicks, I know that, I just forgot that at the rush Buffalo, You're using < operator, i think that it will sort numbers only.
-
Turn off the engine and after start, turn it on
-
Hello, how can I sort table alphabetically? I know that I will probably use table.sort, but with what arguments? I want list of the players.. plrs = getElementsByType("player") table.sort(plrs, ?) --Problem
-
What? You mean refresh or refreshall commands?
-
Looks nice. If there will be a release, I will surely download it.
-
What? I'm not sure If I understand you right.. If you want to draw player's country flag you have to trigger server event to get player's country with exports.admin:getPlayerCountry(player) then send it back to the client and draw it.
-
I said MAKE YOUR OWN RESOURCE..... stop putting it into the race...
-
Bad arguments can result in black screen? O_o. He just can't post debug errors...
-
What black screen?!?!?!?! Where did you put that?!
-
Don't work your code Go test in your server OMG... x, y = guiGetScreenSize() --x is the width of the screen x = x - 100 --X is now 100 Pixel from the right end of the screen. addEventHandler("onClientRender", getRootElement(), function () dxDrawColorText ('#ffa500sb#ffffffgames#ffa500.com#ffffff.br', x, y - dxGetFontHeight(250, 'default-bold')/2+1, 100, 100+1, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 0.60, 'right') end)
-
You should use onPlayerLogin... onResourceStart is not suitable for this as it will be triggered only when the resource is started.
-
What black window? btw. dxDrawColorText, search on wiki.
-
Make a resource and put in: x, y = guiGetScreenSize() --x is the width of the screen x = x - 100 --X is now 100 Pixel from the right end of the screen. addEventHandler("onClientRender", getRootElement(), function () dxDrawColorText ('#ffa500sb#ffffffgames#ffa500.com#ffffff.br', x, screenHeight - dxGetFontHeight(250, 'default-bold')/2+1, 100, 100+1, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 0.60, 'right') end) Then add it to meta.xml as CLIENT side script.
-
Where did you put that??? Omg... Just make your own resource.
-
What? You can do the same in the nametags.lua in the race if that's what you want.
-
What??? Do debug... debugscript 2
-
Try: Put this outside the onClientRender event: function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY) bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or "default" if alignX then if alignX == "center" then ax = ax + (bx - ax - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font))/2 elseif alignX == "right" then ax = bx - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font) end end if alignY then if alignY == "center" then ay = ay + (by - ay - dxGetFontHeight(scale, font))/2 elseif alignY == "bottom" then ay = by - dxGetFontHeight(scale, font) end end local alpha = string.format("%08X", color):sub(1,2) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font) ax = ax + w color = tocolor(getColorFromString("#"..col..alpha)) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) dxDrawText(cap, ax, ay, ax + dxGetTextWidth(cap, scale, font), by, color, scale, font) end end And put this into that event --Draw our text local r,g,b = 150,150,150 local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 dxDrawColorText ( info.name, sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", false, false, false ) --We draw three parts to make the healthbar. First the outline/background local drawX = sx - NAMETAG_WIDTH*scale/2 drawY = sy + offset --[[local width,height = NAMETAG_WIDTH*scale, NAMETAG_HEIGHT*scale dxDrawRectangle ( drawX, drawY, width, height, tocolor(0,0,0,alpha) ) --Next the inner background local health = getElementHealth(vehicle) health = math.max(health - 250, 0)/750 local p = -510*(health^2) local r,g = math.max(math.min(p + 255*health + 255, 255), 0), math.max(math.min(p + 765*health, 255), 0) dxDrawRectangle ( drawX + outlineThickness, drawY + outlineThickness, width - outlineThickness*2, height - outlineThickness*2, tocolor(r,g,0,0.4*alpha) ) --Finally, the actual health dxDrawRectangle ( drawX + outlineThickness, drawY + outlineThickness, health*(width - outlineThickness*2), height - outlineThickness*2, tocolor(r,g,0,alpha) )--]] dxDrawText ( info.time, sx, drawY, sx, drawY, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE*0.8, "default", "center", "top", false, false, false ) end
-
Try this: x, y = guiGetScreenSize() --x is the width of the screen x = x - 100 --X is now 100 Pixel from the right end of the screen. dxDrawColorText ('#ffa500sb#ffffffgames#ffa500.com#ffffff.br', x, screenHeight - dxGetFontHeight(250, 'default-bold')/2+1, 100, 100+1, tocolor ( 255, 255, 255, 255 ), 0.9, 'default-bold', 0.60, 'right') end
-
Show the code... it should work. Use [lua] tag.
-
That's dxDrawing? If so, I would use guiGetScreenSize() and do something like this: x, y = guiGetScreenSize() --x is the width of the screen x = x - 100 --X is now 100 Pixel from the right end of the screen. --Then use x in the dxDrawText for the screenX argument. Understand?