-
Posts
1,058 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Saml1er
-
Have you tried using any other software to see if the lag is there or not? Try this: Start MTA in a low resolution like 800x600 > Right click on your task bar > Click Task Manager > Now look at the performance to see what's making you lag. The software might be accessing/writing to your disk in bad way, or might be eating too much memory which way lead to low FPS, and thus causing lags. You can also search for "Resource Monitor" from Microsoft. It's already there on your PC.
-
I'm sorry, but it's not possible to achieve what you want without a shader. To create a shader, you must learn HLSL which is a higher-level programming language used specifically for DirectX. You can check: https://wiki.multitheftauto.com/wiki/Element/Shader https://msdn.microsoft.com/en-us/library/windows/desktop/bb509561(v=vs.85).aspx https://msdn.microsoft.com/en-us/library/windows/desktop/bb944006(v=vs.85).aspx https://digitalerr0r.wordpress.com/2009/03/23/xna-shader-programming-tutorial-1-ambient-light/ and some examples from MTA here: https://wiki.multitheftauto.com/wiki/Shader_examples
-
Just like IIYAMMA said, you can use tables: local PlayersWithBoxes = {} -- create a table addEvent("GiveThing", true) addEventHandler("GiveThing", getRootElement(), function(localPlayer) local ObjectToAttach = createObject(1518, 0, 0, 0 ) attachElements ( ObjectToAttach, source, 0, 0.5, 0.4 ) setObjectScale ( ObjectToAttach, 0.9 ) PlayersWithBoxes [ source ] = ObjectToAttach -- 'key' is the player and 'value' is the object attached to player end ) addEvent("RemoveThing", true) addEventHandler("RemoveThing", getRootElement(), function(localPlayer) -- I'm guessing that you want to destroy the object attached to "localPlayer" local ObjectAttachedToPlayer = PlayersWithBoxes [ localPlayer ] -- access the object like this if isElement ( ObjectAttachedToPlayer ) then -- check if the object exists destroyElement ( ObjectAttachedToPlayer ) end end )
-
I believe, you are looking for a web developer, not a "scripter" because they are two different things. The cost totally depends on what you need, if you want a new template for your forum then it's probably going to be expensive ( 50$ - 1000$ ), but if you want some minor modifications to a free template for your forum then it can cost you 50$ - 100$. If you're looking for someone who charges less than that then good luck to you!
-
WARNING The code below works, but it does not secure your server from hackers. If a hacker manages to modify "isAdmin" variable on client side then he'll be able to fake his admin level access on client side scripts, not on server. If you are just using this to change rendering of HUD or something else that is not important then it's fine, but if you are enabling mods or other admin-level features on server by using isLocalPlayerAdmin function on client side then please check on server side every time before you give access to such features on server instead of client side. Okay, so, add these two files to your script and specify them in meta.xml. In client-side script, I have added a command "amiadmin" which will tell you whether you are an admin or not. You can remove it, if you want. Server side: -- remove these lines starting with local, if you want to use these -- functions in other server-side files local identifyPlayerAsAdminOnClient local isPlayerAdmin local isPlayerLoggedIn local isPlayerInACLGroup addEvent ( "onCheckPlayerInAdminACL", true ) addEventHandler ("onCheckPlayerInAdminACL", root, function ( ) if isPlayerLoggedIn ( client ) and isPlayerAdmin ( client ) then identifyPlayerAsAdminOnClient ( client ) end end ) addEventHandler ( 'onPlayerLogin', root, function () if isPlayerAdmin ( source ) then identifyPlayerAsAdminOnClient ( source ) end end ) function identifyPlayerAsAdminOnClient ( player ) triggerClientEvent ( player, "onIdentifyPlayerAsAdmin", resourceRoot ) end function isPlayerAdmin ( player ) local admingroup = "Admin" if not isPlayerInACLGroup ( player, tostring ( admingroup ) ) then return false end return true end function isPlayerLoggedIn ( player ) return not isGuestAccount ( getPlayerAccount ( player ) ) end function isPlayerInACLGroup ( player, groupName ) local account = getPlayerAccount(player) if not account then return false end local accountName = getAccountName(account) for _,name in ipairs(split(groupName,',')) do local group = aclGetGroup(name) if group then for i,obj in ipairs(aclGroupListObjects(group)) do if obj == 'user.' .. accountName or obj == 'user.*' then return true end end end end return false end Client side: local isAdmin = false addEvent ( "onIdentifyPlayerAsAdmin", true ) addEventHandler ( "onIdentifyPlayerAsAdmin", root, function ( ) isAdmin = true end ) function isLocalPlayerAdmin ( ) return isAdmin end function CheckPlayerInAdminACL ( ) triggerServerEvent ( "onCheckPlayerInAdminACL", resourceRoot ) end addEventHandler("onClientResourceStart", resourceRoot, CheckPlayerInAdminACL ) addCommandHandler ("amiadmin", function ( ) -- You can check whether the player is admin or not, like this: if isLocalPlayerAdmin ( ) then outputChatBox ("Command Response: Yes, you are an admin.", 124, 252, 0, true ) else outputChatBox ("Command Response: No, you are not an admin.", 255, 0, 0, true) end end ) The usage is very simple. You can use isLocalPlayerAdmin function like this: if isLocalPlayerAdmin ( ) then outputChatBox ("Command Response: Yes, you are an admin.", 124, 252, 0, true ) else outputChatBox ("Command Response: No, you are not an admin.", 255, 0, 0, true) end
-
It is possible to compress dff files, but you'll need to use a Lua library to accomplish that. You can use: https://github.com/brimworks/lua-zip It's basically a Lua module that allows you to compress files in .zip format, I haven't tested it, but I'm making a wild guess that it works. You'll need to load DFF manually by first using the module to compress it, read the compressed file, send it to the client using triggerLatentClientEvent Once the client has received the file, decompress it using the same module, and you'll get a string then use engineLoadDFF ( "yourDFFStringHere" ) to load the file.You save up to 45%. EDIT: Looks like the module is using C code, I guess you can't achieve it without that. I tried looking for some modules written in pure lua, I couldn't find any of them. Try looking by yourself, you might possibly find one.
-
Just like ccw stated in the article: 32-bit version of Windows has only 4 GB of addressable memory. As some memory is occupied by the OS, you are most likely left with 3.5 GB memory for programs. It's very important to upgrade to 64-bit Windows.
-
Cant change gamemode: gamemode resource could not be started
Saml1er replied to danylopez123's question in Server
Your code in race resource might have errors. Have you modified anything since last successful start? -
No, not even close. MTA is still using it.
-
Because it will freeze your server if result needs some time to retrieve. Although, it's not often but still you should check if the result has been successfully retrieved from dbPoll like this: local QueryHandle = dbQuery(database,"SELECT * FROM SpawnCar WHERE owner=?", owner) local PollResult = dbPoll(QueryHandle, 500) -- 0.5 seconds timeout, taking from @StormFighter if ( PollResult == false ) then -- try again or simply log it return false -- exit the function else -- continue the function end
-
You can delete the dump file, it will restore on it's own.
-
Render target is just like a paper. You simply draw whatever you want on the paper and finally, render the paper instead of rendering every single piece of 2D element or objects that you want to render. This is will save you expensive CPU cycles and thus give you better FPS. Now, what if you want to update the elements on the render target every 10 seconds? Well, you can destroy the render target and recreate it, draw (rectangles, images or text) on it and render it. Sounds good but what if you want to update the render target every 0.1 second or even faster? then that's where you cannot use render target. You'll need to render the drawing by calling it every 60 seconds or more ( That's how onClientRender works ). Read this: https://msdn.microsoft.com/en-us/library/bb976073(v=xnagamestudio.31).aspx
- 2 replies
-
- dxsetrendertarget
- lua
- (and 9 more)
-
Lua is an interpreted language. Your scripts cannot be loaded while they are encrypted. MTA must decrypt and then load them but still don't think that it's easy to steal them, it will take some good amount of effort. When you are encrypting ( compiling in MTA terms ) then please choose option 2 from luac.multitheftauto.com. It's the best way to protect your scripts.
-
Yes! netc.dll has anti-cheat for MTA. It is using some techniques to protect MTA which are also found in viruses and AVs. You can whitelist it without any concern.
-
I think, I got you wrong. Are you trying to let the client to download gta3.img from server and load the models? If that's the case then MTA has lua functions for that but you have to call them for every single model separately. https://wiki.multitheftauto.com/wiki/EngineLoadDFF
-
I'm working on custom-animations which also has the feature to replace and possibly disable default animations. You will be able to control it in upcoming MTA release or the adjacent one. Just wait till then.
- 12 replies
-
- 1
-
-
- weapon flags
- weapon handling
-
(and 1 more)
Tagged with:
-
I haven't played around with these settings since a long time but however, you can check the node "<enablesd>" and make sure it does not have "20" in it. https://wiki.multitheftauto.com/wiki/Anti-cheat_guide
-
Login as admin and execute "/debugscript 3". Run the script again. Also try debugging the code I gave you by adding "outputChatBox ("Some text")" in the newly created lua file.
-
onResourceStart is a server-side event that is triggered when a resource starts. It has nothing to do with a player joining a server. If you want to execute some code when a player joins your server then you should use onPlayerJoin for server-side and onClientPlayerJoin for client-side. On the other hand, onClientResourceStart is a client-side event that is triggered when a client-side script starts. You can have multiple scripts that should run on client side and this event will be called separately for each script. Once again, it has nothing to do with a player joining a server. The name of the event is misleading, onClientScriptStart (Not an event, just my opinion) would have made more sense but since the name of the event is hardcoded in most scripts so it's not an option to change it now. MTA WIKI: This event is triggered when a resource is started. Please note that this is not triggered the same time as the serverside event onResourceStart is. The event is triggered when any clientside resources are started. This means it is triggered when a clientside script is initiated after a download, which includes downloading after join. So: If a resource is running before a player joins, the onClientResourceStart event will be triggered after they join and have downloaded that resource. If a resource is started after a player has joined, the player will be made to download the required files, and then the onClientResourceStart event will be triggered.
-
Create a new lua file -> Add it to meta.xml and set type to "client" -> add this code: function LoadAllMods () Inter.refresh ( ); -- if player is in vehicle then don't load mods if ( localPlayer:getOccupiedVehicle ( ) ) then outputChatBox ( "Please exit your vehicle before enabling or disabling mods. Retrying in 15 seconds", 255, 255, 0 ); -- retry in 15 seconds by calling the same function again setTimer (LoadAllMods, 15000,1) return false end -- download the mods for i, v in pairs ( Downloader.Mods ) do Mods.SetModEnabled ( i, true ); end Inter.refresh ( ); return true end LoadAllMods () This should load all the mods, you want. If you want specific mods to be loaded then you can check them before loading: local MyMods = { ["someMod1"] = true, ["someMod2"] = true, ["SomeOtherMod"] = true } for i, v in pairs ( Downloader.Mods ) do if MyMods[i] then Mods.SetModEnabled ( i, true ); end end
-
Personally, I'd play anything as long as it's enjoyable.
-
I downloaded multitheftauto_linux_x64! Where do I add it to the MTA folder?
Saml1er replied to ShadowLoleris's question in Server
First do: apt-get update apt-get upgrade Once you have downloaded it then unpack it into a directory with command: tar -xf multitheftauto_linux_x64-1.5.4.tar.gz Next step is to remove the old config files and download new ones: rm -f baseconfig-1.5.4.tar.gz wget http://linux.multitheftauto.com/dl/154/baseconfig-1.5.4.tar.gz *some more steps* Check the wiki page for more info: https://wiki.multitheftauto.com/wiki/Installing_and_Running_MTASA_Server_on_GNU_Linux Finally you can run your server: ./mta-server64 If you face any problems then reply here. -
Great job! Looks nice
-
I found a working download link but the executable is unable to find correct link or MTA SA directory. You should contact 50p and ask him nicely to update the download link or maybe ask someone in MTA's discord server.