-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
For loading from the MySQL, split up the data under more keys. For the processing serverside: setTimer + repeat until + getTickCount() For the processing clientside: "onClientRender" + repeat until + getTickCount() For the network: https://wiki.multitheftauto.com/wiki/Tr ... lientEvent And use your own creativity.
-
Use the software col editor to splits the colfile and txd editor to splits also that file.
-
The function getPedTask gives more accurate results in what the player is doing and will be more 'efficiënt'... https://wiki.multitheftauto.com/wiki/GetPedTask
-
Or https://wiki.multitheftauto.com/wiki/ProcessLineOfSight
-
They are using https://wiki.multitheftauto.com/wiki/Tr ... lientEvent for that. They read the files and transfer them as a string. But this is not the same as streaming, this is just transfering it a different way and not faster if you ask me. The mods are available when they are downloaded, there is no way around that.
-
Replace models in your gamemode when needed. https://wiki.multitheftauto.com/wiki/DownloadFile Just make a table which keeps all resource names that have mods, audio and other things. And load what needs to be loaded. Mods can't be streamed, that is obvious.
-
Playing music requires client functions. https://wiki.multitheftauto.com/wiki/PlaySound But that doesn't mean you have to execute that function on the script of the map. You can also execute that function on your gamemode.(as long it has access to the file or url) If you don't want clients to download music, you can stream them from an URL. Required Arguments soundPath: the filepath or URL of the sound file you want to play. (Sound specified by filepath has to be predefined in the meta.xml file with tag.) I have never streamed music from an url, so you have to figure that out for yourself.
-
Serverside scripts right? You can use loadstring, but I recommend you to splits the scripts from the maps. Otherwise you probably have to edit the scripts. Because the event "onResourceStart" doesn't get triggered when you start a script with loadstring. Just start them with: https://wiki.multitheftauto.com/wiki/StartResource And add in the meta of the maps: <include resource="theResourceName" /> Which also gives you the benefit that you can also load client files easy. Or you use my map loader for that: https://community.multitheftauto.com/in ... s&id=12068 Documentation: https://forum.multitheftauto.com/viewtopic.php?f=108&t=92549
-
They both create the same type of elements. The only difference is that they use a different (middle) parent element. See here more information about those middle parents: https://wiki.multitheftauto.com/wiki/Element_tree
-
.map vs createObject There is a difference between loading speed. Because for loading a map file there is only 1 MTA function needed(or none when it is included in the meta.xml). When using createObject you have to execute that per object and you have to use other functions to add properties. Map files will be loading directly with the C++ functions which are intern. When using MTA functions, they will call those functions external. Which is slower.
-
This function will make it a lot easier: local weapon = getPedWeapon(player,index)-- index = slot https://wiki.multitheftauto.com/wiki/GetPedWeapon New structure: [1] = {2,[color=#FF0000]{[22]=true,[23]=true,[24]=true}[/color],tonumber (get ("Handgun Limit"))}, local isWeaponLimited = value[2][weapon] -- true/nil if isWeaponLimited then Line 17 isn't required. if getPedTotalAmmo(v,value[1]) ~= value[3] then Put the timer on 500 ms, the result of getPedTotalAmmo only changes after the clients are sync their ammo back. This event isn't required to be bounded on a function that is for all players. addEventHandler ("onPlayerWeaponSwitch",root,weaponLimit)
-
Fixed it! imageFileData = string.gsub(imageFileData,'\n', "") I had to remove the line breaks, now it works like charm! And thx for the reply Dealman! This is the circa the result: In illustrator Ingame Not original scale X and Y.
-
Hmmm that is a good one. I tried it, but as result the quotes are misplaced. In the decoded string there are also quotes. Probably the reason why they use base64. The browser will also think: "Wtf, I can't decode a decoded image."
-
With the function: https://wiki.multitheftauto.com/wiki/GetZoneName This function can check which area is what. You have to to write a system that gives you the positions and size by yourself.
-
I am trying to read the svg file images and write them to temporary files. But it looks like the format isn't correct decoded and the temporary files don't work. local image = attributes["xlink:href"] if image then --data:image/png;base64, local _,stringMiddle = string.find(image,"base64,") if stringMiddle then local stringEnd = string.len(image) local imageInfo = string.sub(image, 0, stringMiddle) local imageFileData = string.sub(image, stringMiddle+1, stringEnd) if imageFileData then -- remove spaces etc. --------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------- imageFileData = string.gsub(imageFileData,'\\r', "\r") imageFileData = string.gsub(imageFileData,'\\n', "\n") -- from [url=http://stackoverflow.com/questions/23488404/decode-base64-string-and-write-to-file]http://stackoverflow.com/questions/2348 ... te-to-file[/url] -- --------------------------------------------------------------------------------------------- ----------------------------- imageFileData = base64Decode(imageFileData) if imageFileData and imageFileData ~= "" then local file = fileCreate("tempFolder/tempolaryImage.png") if file then fileWrite(file, imageFileData) fileClose(file) if fileExists("tempFolder/tempolaryImage.png") then outputChatBox("yea") local texture = dxCreateTexture ( "tempFolder/tempolaryImage.png") if texture then outputChatBox("texture was a success!") else outputChatBox("texture failed!") end --fileDelete("tempFolder/tempolaryImage.png") -- delete ones readed. end end else outputChatBox("imageFileData failed!") end end end end The file I am decoding looks like this: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB28AAAOsCAIAAADiCGozAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ bWFnZVJlYWR5ccllPAACPgVJREFUeNrs3QlcFOX/B/ARFhcBueQQREEUVBBCQBRRVARvkET5eSTl RWVFSaXkffZDf6mlpYlp/zDJ8ML7WlEpxBARQUhQVxAUQW4FQRb8z7G77C6zB5fn5/16lcvMM881 szOz3332mXb+/v5lZWXEC6Gvr//CynrjoTOb4fHjx+gEAAAAAAAAAACA5uEQLyrElp+f7+bmhnAe OvMldpqZmRn6AQAAAAAAAAAAoHnU0AUAAAAAAAAAAAAAoBSiyQAAAAAAAAAAAACgHEf1pLa2tlOm [b]etc. etc. etc.[/b] EwqFQjDqdPJpZnV4uEK6EB4u5+l1Wq18vthr9FgP6aLQcvmotlq6GRIT5TymOajEd0jLuXrfybGx sY+MH9JUmb/6lRxLKlrpI17+4vv3z5TuTB3dcvFQ1qr/PNjxWIzFrye8sPVss/lCbe5rq/Mrm32n WoJ8cfm61xDe1QAAAABu3f8XYACcGqtfVbrzzAAAAABJRU5ErkJggg==
-
https://wiki.multitheftauto.com/wiki/GetRadarAreaSize
-
My Facebook account is not for MTA, but you can pm me your skype name instead.
-
wait for 1.6... or use 1.6 beta. 1.6 will enable functions to control that. I have the same problem with: https://forum.multitheftauto.com/viewtopic.php?f ... ain+script
-
Why don't you ask him directly? You don't need us for this. Bonsai
-
ah I miss read, it was already called. And it did already work. function getResult () if getElementData(localPlayer,"calculator") == true then local dataText = getElementData(localPlayer,"calculatorText") local result = loadstring ( "return "..dataText ) if result then local theNumber = result() if theNumber then setElementData(localPlayer,"calculatorText",theNumber) else setElementData(localPlayer,"calculatorText","Error") end end end end bindKey("num_enter","down",getResult)
-
local theSum = "1+3" local result = loadstring ( "return "..theSum )(); local theNumber = result() -- call
-
The result of loadstring must be called.
-
There are a lot of ways to do this. local a,b = string.match("1+3","(%d+)+(%d+)") outputChatBox(tonumber(a)+tonumber(b))
