Jump to content

Ceeser

Members
  • Posts

    38
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Ceeser's Achievements

Rat

Rat (9/54)

6

Reputation

  1. Hey, renderTargets are squares and I want to display a circle by cutting out a part of the renderTarget. I've been trying the HUD Mask Shader, but that gives a weirdly distorted output image for some reason. Somebody told me that it is possible to "cut out" a circle from an input image using dxSetBlendMode and dxDrawCircle. I've been trying out a bit but it seems like I can't find a solution.. is it even possible to "cut images" using dxSetBlendMode and dxDrawCircle? Or even, like how does "overwrite" behaves? If I use dxDrawCircle(X, Y, r, 0, 360, tocolor(0, 0, 0, 0) I still see it as a black circle with 255 alpha - why?
  2. Ceeser

    [HELP]BANS

    It seems like "forumConnection" simply doesn't exist ( "got nil" ). Where and how do you define/create it? (hide data like ip/login/password!) also: Why do you use if (mysql_ping(forumConnection) == false) then twice in the function? Does.. destroyForumConnection() openForumDatabase(nil) establish a new connection between the 2 if's?
  3. I found, what's causing the problem I have. But idk how to write shaders, so not why it’s doing that.. Im using the HUD Mask Shader of the MTA Wiki and somehow that shader causes the distortion. The Yellow lines represent my viewing angle and the yellow circle is the section visible on the radar. I drew the renderTarget (as source) on fullscreen and on the left side is the radar. As you can see on the RenderTarget - Yellow Circle all lines are straight as wanted. On the radar the shades are shifted like a dxDrawRectangle rectangle cant even look. The radar gets drawn through the shader, so the shader has to do that to the renderTarget. Is there any other Mask Shader I could try?
  4. I've kept experimenting around, also tried out the texture, but the problem still exists :c Here another example screenshot of the (scaled) map + ingame view: If you want I could send you the whole resource so you could take a look yourself I'm really out of ideas. @IIYAMA
  5. Yes, the player.png gets drawn from that path (line 68) - Should I create a texture for it too to speed up drawing? But that's anyways the only radar blip, for the player (and this is fine)^^ Everything else gets created by the script (and shaped by the mask shader which gets drawn - line 67) But the problem is even before that, the renderTargets of the objects that get rendered are somehow "bend" if the objects rotation isn't "straight" like 0°, 90°, etc. (line 39 and 40, "object.rotZ"). The base rotation of the renderTargets are also fine, but the corners are not 90° which doesnt make much sense since renderTargets can only have 90° corners.. If the Object has a rotation of (like in the screen) 24° or sth the renderTarget basically gets rendered like this: ..and that doesn't make any sense to me.
  6. There are a few things unknown to us, so its hard to help you at all. For example, how does currentCell gets defined / clicked / selected? Why are you looping through in a numeric for-loop and (as it seems) above the maximum => "maxRows + currentCell"? If you used only snippets, better post the complete code, at least with all important stuff thats needed for what you wanna do.
  7. Hey, I'm currently working on a minimap / radar that shows objects. And now I noticed that somehow my renderTargets are distorted/warped if drawn at objects rotation, example: The objects that are at 0° rotation look straight, but the objects at 24° rotation are wierdly distorted. Ingame View of that: (to make the actual straight line - that should be visible on the radar - more clear I changed the color of the shades) I hope you get my point. It shouldn't even be possible, that a renderTarget (the shade-image get created and colored by the script) gets bend like that.. There is no parameter like for distortion in dxDrawImage, wtf . These yellow lines is how it should get displayed - in a straight line, or am I dumb? Is there any reason why that happens and/or any way I could fix it? To the code: tl;dr: There is litterally nothing that could cause the effect visible on the radar
  8. That actually makes a difference.. Well for elementData you could do that: funciton getRichestPlayer() local tblPlayersMoney = {}; for _, player in pairs(getElementsByType("player")) do table.insert(tblPlayerMoney, {player = getPlayerName(player), money = getElementData(player, "money")}); end table.sort(tblPlayersMoney, function (a, b) return a.money > b.money end); for i, v in pairs(tblPlayersMoney) do outputChatbox("Place " .. i .. " is " .. v.player .. " with " .. v.money .. "$", 255, 255, 255, true); end end
  9. Please expain a bit more: Are you using a db? Are you using accountData? Are you using elementData? Do you wanna use something else?
  10. Hey, for a UI lib I want to create textures for all image files included to the resource. So when it starts, it calls the function to load the images, create and store textures for them. My problem is now, how to get all image paths / names? Since the meta.xml doesn't get downloaded, the client file cant open the meta.xml and search for file src's (like i tried in the example). Manually use downloadFile("meta.xml") doesnt work and using the event "onClientFileDownloadComplete" to get the names of downloaded images doesn't work as well. Example: (What ive tried) function loadTextures() local sourceResource = sourceResource or getThisResource(); -- This is if the call comes from another resource to load in the images of that resource local strResourePath = ":" .. getResourceName(sourceResource) .. "/"; local tblImages = loadMetaImages(strResourePath); if (tblImages) then for _, image in pairs(tblImages) do local strName = removeImagePath(image); if (ELIB.textures[strName]) then outputDebugString("@ELIB - loadTextures: Dublicated image name found in" .. strResourePath .. " old image overwritten!", 2); end ELIB.textures[strName] = dxCreateTexture(image, "dxt5", true, "clamp"); end end end function loadMetaImages(strResourePath) local uFile = xmlLoadFile(strResourePath .. "meta.xml"); if (uFile) then local tblImages = {}; for _, node in ipairs(xmlNodeGetChildren(uFile)) do if (xmlNodeGetName(node) == "file") then local strImagePath = xmlNodeGetAttribute(node, "src"); if (string.find(strImagePath, ".png") or string.find(strImagePath, ".jpg") or string.find(strImagePath, ".dds")) then table.insert(tblImages, strImagePath); end end end return tblImages; end end function removeImagePath(strPath) while (string.find(strPath, "/")) do strPath = string.sub(strPath, 2); end end
  11. Ceeser

    question

    Maybe try to explain what you mean. Even use google translator if needed.. but by what you wrote nobody knows what you're on about
  12. Maybe take a look into [editor] - freecam resource, that might help you or is exactly what you need
  13. Ive once made a scoreboard which you could use and edit the config: https://ffs.gg/threads/82322-Release-Scoreboard-Easy-editable-Video?highlight=speedscripting
  14. Hello guys, A while ago I've been thinking "saving data is pretty annoying.. alot of lines, you are often doing it multiple times for different scripts." So I decided to make a resource as a central handler of data storing/loading. Now I want to share this resource to the community and hope that it will also help you save some time at scripting. The resource (including its functions) are added to the MTA Wiki which can be found here. What is xmlData? xmlData is a resource that provides 3 shared (so server- and client-side) exported functions for automated saving/loding/deleting of files: xmlSaveData (Wiki Page) xmlLoadData (Wiki Page) xmlDeleteData (Wiki Page) xmlSaveData require the data it should store to be a table and xmlLoadData will return the data as a table. These functions are exported function by the resource, so you need to call them. Example: local xml = exports.xmlData local tbl = {posX = 500, posY = 300, sizeX = 300, sizeY = 200} -- Saving xml:xmlSaveData("myFileName", tbl, false, true) -- This will save the file non-serverProtected but encrypted -- or you can do this xml:xmlSaveData("myFileName", tbl, 7) -- This will save the file serverProtected, encrypted, resourceProtected -- Loading local myTable = xml:xmlLoadData("myFileName", 7) -- This will attempt to load the data saved in highest security level -- Note: You need to load the data on the same security level as you saved it. Data security This resource also gives you ways to secure the data you want to store: Server protection -- If a file is server protected, only the server that has created it is able to read/modify it Encryption -- If a file is encrypted humans won't be able to read/modify it Resource Protection -- If a file is resource protected only a resource with the same name is able to read/modify it Combining these parameters will give you different levels of security for your file. For simplification you can instead of passing booleans just pass the security level you want to have (see the functions syntax please) 0 - No protection (any server, any resource or humans could read/modify) 1 - Very low protection (creator resource on any server or humans could read/modify) 2 - Very low protection (any resource on any server could read/modify, humans cant) 3 - Low protection (only creator resource on any server could read/modify, humans cant) 4 - Medium protection (any resource on the creator server or humans could read/modify) - Default setting if no 'security parameters' are given 5 - Medium protection (only creator resource on the creator server or humans could read/modify) 6 - High protection (any resource on the creator server could read/modify, humans cant) 7 - Very high protection (only creator resource on creator server could read/modify, humans cant) Other uses You can ofc use this script for example to save protected login data, but you can also use it in these ways for example: Cross-Resource communication: You could save a file called "settings" in resourceA and then load it in resourceB. Like this you have an easy way to make your server resources talk with each other without the need of events, exported functions and passing arguments. (if the file is not resourceProtected) Cross-Server communication: One step further could be that for example mapping script settings could be synchronized between different mapping servers (if the file is not serverProtected) Download The download for this resource can be found on the MTA Community page. Note: This resource does not require admin/any acl rank. I hope you like it and it will save you some work Sincerely, Ceeser
  15. As far as I know you get this error message in case the called function / resource has errors or as IIYAMA said the resource with the exported function is not started. So in case the required resource is started, check for errors in the debugscript that got outputted before your 'failed to call' error.
×
×
  • Create New...