-
Posts
866 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Mr_Moose
-
That depends on which resource your base are located in, if that fails to load it will generate an output with a reason as well.
-
Just read the output, all info is there, a resource named 'modloader' can't find the file 'weapons/cuntgun.txd'. Then you have a resource named 'reload' both in [DayZ] and [gameplay] causing conflicts due to their duplication.
-
You have multiple resources using the same name and at least one file that hasn't been found, remove or rename one of them, and check the meta file in the resource with missing files to make sure it's available there, then refresh again, "/refreshall" is not some kind of magical commands that solve all your problems, it will only try to refresh and inform you why it failed in case it fails to refresh.
-
Maybe that was to complicated for you, just upload the files you want to compile at: https://luac.multitheftauto.com.
-
The element tree from wiki explains why The chat message are only shown to players but with root as element it has to go through all elements, even those who's not goanna view the chat.
-
You can compile at https://luac.multitheftauto.com, decompile is hard, almost impossible and you shouldn't need any reason to do so. If you're running on Linux and has many files to compile this might help you. #!/bin/bash # Grand Theft Walrus: auto compiler v.1.4.132 # Global settings FILES=<resource_directory> EXT="c" BAK=".bak" recurse() { for i in "$1"/*; do if [ -d "$i" ]; then sleep 1 # Do not remove! recurse "$i" elif [ -f "$i" ]; then # Compile if lua file if [ ${i: -4} == ".lua" ]; then cp $i $i$BAK ./luac_mta -s -e -o $i$EXT $i echo "[Compiling] $i" sudo chown nobody:nogroup $i # Replace lua with luac in meta.xml elif [ ${i: -8} == "meta.xml" ]; then cp $i $i$BAK sed -i 's/.lua/.luac/g' $i fi fi done } # Information and status ./luac_mta -v recurse $FILES echo "Compiler finished successfully!"
-
Do a refresh, then try to start the resource again "/refresh all".
-
As I said, lot's of errors get's confusing in the length, listen to what Necktrox said here, destroyBlipAttachedTo is called by an event trigger onPlayerWasted, source is the dead player and four other parameters are passed to the function which must be handled as well, ammo, attacker, weapon and bodypart. function destroyBlipAttachedTo(ammo, attacker, weapon, bodypart) local attached = getAttachedElements(source) if not attached then return end for index , attachedElement in pairs (attached) do if getElementType(attachedElement) == "blip" then destroyElement(attachedElement) outputChatBox("APB has been Jailed Successfully", root, 0, 55, 255) end end addEventHandler("onPlayerWasted", root, destroyBlipAttachedTo) Try at least, and don't be afraid of the wiki, there's a lot of useful information there.
-
There are so many errors so it's better to just restart from the beginning, first of all, when scripting on the server side you need to know where your player is defined, you're making a call from client side with triggerServerEvent to the function Blip I suppose? then you have your player in the variable 'client' if the client side part is written correctly. function Blip () local x, y, z = getElementPosition(client) local blip = createBlip( x, y, z, 20 ) setElementParent( blip, client ) end addEvent("onDes", true) addEventHandler("onDes", getRootElement(), Blip) function destroyBlipAttachedTo ( player ) local attached = getAttachedElements ( player ) if not attached then return end for index , attachedElement in pairs ( attached ) do if getElementType ( attachedElement ) == "blip" then destroyElement ( attachedElement ) outputChatBox("APB has been Jailed Successfully", root, 0, 55, 255) end end addEventHandler( "onPlayerWasted", getRootElement(), destroyBlipAttachedTo) Destroy function had one 'end' to much but you never got there due to the earlier errors, it should be fixed here so try it and look at it carefully to find out what changes was made to make it work.
-
Upgraded with an export call from the server side, this allow any train to use the horn, even bots: https://github.com/GTWCode/GTW-RPG/tree/master/GTWtrainhorn
-
It becomes obvious when you compare the syntax of the two functions: getResourceFromName and getResourceName. resource = getResourceFromName(string name) string = getResourceName(resource res) Passing a string is always possible but you can't pass a resource that doesn't exist, that's the reason for the warning, sometimes it's good to know how things actually work
-
You can never be 100% safe but any kind of compiling makes it harder for most thieves, that tread has most of the info regarding the compiler that's why I linked to it. According to the wiki, cache: When the script file type is "client", this setting controls whether the file is saved on the clients' hard drive. Default is "true". Using "false" will mean the file is not saved. i.e it has nothing to do with the storage device level. Most servers will definitely handle downloads above 5MB each time a client joins, the problem are all of those players with slower network that might leave due to slow (large) downloads. It's a balance between what's acceptable or not and it's up to the server owner to decide about that, there are many cases where it's probably the best security solution to avoid saving anything on the clients hard drive.
-
I wouldn't recommend disabling cache, it is safe thought but every time a player joins they'll need to download everything again, there used to be other ways to compile as far as I know but currently it can only be done at https://luac.multitheftauto.com, or to be more correct, if it's compiled elsewhere it won't load for security reasons. I don't think anyone actually managed to decompile anything compiled at https://luac.multitheftauto.com yet, here's more info about that if you're interested: viewtopic.php?f=91&t=78858
-
Store all locations in a table: local markersData = { { x, y, z }, { x, y, z }, { x, y, z } -- ... } Then use math.random to choose a random marker: local x,y,z = unpack(markersData[math.random(#markersData)]) I assume you want the player to travel a certain distance and prevent the same marker from appearing as the "finish line", if so you can check the distance this way: local distance = getDistanceBetweenPoints3D( x1,y1,z1, x2,y2,z2 )
-
You can't use any other technique than onClientRender and still make it smooth, however you can do a lot to optimize, for example, passing the root element to onClientRender could increase the CPU usage a lot, using bone position might not be the most optimal solution either, you could try getElementPosition and just use it's z value to determine at which height the nametag should be drawn. You could try this and see if there's any difference: local x, y = guiGetScreenSize() function PlayerNameTags() local players = getElementsByType("player") for k,v in ipairs(players) do if v ~= localPlayer and getPlayerTeam(v) then local r,g,b = getTeamColor(getPlayerTeam(v)) local x1,y1,z1 = getElementPosition(localPlayer) local x2,y2,z2 = getElementPosition(v) local visibleto = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2) if visibleto < 14 then local sx,sy = getScreenFromWorldPosition ( x2,y2,z2+0.3 ) if sx and sy and not getElementData( v, "anon" ) and getElementInterior(v) == getElementInterior(localPlayer) and getElementDimension(v) == getElementDimension(localPlayer) then local nWidth = string.len(getPlayerName(v)) or 20 dxDrawRectangle( sx-((nWidth*14)/2),sy-7,(nWidth*14),30, tocolor(0,0,0,100)) dxDrawText( string.gsub( getPlayerName(v), "#%x%x%x%x%x%x", "" ).."", sx,sy,sx,sy, tocolor(r,g,b,255), 0.5, "bankgothic", "center","top",false,false,false ) end end end end end addEventHandler("onClientRender",root,PlayerNameTags) It's a modified version of the nametag system in the race resource which doesn't seems to use much CPU at all, also have you tried performance browser? http://yourseverip:yourserverhttpport/performancebrowser, that's a great tool to detect "CPU leaks".
-
There is a default resource included named 'playerblips' that does this for you in a basic way, use '/start playerblips' to activate it. Not sure if that's exactly what you want but it's relatively close and easy to modify if needed.
-
That's a part of a bigger problem I guess, you need to show all relevant lines that may be involved causing that error. If that's the only line then it's hard to say more then guessing this is what's your looking for: end)
-
ExecuteCommandHandler might be the solution, only works for commands written in lua (i.e custom functions you wrote by yourself) and not the hardcoded commands. -- server bool executeCommandHandler( string commandName, player thePlayer, [ string args ] ) -- client bool executeCommandHandler( string commandName, [ string args ] )
-
Fraps can record at 60FPS as well it's all depending on hardware, and modules are as far as I know limited to the server machine, access to the client machines are very limited for security reasons. The main question here would be about the purpose of this, are you going to detect this in secret or are the clients aware that you know which applications they are running? Taking fraps as an example you could use bindKey and try to bind a key most people would use to record with fraps. You can't get the actual key, only guess what your clients use but it may work in some cases.
-
It's not hard at all, can be done with less than 10 lines, and that's why you probably won't get support here. There's 150 lines of well written client side code and you're having trouble with just a few lines of the server side, which you didn't even tried to make, that kind of signs usually indicates that the script is leaked or stolen. Starting your post by saying "I have this" won't say anything about the author, no credits or license was found in the script, what are you trying to hide? If you really wrote this yourself then you won't have any trouble writing the server side part, you should at least try before asking someone to do all the work for you.
-
Thought you where going to sell something, why can't you show it in public then, screenshots won't hurt and a live demo is probably the best way to show your work.
-
In case you are running your server on Linux over SSH and getting sick of people constantly stealing your client side scripts, this might be the solution you're looking for. With this recursive compiling script you can compile your entire resource catalogue, even multiple servers at once (on shared hosts for instance). Requirements: The compiler application for Linux, (download here: https://luac.multitheftauto.com/api/) Your server must be running on Linux. Installation: Download the official compiler application Copy below script sand save it to a *.sh file in the same directory as 'luac_mta' Change '' on line 4 to the directory where your resources are located Make it executable by running 'chmod +x *.sh' Run the script './*.sh' Features: Compiles every .lua file recursively Update 'meta.xml' by replacing the '.lua' extension with '.luac' Takes a backup of every file before doing anything to them. Saves you time since you don't have to compile every file individually. #!/bin/bash # Grand Theft Walrus: auto compiler v.1.4.132 # Global settings FILES=<resource_directory> EXT="c" BAK=".bak" recurse() { for i in "$1"/*; do if [ -d "$i" ]; then sleep 1 # Do not remove! recurse "$i" elif [ -f "$i" ]; then # Compile if lua file if [ ${i: -4} == ".lua" ]; then cp $i $i$BAK ./luac_mta -s -e -o $i$EXT $i echo "[Compiling] $i" sudo chown nobody:nogroup $i # Replace lua with luac in meta.xml elif [ ${i: -8} == "meta.xml" ]; then cp $i $i$BAK sed -i 's/.lua/.luac/g' $i fi fi done } # Information and status ./luac_mta -v recurse $FILES echo "Compiler finished successfully!" Note that line 10 has a sleep of 1 second, that's when we switch to the next resource. It has noting to do with this script itself but saves bandwidth for luac.multitheftauto.com, also avoid running this to often since it may have negative effects on performance if to many files are compiled at the same time. License:
-
All you need to do is to use triggerServerEvent, once the right button is clicked in the GUI, then you need an event handler in the server side part. In fact, there is already a GUI included in the source which shows exactly how you can do this, http://code.albonius.com/?action=download&id=8523e282173778cc46739ae4405d3784
-
The first error is due to a missing resource, in this case 'play', download the most recent version from here: http://code.google.com/p/mtasa-resources/ and add it to your server's resource folder "mods/deathmatch/resources/". Secondly, open mtaserver.conf in "mods/deathmatch/" and remove the resource line that tries to start 'weapons', no idea to run a broken resource with missing files.