Jump to content

IIYAMA

Moderators
  • Posts

    6,064
  • Joined

  • Last visited

  • Days Won

    209

Everything posted by IIYAMA

  1. 1 Those markers aren't working since you are using an ipairs loop which only works at the array. (should be a pairs loop) 2 Nothing checks which player enters the marker, thePlayer should be compared with localPlayer before opening the gui.
  2. IIYAMA

    Side Camera

    Afaik you can also re-attach your camera to your ped. Take a look at the example at this page: https://wiki.multitheftauto.com/wiki/GetCamera
  3. Function works fine with me, you should execute it clientside.
  4. https://wiki.multitheftauto.com/wiki/GetElementMatrix Take a look at the examples. Wiki source:
  5. setAccountData (account, "funmodev2-carupg", toJSON (getVehicleUpgrades(car))) local upgrades = getAccountData (account, "funmodev2-carupg") if upgrades then for i,v in ipairs (fromJSON(upgrades)) do addVehicleUpgrade (vehicle, v) end end Use LUA tags, pls.
  6. Or replace them using a shader, but you will be limited by it.
  7. IIYAMA

    Ped

    setElementFrozen(LVHshop,true)
  8. Custom fonts have terrible anti-aliasing and subPixelPositioning argument probably doesn't work well on them. I am not a fan of custom fonts.
  9. There must be changes, fonts are vectors formats that have their own raster. By enable subPixelPositioning the font will be using it's own raster and it will flow. Like switching in Photoshop from sharp to smooth. The first time I enabled it, I saw directly the differences. Those are default fonts right? If they are, then I will recommend you to make a screenshot with another computer, because anti-aliasing is enabled for default fonts.
  10. @Xabache Clientside and serverside are two total different systems. They both have their own jobs, in most cases they are different pc's. In some cases you can do things one sided, but design, rights and possibility's are spilt up by those sides. Are you aware of their purposes and why there are functions that can only can be executed on one side?
  11. You tried to use a render target? When using rendertargets you will lose your anti aliasing/sub-pixels. What I will recommend is to enable the subPixelPositioning argument during drawing your text. [b]subPixelPositioning:[/b] A bool representing whether the text can be positioned sub-pixel-ly. Looks nicer for moving/scaling animations.
  12. for i=1,#cars do local carTable = cars[i] if carTable[1] == carID then outputChatBox("Price: " .. carTable[2]) break end end There are more possibility's to do this, but that depends about how you use this tables in other ways. When you change the table you are able to use other ways.
  13. Well that depends on your intentions. The function dxGetTextWidth will might be handy to make something fit inside a rectangle. But the relative size DxGetFontHeight might do it, but because it is a custom font I am not sure if the result will be correct. The best thing you can do is draw the text and make a screenshot of it. Use photoshop to check how much pixels high it is and in the end you can calculate the relative size. So yes the font height is the solution, but I will recommend you to try both ways.
  14. IIYAMA

    [HELP] Table

    ah your OOP functions are elementdata instead of accountdata. I am not using OOP functions, so I wasn't sure which it was. I am using no OOP functions because I know a lot of mta functions out of my head. function onSave(player) if isElement(player) then local serial = player:getSerial() or "" -- just in case local name = player:getName() or "" -- just in case local health = player:getHealth() or 100 -- just in case local x, y, z = getElementPosition(player) local pos = toJSON({x, y, z}) local needs, status, items = {}, {}, {} for k, v in pairs(Table) do for i, data in pairs(v) do if (k == 'need') then needs[#needs+1] = player:getData(data[1]) -- [#needs+1] < making sure it starts from the first index. elseif (k == 'stat') then status[#status+1] = player:getData(data[1]) elseif (k == 'item') then items[#items+1] = player:getData(data[1]) end end end player:setData('logged', false) needs, status, items = toJSON(needs), toJSON(status), toJSON(items) getDB():exec('UPDATE `accounts` SET `login` = ?, `health` = ?, `pos` = ?, `needs` = ?, `status` = ?, `items` = ?, `lastdate` = NOW() WHERE `serial` = ? LIMIT 1', name, health, pos, needs, status, items, serial) outputServerLog('Account Name: '..name..' was saved automatically.') end end Anyway take a closer look at my notes. Also on what are the accounts based? Name or serial? Because you can never rely on the player his name.
  15. IIYAMA

    [HELP] Table

    Looping through a table which uses custom indexes(something else then numbers) isn't very efficient, but sometimes you have to. I am more worried about the functions(especially database functions) than the loops you are using. When I take a look at your examples, I assume example 2 is more efficient then example 1. Because when you start a loop, the code inside it will be temporary saved in to the ram, which will speed up when the loop executed more then one time.
  16. Everybody has time for his hobby ones in while.
  17. IIYAMA

    [HELP] Table

    Just make sure you don't access the database too much, or your server might crash. Of course you can loop through all the players and store the data when you shut down the server. It will peak your cpu usage, but it must not be constantly like that.
  18. IIYAMA

    Alt+tab / windowbutton

    I found the problem. It wasn't related to MTA nor my drivers. I am using next to MSI Afterburner the program RivaTunerStatistics Server to showing my GPU's usage, fan speed and temperature. So I can keep an eye on them when playing arma 3, since they can get very hot(around the 90°C) while playing that game. It seems that was the problem. @Dutchman101 I am sorry for wasting your time.
  19. Use at least the "clamp" method. I also recommend you not to scaling your image. Just use the download-function to download the image which is matching the resolution, like a responsive website.
  20. Are you kidding me? How am I suppose to help you when you aren't correcting your code? I already said what you have to change, DO IT! hitElement has never been defined in the entire code, you can't expect it to be something. Use the predefined variable > client < instead.
  21. Line 51 and 58: if isElement( theVehicle[source]) then destroyElement(theVehicle[source]) theVehicle[source] = nil end if theVehicle[source] then if isElement( theVehicle[source]) then destroyElement(theVehicle[source]) end theVehicle[source] = nil end When vehicles get destroyed by another resource or they are included in a map, your system doesn't clean the table properly. Also your code is duplicated, it probably doesn't work because you have two times the same event handlers.
  22. triggerLatentClientEvent is a slow download progress. I will recommend you to increase the bandwidth and also check the status. https://wiki.multitheftauto.com/wiki/Ge ... ventStatus https://wiki.multitheftauto.com/wiki/Ge ... entHandles
  23. I said that the mta forum doesn't allow stretching, that doesn't mean mta can't stretch images. 1 super small image is better then 1 big images, with the same result. Read it better next time.
  24. Ever heard of the term responsive website? Since the new function DownloadFile has been released, you are able to make easy responsive content. Images are the key to custom effects. https://wiki.multitheftauto.com/wiki/DownloadFile Tip:(what you also can do) If you want create nice buttons which you want to resize, you may consider to create a gradient which is: 1 pixel width and 32* pixels height. You probably have to skip the round corners for this. IMAGE * just how good the quality must be. When you stretch the image.(forum doesn't allow it, so I copy past it a few times.)
  25. Delete samp, that's what you should do.
×
×
  • Create New...