Overkillz

Members
  • Content count

    318
  • Joined

  • Last visited

Community Reputation

4 Neutral

About Overkillz

  • Rank
    Prankster
  1. Asking for a vehicle Light function

    Im already aware about that. But first, I want to create a simple light with X size and X colour. I won't attach it to my vehicle. That is a simple thing to do and I will leave it to the end.
  2. Asking for a vehicle Light function

    Well, You gave me a great idea for other thing in a near future, however, this function didn't help me at all. Might I'm executing worngly the following function I tried to create a simple light on my vehicle position with a red colour, however, It didn't work. I tried to change the light type from 1-3 function createTheLight() local theVeh = getPedOccupiedVehicle(localPlayer) if theVeh then local x,y,z = getElementPosition( theVeh ) createLight(2,x,y,z,25,255,0,0,0,0,90,true) outputChatBox("Created Light") end end addCommandHandler("testlight",createTheLight)
  3. Asking for a vehicle Light function

    I see, it work pretty good but, isnt there any other function that only modify tail lights ?
  4. Asking for a vehicle Light function

    Hello dear community, well, Im so dump right now and I have forgotten a new function which was added to MTA some few months ago. It was the possibility to keep the vehicle tail lights ON even if the time in game was too early. I have been several minutes looking for this function at the wiki, sadly, I couldn't find it. Here some screen shots (Open the spoiler) if you don't understand me. As you can see, on the first picture the car is stopped, but on the second one the car is stopping.Thanks for reading
  5. load function from file

    So, there is not any way that I can run those scripts ? Might converting to some format or something ?
  6. teaDecode return

    Yes, I was already aware about doing a trigger but I wanted to avoid that. Luckily I could do it checking if the files was successfully teaDecoded and checking if the variable is a table. Looks like it works pretty good and I don't need to trigger it.
  7. load function from file

    Thanks, I could fix it with the idea that u gave me. Otherwise, is there some problem with load and loadstring to not to laod copile scripts ? I have uploaded a map on my server which has copiled scripts and when I use load or loadstring functions it doesn't load the scripts.
  8. teaDecode return

    Hello guys, well, my question is simple. Im saving a file on the client folder and it is teaEncoded. Well, this fille can be modified by the user writing on it ...etc However, I want to prevent this while it is read. My idea is to get the bool value using teaDecode. However, Im always getting that the file is Ok even if it is modified by the user (In this case me) Im not sure if you understand me. Here is my code function loadMapFromCache(wha) if wha then local pathMap = tostring("asd/dsa/"..wha..".wah") if fileExists(pathMap) then file = fileOpen(pathMap) if file then local fileR = fileRead(file, fileGetSize(file)) fileR = teaDecode( fileR, temporalTeaCode ) fileClose(file) if fileR then outputChatBox("Is Ok") else outputChatBox("Is wrong") end end end end end
  9. load function from file

    Well, I couldn't be online to test the fix that you gave me. I implement it to the code and now looks like it works pretty fine. However, I needed to change the load function to loadstring and u suggested me before. Sadly, It doesn't execute the function. Here you can see the result of it (I added iprint to the loadScript to let you see water.lua | The water colour should be blue) function loadScript(scriptData) iprint(scriptData) hold("Called the loadScript function") local loaded = loadstring(tostring(scriptData)) local ex = pcall(loaded) hold("Called the load function.") if ex then outputChatBox("loaded the code") end end Thanks for helping me. Best regards.
  10. load function from file

    First of all, thanks for bringing me a code which will help me alot in a near future. Well, respecting the code, I tried to test your coroutine function (I have never heard about this function before). Sadly. There is something wrong there. Here you have an screenshot about the problem Thanks for reading. Best regards.
  11. load function from file

    Im already aware about that funciton. But what about if I want to the another one ?
  12. load function from file

    I think I can't use it. The resource must be running and I haven't the resource running which contain that file. What does it mean? The file that I mentioned before isn't even on meta's resource Regards.
  13. client script are hidden

    Instead of using fileDelete or adding cache="false" to meta.xml I recommend you to use Lua Compiler: https://luac.mtasa.com/ In my opinion its the best way to keep ur files secure. Yes, they can download the files, but they can't use them. I think this is the goal of it. Regards.
  14. load function from file

    Hello dear community, Im here with a problem which is annoying me a lot. Well, Im using fileOpen, fileRead ...etc to save a file in cache folder. Well, I decided to save script files in cache and try to load them with a custom script loader, however, I couldn't do it. Im not sure what am I doing wrong. I started to do it with a simple script, however, I don't know what is wrong with the code. When I run it I get the game freeze and I need to task manager and force to close MTA Here is the code. Thanks for reading local filePath = ":theScript/temporalCache/mapTest/water.lua" function scriptReadaa() local file = fileOpen(filePath) if not file then error("Error opening File.") return end local data data = fileRead(file, fileGetSize(file)) iprint(data) fileClose(file) loadScript(data) end addCommandHandler("doit",scriptReadaa) function loadScript(scriptData) local simpleContador = 0 local Xfunction = load(function() simpleContador = simpleContador + 1 return scriptData end) if Xfunction then pCallPrev = Xfunction pcall(pCallPrev) else outputDebugString("Couldn't load the script") return end triggerEvent("onClientResourceStart", resourceRoot, getResourceFromName("SHIscriptloader")) end --##water.lua containts the following function function startclient() setWaterColor(0, 0, 255) end addEventHandler("onClientResourceStart", resourceRoot, startclient)
  15. Problem cleaning a table

    Sorry, my mistake. I was triggering a table from a client which wasn't empty. Thanks for answering. Regards.