-
Posts
6,060 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
Yea, exactly. Except it is technically most of it in that way is not meant for Admins in the form of staff. Because you do want to remove those once you are finished. Too much debug isn't good for the performance as well as keeping overview. If you want to log things for staff Admin, then I recomment you to use https://wiki.multitheftauto.com/wiki/OutputServerLog Which will keep your debug information clean, so you can focus on real error.
-
If using a gui, use this to split: https://wiki.multitheftauto.com/wiki/Split And for using commands. The addCommandHandler function automatic splits arguments when passed over to the attached function. See examples: https://wiki.multitheftauto.com/wiki/AddCommandHandler
-
2 end's too much. One in both of the functions.
-
It needs to be a string and not a reference to a player. Use getPlayerName on the user data to get his name, which you can merge with the rest of the string.
-
`value` AND `val` are containing a nil value. They must contain a number value. If `value` contains a number value, it is all fixed. I can't help you any further than that with this code.
-
You can't move THIS debug console.
-
I apologies for my out of placed joke. But I am glad you figured it out with or without my help.
-
I am very sorry to say this, but your creativity skills are lower than zero... Because of the weed? Well here you are! Show me what you are made of! -- serverside addCommandHandler("checkPickups", function () local pickups = getElementsByType ( "pickup") for i=1, #pickups do local pickup = pickups[i] if getPickupType ( pickup ) == 2 then -- weapon pickup local respawnInterval = getPickupRespawnInterval ( pickup ) iprint("RespawnInterval:", respawnInterval) end end end)
-
I never said that you have to look at your debug console. The only thing I did, was give you a link which you can use to check what is going on with your pick-ups. Which is ALSO debugging. Make use of it, or smoke yourself and do not.
-
How about you debug it with this function? https://wiki.multitheftauto.com/wiki/GetPickupRespawnInterval
-
MY EYES HURT (A friendly advice to write it for your target audience)
- 2 replies
-
- 1
-
- map editor
- creative
-
(and 1 more)
Tagged with:
-
Maybe knowing the background of both sides will help you understand why that is. Serverside(code): Running on another computer/server (or application if hosted on the same pc). Clientside(code): Every player(his computer) is called a client. Between two sides there is something called ping. This it the communication delay between the client(your pc) and the server. You must have seen it in games. So if you are executing code clientside, other players will not see the result, because it is are only running on your machine. And if you are executing code serverside, other players will see the changes, because the server tells every player that something has changed. When you use a function serverside there there will be a delay before every client/player will see that something has changed. Which is related to the ping as well as to the internet speed. Also some client functions have the same result as serverside functions. Like setElementPosition or setElementRotation if you use them on a player. The player(you) are streaming your position/rotation to the server. So if you change your position clientside, the server will catch up slowly because of the streaming. But if you use these functions clientside on objects, other players will not see it changed, because objects aren't streamed like players are. Yet, I think serverside should always be in control of position and rotation because it might cause lagg or de-sync.
-
White image gets black borders when scaling down height
IIYAMA replied to John Smith's topic in Scripting
P.s. a week ago I did a test with loading images in to textures, these are the test results: Converted 1000x images to textures. Converted to: dxt5 and mipmap Format: png (uncompressed) Load time: 2262ms Filesize: 64,2kB Format: dds Load time: 2093ms Filesize: 64,1kB Format: dds + mipmap Load time: 2000ms Filesize: 85,4kB Format: dds + dxt5 Load time: 1024ms Filesize: 16,1kB Format: dds + dxt5 + mipmap Load time: 470ms Filesize: 21,4kB Compressed dds textures files with embedded mipmap, can be converted 4 times faster to optimised render images(with mipmap) than the default png files. Load time: 470ms VS Load time: 2262ms (1000x loading) Test image(png): 128 x 128 While loading the textures in to the memory. Converted to: dxt5 (and mipmap) Format: dds + dxt5 + mipmap Filesize: 21,4kB VS Converted to: (mipmap) Format: png (uncompressed) Filesize: 64,2kB -
White image gets black borders when scaling down height
IIYAMA replied to John Smith's topic in Scripting
To be honest, I have no idea why this is happening. It might be because of the complexity, but at the end the reader and converter is resonsible for it. There is one last format you can try. It is called: dds Which is a format that can be used directly in to the memory of your video card. https://en.m.wikipedia.org/wiki/DirectDraw_Surface The biggest down side of this format is the filesize It also has the option to pre-compress them with dxt 1, 3 or 5.(quality will drop of course) (Must be a power of two. e.g. 128, 256) . Read this page for more information: https://wiki.multitheftauto.com/wiki/DxCreateTexture Converter to dds: https://nightly.multitheftauto.com/files/shaders/DxTex.zip -
White image gets black borders when scaling down height
IIYAMA replied to John Smith's topic in Scripting
To prevent the gray borders, save the image as >png8<. https://helpx.adobe.com/photoshop-elements/using/optimizing-images-gif-or-png.html As you have only white, you will not have problems with the color limitations of png8. -
It can't be sorted because the indexes of the array are strings. The indexes are now: "player1", "player2", "player3", "player4", "player5" Because: { player1 = {points = 25, playerName = "RandomNick1"} } -- is them same as { ["player1"] = {points = 25, playerName = "RandomNick1"} } Before you can sort them , you need the indexes to be the ones of an array: 1, 2, 3, 4, 5 So you need to transform the keys from one form to another. simpleTable = { player1 = {points = 25, playerName = "RandomNick1"}, -- < item player2 = {points = 1, playerName = "RandomNick2"}, player3 = {points = 13, playerName = "RandomNick3"}, player4 = {points = 27, playerName = "RandomNick4"}, player5 = {points = 7, playerName = "RandomNick5"} } -- Make a new empty table. newSimpleTable = {} -- Use the pairs loop. (not the ipairs loop, because that one can't read the items with custom keys) for key, data in pairs(simpleTable) do -- Insert all items into the new table. newSimpleTable[#newSimpleTable + 1] = data end -- Now you can sort them. table.sort (newSimpleTable, function (a, b) return a.points > b.points end)
- 1 reply
-
- 2
-
This one: https://wiki.multitheftauto.com/wiki/FadeCamera
-
It isn't limited. But you may lose overview if you spam it from too many different components.
-
local vehicleHealth = getElementHealth(source) outputChatBox("My vehicle health is: " .. tostring(tonumber(vehicleHealth) or "?"))
-
You are setting the angleAmount to 1 and not to 45. Use 5e argument and not 3e argument. 1, 2, 3, 4, 5, ... posX, posY, radius, width, angleAmount dxDrawCircle( 200, 200, 45, 5, HERE, 0, 90 )
-
I can't look at it and help you, if you don't post it.
-
angleAmount 360 / 8 = 45 Just play with it and debug it. It is the only way to understand it...