myonlake
Members-
Posts
2,312 -
Joined
-
Days Won
40
Everything posted by myonlake
-
The rule is fine, but the fact is, no one can protect their scripts. MTA has clearly not looked at this common issue very well. Most of the scripts that have been stolen are stolen with attacks and hacking through illegal measures. It's not something anyone can just "protect" as you say. Even if they all were compiled, they'd still be able to get a copy of the files from the source with hacking. And yes, people do hack through layers of firewall in order to get codes. Your compiling measures and encryption is only useful for client-side files. Valhalla Gaming code was stolen, or actually leaked, by a former MTA developer. So why should we trust MTA on all these things. Nobody wanted the code to be stolen, but it still was even though the owners tried to go against it. It might be late now, yes, but you could just think about the whole idea instead of just telling us to keep them safe. Even your networking module can be found from some developer's computer for sure. Had to come straight with this because I'm annoyed.
-
I doubt that's a big problem unless there are client-side files in the resource - also, there is no major memory leakage in Multi Theft Auto (or any at all), which means it wouldn't blow up anybody's computer. Thing is, restarting a resource every now and then will lag the server regardless of its size.
-
Sorry, we do not help with leaked resources.
-
It's never going to work like you think it will. I've tried the same many times and by spamming my keyboard it always adds another character which I don't want. I think you should just allow all characters and then strip them off later.
-
You can set and manage money client-side, but it will never be synchonized with the server or other players in that case. I suggest using triggerServerEvent and set the money server-side in order to to make sure the money will always be synchronized.
-
Please search the Wiki before posting. It's not hard to type in the search box. https://wiki.multitheftauto.com/wiki/Ge ... enPoints3D
-
Bumping over a year old topic for a small few lines of code is unnecessary. In fact, you can find that code in the Wiki and I know there are 100 other topics about how to import a custom texture on a weapon.
-
g_Money is a variable somewhere. You have to make sure you keep g_Money updated, or just replace g_Money with getPlayerMoney(). You should also take under consideration that client-side money actions only affect the client and not the server - therefore it doesn't synchronize and they can abuse the code quite easily.
-
getScreenFromWorldPosition returns two values; X and Y coordinate. You're currently only checking for one value. Also, you don't have the proper values set in dxDrawText. It goes like this: dxDrawText(string, float, float, float, float, color...). In order to do that ped thing, make a bind on X key and whenever they press the key the script will check the distance between the elements with getDistanceBetweenPoints3D.
-
Peds cannot be properly synchronized as even though they are recognized as part of the modification, they're not researched well enough. All pedestrian movements and synchronization is done client-side for the best results usually. Make sure all functions are used client-side. Server-side communication and synchronization should be limited and should only happen once in a few seconds (this prevents the weird lag a little).
-
You had an unnecessary end, wrong arguments, wrong elements and generally you forgot to re-check the code. function languageChat(player, cmd, ...) if (not ...) then return end local msg = table.concat({...}, " ") if (#msg <= 0) then return end for _,languagePlayer in ipairs(getElementsByType("player")) do if (getPlayerLanguage(languagePlayer) == getPlayerLanguage(player)) then outputChatBox("#FF0000[" .. getPlayerLanguage(player) .. "] " .. getPlayerName(player) .. ": #FFFFFF" .. msg, languagePlayer, 255, 255, 255, true) end end end addCommandHandler("Language", languageChat) addEventHandler("onPlayerJoin", root, function() exports.scoreboard:scoreboardAddColumn("Language") bindKey(source, "L", "down", "chatbox", "Language") end ) addEventHandler("onResourceStart", resourceRoot, function() for _,player in ipairs(getElementsByType("player")) do bindKey(player, "L", "down", "chatbox", "Language") end end ) function getPlayerLanguage(player) if (getElementData(player, "Language")) then return getElementData(player, "Language") else return false end end function isPlayerOnGroupSpanish(player) if (getPlayerLanguage(player) == "Español") then return true else return false end end function isPlayerOnGroupEnglish(player) if (getPlayerLanguage(player) == "English") then return true else return false end end
-
Because the code makes no sense. Client-side function doSound(vehicle) -- Check if argument is set and whether it is a vehicle element if (not vehicle) or (not isElement(vehicle)) or (getElementType(vehicle) ~= "vehicle") then outputChatBox("Invalid vehicle argument or element.", 245, 20, 20, false) return end local x, y, z = getElementPosition(vehicle) -- Get the position of the vehicle local sound = playSound3D("path.mp3", x, y, z, true) -- Play the sound looped at the position setSoundMinDistance(sound, 7) -- Set the sound's minimum distance to 7 units attachElements(sound, vehicle) -- Attach the sound to the vehicle end addEvent("triggerClientDoSound", true) addEventHandler("triggerClientDoSound", root, doSound) function endSound(vehicle) -- Check if argument is set and whether it is a vehicle element if (not vehicle) or (not isElement(vehicle)) or (getElementType(vehicle) ~= "vehicle") then outputChatBox("Invalid vehicle argument or element.", 245, 20, 20, false) return end for _,element in ipairs(getAttachedElements(vehicle)) do -- Get all attached elements if (getElementType(element) == "sound") then -- Check if it's a sound destroyElement(element) -- Destroy the sound end end end addEvent("triggerClientEndSound", true) addEventHandler("triggerClientEndSound", root, endSound) addEventHandler("onClientResourceStart", resourceRoot, function() for _,vehicle in ipairs(getElementsByType("vehicle")) do -- Loop through all vehicles doSound(vehicle) -- Trigger the sound end end ) If you ever wanted to trigger it server-side then just trigger the custom event with 'root' as the source. Make sure you include the vehicle argument. So, the sound start function is doSound and stopping it is endSound.
-
Regardless if someone got something leaked fixed, we still don't support it. If you ever see something like that happening, report the post to forum moderators.
-
We don't help with leaked resources. Bye.
-
Switch the 'not ...' to 'not query'.
-
That is an alternative solution for if-statement. It works as well.
-
https://code.google.com/p/mtasa-blue/wi ... uilds?tm=2
-
getAccounts() returns a table with accounts, you are trying to getAccount() an account. addEvent("checkIfNameTaken", true) addEventHandler("checkIfNameTaken", root, function(thisAccountName) for _,account in ipairs(getAccounts()) do if (tostring(getAccountData(account, "name")) == thisAccountName) then triggerClientEvent("showErrorOutputNameTaken", root) break end end end )
-
Use 'onClientResourceStart' instead of 'onResourceStart'. And I also suggest changing 'root' to 'resourceRoot' or otherwise the song will keep starting every time you start a resource.
-
They use fileCreate to create the code. Believe it already They might or might not use fetchRemote, really depends on the way how they revision their code. There is no way you can create a file any other way except downloadFile.
-
There isn't much to say because it's practically the same thing as copying and pasting. https://wiki.multitheftauto.com/wiki/FileCreate