-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
Probably a bad resource that is using the: root element for the addEventHandler with 'onResourceStart'.
-
Check: https://community.multitheftauto.com/in ... ls&id=2363
-
Wrong section Pathetic, crying on somebody else his doorstep.
-
Decompiled code looks different than before you compiled it. It is throwing information away for optimisation. Compiling code was original for optimize the code, the protecting layer came later. > Compiled code is the end result, it is not meant to be edited. Anyway, pls answer my question. Simple yes/no + the reason.
-
Something else, it is not(yet) related to the Debug Console. Annoyed with compiling your resources every time, script by script? Check out this page: automatic resource compiler. And now my question, even if the Debug Console isn't related to compiling resources. Do you want it to have this feature to compile automatic other resources? Since the debug console is already running, while developing your own resources.
-
Automatic compile your whole resource. Do what you want with it, but keep the formal credits. Don't forget that compiling isn't just for protection, it was also meant for optimization! Version for universal resource compiler: (NEW) resourceCompiler/meta.xml <meta> <info author="IIYAMA" type="script" name="Resource compiler" version="1.3.0" /> <script src="scripts/compiler_s.lua" /> <export function="compileResource" type="server"/> <aclrequest> <right name="function.fetchRemote" access="true" /> <right name="general.ModifyOtherObjects" access="true" /> </aclrequest> </meta> resourceCompiler/scripts/compiler_s.lua ------------------ -- by IIYAMA -- function compileResource (player, resourceName) if hasObjectPermissionTo ( player, "function.shutdown", false ) and getResourceFromName ( resourceName ) then if not hasObjectPermissionTo ( getThisResource (), "function.fetchRemote", false ) then outputChatBox(" ", player) outputChatBox("Require fetchRemote to compiling this resource!", player, 255, 0, 0) outputChatBox(" ", player) else local meta = xmlLoadFile(":" .. resourceName .. "/meta.xml") if meta then local folderName = "compiled/".. resourceName --.. "_compiled" local newMeta = xmlCopyFile(meta, folderName .. "/meta.xml") if newMeta then local metaNotes = xmlNodeGetChildren(meta) for i=1, #metaNotes do local metaNote = metaNotes[i] local scriptName = xmlNodeGetAttribute(metaNote, "src") if not scriptName or not string.match(scriptName, "compiler.lua") then if xmlNodeGetName(metaNote) == "script" then if scriptName and scriptName ~= "" then local FROM = ":" .. resourceName .. "/" .. scriptName local TO = folderName .. "/" .. scriptName .. "c" local scriptFile = fileOpen(FROM) fetchRemote( "https://luac.multitheftauto.com/?compile=1&debug=0&obfuscate=2", function(data) local newscriptFile = fileCreate ( TO ) if newscriptFile then fileWrite(newscriptFile, data) fileFlush(newscriptFile) fileClose(newscriptFile) end end, fileRead(scriptFile, fileGetSize ( scriptFile )) , true )--fileLoad(FROM) --https://luac.multitheftauto.com/api/ fileClose(scriptFile) end else local fileName = xmlNodeGetAttribute(metaNote, "src") if fileName then fileCopy (":" .. resourceName .. "/" .. fileName, folderName .. "/" .. fileName, true ) end end end end local newMetaNotes = xmlNodeGetChildren(newMeta) for i=1, #newMetaNotes do local newMetaNote = newMetaNotes[i] if xmlNodeGetName(newMetaNote) == "script" then local scriptName = xmlNodeGetAttribute(newMetaNote, "src") if not string.match(scriptName, "compiler.lua") then if scriptName and scriptName ~= "" then xmlNodeSetAttribute ( newMetaNote, "src", scriptName .. "c" ) end else xmlDestroyNode(newMetaNote) end end end xmlSaveFile(newMeta) xmlUnloadFile(newMeta) end xmlUnloadFile(meta) outputChatBox("Compiling done!", player, 0, 200, 0) end end end return true end addCommandHandler("compile", function (player, commandName, resourceName ) compileResource (player, resourceName) end) Installation: Put everything inside the folder resourceCompiler. (see file path for file name and sub folders) Use the commando: /refresh Give the resource the required rights(login as admin before you use this commando): /aclrequest allow resourceCompiler all This commando will give the resource all the rights that are defined in the meta.xml. (those are required to make the resource work) Rights: Usage: /compile [resourceName] There is an export function you can use. Now you are ready to go! Don't forget to leave a like! EXCLUDED (but can be included) Do you want to compile resources it in your admin panel as well? That would be nice right? (This source code is only on request because I do not want to be responsible for releasing a version of admin panel. My credits isn't on it as well) Like this post + send me a PM to get a look at the adminpanel adjustments! A PM with just: 'yes I want this!' is enough! Installation: Usage: Version for compiling inside the same resource: (OLD, but still useful)
-
Explosions are splash damage and not bullet damage. The use of getPedTarget won't help you. Only a GTA san damage overwrite would.
-
Explosion damage can't be cancelled, because the weapon is most of the time unknown. Unless you write a system, that replaces the damage dealing.
-
if attacker then end
-
GTA san is limited to only 1 CPU core and MTA is also limited to 1 core. If you make your code unoptimised, new CPU's with more cores will not make a lot of difference. The Ghz per core isn't something that will be increased dramatically, so yes a little bit optimisation isn't too much to ask. I am having an Intel i7-3770K 3.50Ghz 4 cores with multithreading to virtual 8 cores. If I write very unoptimised code, I am still stuck at only 1 core. That is when my GTA san is starting to crash. Good CPU? Not for MTA and unoptimised code. And if you want to share it with your friends = download speed.
-
The most important thing when are recording MTA, is to detect (important/large) changes. You can reduce a lot of data when you do that. You want to make the data as small as possible. So when you walk one direction and the rotation and Z as doesn't change much. You can delete all points in between. Of course you can record it first and later optimise.
-
Dear MTA scripters, Today I will start working on the next beta version. It has been 2 months since I first posted this topic and after the version 1.0.3 there will be probably not another beta version. That also means you won't be able to subscribe for the beta any more and your name won't be in the spotlights. Unfortunately, the most important thing that you will miss is your feedback being applied to the product. When the debug console leaves the beta, not much large changes will be made afterwards. So every (large) feature you wanted it to have, is something you have to create on your own. I hope I have informed everybody about this matter. Keep following this topic, because the finally release is also getting close. You don't want to miss it, if you like this new way of monitoring your debug information. Version 1.0.3 The debug console will be able to communicate with the resource resedit from The_GTA. P.s: Another thing, you can also request for the beta by replying here (say that you want it, that's all you have to do to get it). Since some people had problems with managing their pm's, doing it this way would make it a lot easier.
-
if getElementData(player, "AFK") then Or if getElementData(player, "AFK") == true then
-
Don't give immature - greedy - screaming baby's new toys will you! He has to make his first steps on his own... and not driving cars yet.
-
Yea, that also works when you don't want to sort.
-
>ped< is just a predefined variable you made up by yourself. (>ped< it is not a predefined variable) Use >source< instead. Pls, don't read this page sloppy: https://wiki.multitheftauto.com/wiki/OnPedWasted
-
I don't know an mta function for that. But you can: Read the gridlist and save it in a table. Clear the gridlist. Re-insert the items.
-
That is fine when you have a pc that can handle everything. If the map you run renders very slowly, you might end up inside the vehicle when you are standing on it. As for the amount of dx you render (depending on the handler priority), the longer the delay will be. The moment when updating the position of the player and the vehicle, it should be as close as possible to each other. Syncs should have priority over effects. If you disagree with that, it is fine.
-
onClientPreRender onClientRender renders too late.
-
[quote name=..&G:..] I am trying to attach an object to the vehicle. I know I 've tried this function with a player and an NPC, and whenever I turned arround, the NPC was still facing northAttach objects should be fine, unless there is something(a script) interfering. In 2015 I released a train script. It attaches perfect with that function.
-
You have to scale custom objects in you model editor. MTA can't scale Collisions. But if you do not care about collisions, this might help you: https://wiki.multitheftauto.com/wiki/Ge ... oundingBox
-
You mean guiBringToFront? No, check this.
-
Probably some code.
-
You have to focus on the element before you can edit it. That is just how it is suppose to be, it is not a bug. There are afaik no functions to change the element focus manually. Although there are some workarounds like: https://wiki.multitheftauto.com/wiki/OnClientKey
-
@mgdmgd Commands are not bound on resources. @ViRuZGamiing Anyway, you are getting pretty good at lua. A total different level as when we last met.
