-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
My bad, <settings> <setting name="*Option" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" /> <setting name="*Option2" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" /> <setting name="*Option3" value="1,2" friendlyname="Numbers" examples="1,2,3" desc="" /> </settings> local valueOfoption1 = get("Option") local valueOfoption2 = get("Option2") local valueOfoption3 = get("Option3")
-
https://wiki.multitheftauto.com/wiki/Xml
-
You can increase it a little, see the example of this page: https://wiki.multitheftauto.com/wiki/En ... ODDistance
-
Heh? Does the event 'onClientGUIMove' gets triggered when the gui isn't moving?
-
Ok, Well lets take a look the raw data of the system: - Which type op loops are you using? - How many times does the loop gets executed? (and is this the same as the amount of items) - How many times does: loop * loop * loop be executed? (main and sub loops) - What is the execution time of the entire code? (even if the table empty) - Does the memory drop when the loops aren't operating? If that is all correct, I need some time myself to think about it.
-
- You said maximal count is 530, so it shouldn't reach 800/850? - In how many tables are the same tables stored? (this most of the time leads to a memory leak) - How do you delete and add data? - Are there MTA elements involved or are you talking about lua objects? (GUI?) If so, try the same system without MTA elements.(fake it) - Are you using functions like: https://wiki.multitheftauto.com/wiki/GetNetworkStats ? Those have their own buffers.
-
Ah oke, he didn't upload it on the community, so I didn't know. It shares some features, but not all of them and it has a totally different concept in showing/(working with) debug information. Thx Walid! You are the best!
-
addEventHandler("onResourceStart", resourceRoot, function() loadFactions() for i,v in ipairs(getElementsByType("player")) do bindf1(v) end end ) function bindf1(v) bindKey(v, "F1", "down", showFactionMenu) end addEventHandler("onPlayerJoin", resourceRoot, function() bindf1(source) end )
-
local theTeams = {"Drug Dealers", "Police"} addCommandHandler("dd", function(player) local team = getTeamFromName(theTeams[math.random(#theTeams)]) if team then -- does the team exist? setPlayerTeam(player, team) spawnPlayer(player, 1585.5485839844, -1677.8289794922, 5.8969912528992) setCameraTarget(player, player) fadeCamera(player, true) setElementModel(player, 280) giveWeapon(player, 22, 200) setPlayerNametagColor(player, 0, 0, 255) outputChatBox("#0000ff(Mission) #8e8c00Kill the #fff000Drug Lord #8e8c00before he delievers the drugs!", player, 255, 255, 255, true) else outputDebugString("Team not found!") end end)
-
How about a feature to stop and start/restart a resource which contains this console message? I personally hate to stop a resource using adminpanel, when it simple can be done with 1 click. > Normally you have to open adminpanel(go to the resource tab), search first for the resource and click on stop, start or restart. Imagine you have only two buttons, one that restarts/starts the resource and one to stop it.
-
https://wiki.multitheftauto.com/wiki/LoadMapData https://wiki.multitheftauto.com/wiki/SaveMapData
-
Before you are going to clip it, it might be handy to check if the rectangle is actually inside the map: local areaXRightSide = areaX+areaWidth local areaYBottom = areaY+areaHeight local BigmapRightSide = Bigmap.PosX+Bigmap.Width local BigmapBottom = Bigmap.PosY+Bigmap.Height if ((areaXRightSide > Bigmap.PosX) and (areaX < BigmapRightSide)) and ((areaYBottom > Bigmap.PosY) and (areaY < BigmapBottom)) then Untested. local areaX2, areaY2 = math.min(areaX, Bigmap.PosX), math.min(areaY, Bigmap.PosY) local areaWidth2, areaHeight2 = areaWidth, areaHeight if areaX2 ~= areaX then areaWidth2 = areaWidth-(areaX-areaX2) end if areaY2 ~= areaY then areaHeight2 = areaHeight-(areaY-areaY2) end -- You can script the bottom clip!!!! dxDrawRectangle(areaX2, areaY2, areaWidth2, areaHeight2, tocolor(areaR, areaG, areaB, areaA), false); Untested And you can script the bottom clip! end
-
Debug console Easier debugging your code? Then this debug resource might be something for you. Screenshot of 1.0.2 Video of 1.0.2 Features, improvements and bug fixes: Stop and start/restart resources with errors/warnings Minimize window Download reduction (debug information) Stops the data transfer when reaching the maximal amount of transfers Custom ID system, which will give more options for other features. Move the window Saving the planet! Scale the window Fixed bug: not showing the cursor when the window is not active Zero state Saving window position and scale A small useful backup after restarting the resource. (50 items remain available for 1 min, after stopping the resource) Serverside: collecting errors and warnings from both sides, so you can also check errors/warnings from other players.(95%) + ugly GUI (Serverside: collecting errors and warnings from both sides) database? Direct line edit based on the error. Exporting to the File editor resource from Gothem. (He doesn't reply any more...) Credits for the testers. Opening debug automatic for developers. (serial or cookie or both?) ■ Finished ■ Working on ■ Waiting... * Requires the right: ModifyOtherObjects - For the functions: fileOpen, fileRead, fileClose To solve this problem, add the resource in your admin group. Controls: - Z > Showing the cursor - Left shift + Z > Showing the cursor(1.0.1) - Scroll > On top of gridlist or scrollbar - Page up and page down > Scrolling on gridlist How to start working with it? Login as admin /debugscript 3 If you are interested in trying it out, send me a pm. Join the closed beta, send me a pm (You don't have to write much information in it, just that you want it) After collecting and solving all the features and bugs, I will place it on the community, included with the names of everybody that came with suggestions/feedback. (Giving feedback is not just filling in the poll, but reply here with your opinion/suggestions) Scripters who already joined the beta: (1.0.0) MoDeR2014 DavidxD814 _Evo_ CrZy Shan ozulus EstrategiaGTA draobrehtom -Blaze- ma2med 3B00DG4MER (1.0.1) ramzi CodyL Blue Pie Tekken ShuxTemp AboShanab (1.0.2) wesleywillems17 KariiiM CoreyHUN (1.0.3) Syntrax# OmerFrk Xenius Memerrus Beta 1.0.1: Beta 1.0.2: Starting and stopping resources? Status running Status not running Important! from (1.0.1): The key combination to show the cursor is now: Left shift + Z If you are interested in trying it out, send me a pm. Join the closed beta, send me a pm or NEW reply on the topic itself! (You don't have to write much information in it, just that you want it)
-
I thought Target range was for showing: https://wiki.multitheftauto.com/wiki/Se ... kerEnabled That health bar marker on top of the head, but I am not sure.
-
moveObject_(unpack(movingData)) *(typo, can't type well on mobile)
-
local ignoreObjects = { [10324]=true, [10329]=true, [10330]=true, [10331]=true, [10332]=true, [10715]=true, [10719]=true } for i=550,20000 do if not ignoreObjects[i] then removeWorldModel(i,10000,0,0,0) end end setOcclusionsEnabled(false)
-
Nice! Btw, it had to be: local moveObject_ = moveObject function moveObject (...) local movingData = {...} moveObject_(unpack(movingData_)) setElementData(movingData[1], "moveObjectEndTime", getTickCount() + movingData[2], false) end -_-", my wrapper fails haha
-
That .lua file is only for controlling the map_loader resource, it can be merged with any kind of resource. From there it can load every map you want. exports["map_loader"]:loadMapForTarget(root, "sth-jackson") Read the instructions at the top carefully.
- 14 replies
-
https://wiki.multitheftauto.com/wiki/Split or https://wiki.multitheftauto.com/wiki/Gettok
-
try to use png-8, it is limited in settings but renders with better quality. (and is 20%/40% smaller) Works great with a monochrome images. Save the images to textures, before rendering will also improve the quality and render speed.
-
objects that move with the moveObject function, do not have any velocity. They simply get set at position every frame. If you use the moveObject function, you should already know if it is moving or not, since you set the duration. local movingData_ = movingData function movingData (...) local movingData = {...} moveObject(unpack(movingData_)) setElementData(movingData[1], "moveObjectEndTime", getTickCount() + movingData[2], false) end if getElementData(object,"moveObjectEndTime") > getTickCount() then outputChatBox("object is moving") else outputChatBox("object is NOT moving") end
-
local target = getPlayerFromName("myName") if target then exports["map_loader"]:loadMapForTarget(target, "sth-jackson") end This map loader is for scripters, there is no CLI(command line interface) or GUI because it is irrelevant for the target user.
- 14 replies
-
As MrTasty says. If the referention of a userdata is always correct, even when using a timer, the warnings in the console wouldn't be valid. Yet they(warnings) are there, at places where hé did exacly the same as your example. #Roots wants to get rid of all those errors, this is how he can do that.
-
no, setTimer( function(p) if isElement(p) then setElementVelocity(p, ...) -- or whatever end end, 5000, 1, source )
-
1. Elements can turn invalid(destroyed) during the timer delay. So check with the function isElement if the elements are valid after the timer end. isElement 2. Source elements must pas through parameters in order to use them properly. In some parts of your script you did that, but in other parts not. And that crash might be caused by the terrible amount of timers you use. Vehicle respawning can be done with 1 timer, for ALL vehicles.
