Overkillz

Members
  • Content Count

    421
  • Joined

  • Last visited

Community Reputation

19 Decent

1 Follower

About Overkillz

  • Rank
    Thug

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Practically he gave you the whole code. Merge it with your "supossed DB Code" and it should be done.
  2. @IIYAMA I mean protection from the loaded string. Which one should be the way/ways that people can try to steal something (I don't care about dff, txd ...etc | Only scripts) @Ayush Rathore Im already aware about Bonsai's MGM but Im not interested on using his code. I want to learn how does the things work and @IIYAMA is one of the guys who explains such things very detailed. Regards.
  3. Well, I have done some test and looks that it is getting a better look. Btw, which one should be the way to test if my code is vulnerable to be read by those codes ? Tried with fileOpen, fileread ...etc but not success. (Obyously, the enviroment is removed during this test.)
  4. but what about if I want to block some variables/arrays ?
  5. Overkillz

    Synch question

    Check out this. Might it helps you setElementSyncer
  6. Overkillz

    anti afk

    Im not partidary of doing the code for other people who don't even try to do it, but you are a lucky day. BTW: Not tested I bassed anti-afk keys assuming that the player is in vehicle due to I have never worked about the movement of player out the vehicle. local afkTime = 30 --In Minutes local antiAFKkeys = {"accelerate", "vehicle_left", "vehicle_right", "brake_reverse"} --Check out more keys at https://wiki.multitheftauto.com/wiki/Key_names kickerTimer = setTimer(function() triggerServerEvent("onkickPlayerFromServer",localPlayer) end,afkTime*1000*60,1) function afkReset() resetTimer(kickerTimer) end do for i,key in ipairs(antiAFKkeys) do bindKey ( key, "down", afkReset ) end end --##Server Side function kickPlayerFromServer() kickPlayer (source) outputChatBox(getPlayerName(source).." #ffffffhas been kicked by ANTI-AFK BOT",root,255,255,255,true) end addEvent("onkickPlayerFromServer",true) addEventHandler("onkickPlayerFromServer",getRootElement(),kickPlayerFromServer) Regards.
  7. @IIYAMA Well, as far as I read pcall executes the string and if it detecs an error it just ignores it. So, the code should be like this local resourceRoot = createElement("resourceRootFaked") local enviroment = {} local blockedFunctions = { ["enviroment"] = true, ["newEnviroment"] = true, } function newEnviroment() enviroment = {} for name, valor in pairs(_G) do if not blockedFunctions[name] then enviroment[name] = valor end end end function runScript(scriptData, executeIt) newEnviroment() local loaded = loadstring(script) local ex = pcall(loaded) setfenv(ex, enviroment) if ex then if executeIt then triggerEvent("onClientResourceStart", resourceRoot, getResourceFromName("scriptLoaderResource")) end end end
  8. Well, I have just came at home to try it and Im still having the same issue with for example, playSound. The sound is executed more than one time, even if the scripts data are merged and I cant figure out why does it happen. local cachePath = "tempCache" local scriptList = {"client.lua","water.lua","shaders.lua"} function scriptRead() local scriptData = "" for i,mapScripts in ipairs(scriptList) do local file = fileOpen(cachePath.."/"..mapScripts) if not file then error("Not file found") return end while not fileIsEOF(file) do scriptData = scriptData .. "\n do \n" .. fileRead(file, fileGetSize(file)) .. "\n end \n" end fileClose(file) if i == #scriptList then exports.scriptLoaderResource:runScript(scriptData, true) end end end function runScript(scriptData, executeIt) local loaded = loadstring(script) local ex = pcall(loaded) if ex then if executeIt then loaded() triggerEvent("onClientResourceStart", resourceRoot, getResourceFromName("scriptLoaderResource")) end end end Probably the issue is on the triggerEvent, but I don't use it, the scripts are not executed. Weird no ? Regards.
  9. @IIYAMA How can I merge all of them with do ... end The only way I have learned currently is to add the new data to a string local scriptDataString for i,loopData in ipairs(whatever) do scriptDataString = scriptDataString.."\n"..loopData end
  10. @DizzasTeR Alright, got it. Thats why I was asking you several questions about it. Thanks ^^, & regards.
  11. Hello dear community. Some time ago I started to work with loadstring and load functions. Nowadays I've realized that I got some issue with load so I decided to chose loadstring to reach my purpose. I have read some @IIYAMA topics and other people which had a similar problem some months/years ago, but sadly. I couldn't get the solution. I have currently 2 resource. One is to create the maps, gets the map files, scripts, store them in the cache ...etc, lets call it (MapCreator) and the other one is to execute the map scripts, lets call it (scriptRunner). Well, I have done a little version of them to make it more understable. I have found some problems with the mapCreator. to be clear, the whileIsEOF part. If I comment this part, the script runs correctly, but If I leave them uncommented, it doesn't read the script file. --##MapCreator local cachePath = "tempCache" local scriptList = {"client.lua","water.lua","shaders.lua"} function scriptRead() for i,mapScripts in ipairs(scriptList) do local scriptData local file = fileOpen(cachePath.."/"..mapScripts) if not file then error("Not file found") return end while not fileIsEOF(file) do scriptData = fileRead(file, fileGetSize(file)) end fileClose(file) if i == #scriptList then exports.scriptLoaderResource:runScript(scriptData, true) return end exports.scriptLoaderResource:runScript(scriptData, false) end end Well, on the other hand, at (scriptRunner). I have read that enviroments bring you more security to prevent that other people stole or execute your scripts. Im not sure if Im following the right way to run map scripts (Obyously no. Because sometimes in a X map. the song is executed like 3 times at the sime time) and Im not sure if the enviroments must be created like in my code. local enviroment = {} local blockedFunctions = { ["enviroment"] = true, ["newEnviroment"] = true, } function newEnviroment() enviroment = {} for name, valor in pairs(_G) do if not blockedFunctions[name] then enviroment[name] = valor end end end function runScript(scriptData, executeIt) newEnviroment() local loaded = loadstring(script) local ex = pcall(loaded) if ex then if executeIt then loaded() triggerEvent("onClientResourceStart", resourceRoot, getResourceFromName("scriptLoaderResource")) outputDebugString("Scripts Executed") end else outputDebugString("Not Executed") end end I hope you can help me to fix the issue that if the map has a script that play a song, it doesn't get execute more than 3 times (And not, on the script is only executed one time. It is a problem of my code.).And, can you tell me if the enviroments must be created like this ? I have to clean them or something when I change the map. And, how can I stop the runned scripts? I know that just setting the loaded variable as nil it should work but. How to deal properly with it. PS: the scripts that are inside the array scriptList are correctly coded. Thanks for reading. Best regards.
  12. Thats what Im doing from the beginning, the tick starts when the trigger has arrived at clientside, but anyways some miliseconds are missing. I know that the difference is practically inapreciable, but, I want a perfect time.
  13. @DizzasTeR Well, but here are few questions respecting that. If I create a vehicle at serverside and I want to freeze it at client side, I must use a trigger. During that short time, the car could be moved by the player. Possible Solutions: Use toggleAllControls or play with more thatn a single trigger If I create the vehicle clientside. The vehicle won't be visible for the rest of players. Possible solutions: Deal with more than a single trigger or use setElementSyncer(But this has some limitations as far as I could read at the wiki) The best way I can use to avoid several triggers is toggleAllControls right ? Regards.
  14. @DizzasTeR Yes, I've already tried this, but If I freeze the vehicle serverside (When the player spawns ...etc) and later I unfreze the vehicle at client side, It causes the following issue. I already know that I can use a setTimer to do a triggerServerEvent and unfreze the vehicle server side after it has been unfreze at clientside, but my question is, there is a better way to reach it ? (I know it sounds weird.) Will I get a problem If i unfreze a vehicle that is not frozen ? (Not at home to test it)