Jump to content

Noki

Members
  • Posts

    851
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Noki

  1. Use a for loop. setTimer( function () for _, vehicle in pairs(getElementsByType("vehicle") do if (#getVehicleOccupants(vehicle) == 0) then destroyVehicle(vehicle) end end end, 1800000, 1 ) My indentation is awful, sorry.
  2. Keep the connection in one resource. Call it 'mysql'. Create an export within 'mysql' that returns the database connection you established using dbConnect. Just use that export in every resource you require MySQL usage in. Remember, it will only be server-sided.
  3. dbQuery(db, "SELECT `kills`,`playername` FROM `stats` ORDER BY `kills` DESC LIMIT 10") I would recommend using a callback there instead of a singular query. Then just send it to the client, who should have triggered a serverside event with the above query in it (also means you will be using 'client'). From there, just loop through the resulting table and create gridlist rows containing the data.
  4. Noki

    MTA SA SERVER

    That's completely subjective. Don't load so many mods. It needs of course some time to process that much data. As an alternative, you could load these mods asynchronously using engineSetAsynchronousLoading and not right after joining. What is the default state of asynchronous loading? If you want to lessen the initial download on players, you can download them in the background.
  5. As in make it invisible? I don't think you're able to do that.
  6. Noki

    [HELP] Teams

    function setTeam(plr, _, team) if team == "nil" then setPlayerTeam(plr, nil) return end setPlayerTeam(plr, getTeamFromName(team)) end
  7. function chase_move (ped, oldTx, oldTy, oldTz, oldPx, oldPy, oldPz) if not ped then return end if (isElement(ped)) then if (getElementData ( ped, "status" ) == "chasing" ) and (getElementData (ped, "slothbot") == true) then setTimer ( function(ped) setPedWeaponSlot (ped, weap) end, 850, 1, ped) -- this is the line of the error end end end setTimer has an argument for any arguments you want to pass to the function within the timer. Since ped does not not exist inside the scope of the timer, and so the function thinks ped is nil, even though it's in your code. That is why you utilise the 4th argument in setTimer. It allows you to pass anything into the function. In this case, we pass the variable ped into the timer so we're able to do something with it. If you don't pass the variable and try to access it, it will always return nil.
  8. Thanks devs. Good release. Looking forward to 1.6.
  9. Salting: - https://crackstation.net/hashing-security.htm - http://security.stackexchange.com/quest ... -salt-work If you think the in-built hash functions are terrible (which they kind of are), I would recommend using the bcrypt module.
  10. Do you want to encrypt so you may decrypt at a latter date or do you want them to not be decrypted (one way)? If you want to be able to encrypt and decrypt, use tea. If you want said data to not be decrypted, use the hash function, as John Smith said.
  11. Noki

    Need CODE

    Line 5 should be: addEventHandler("onClientResourceStart", resourceRoot, binds)
  12. Noki

    Questions.

    You just extract the files to /server/mods/deathmatch/resources. As it is here, download it an extract it like you would any other game mode (to /server/mods/deathmatch/resources). Any folder with a name surrounded by square brackets ([]) are called a carpet. Carpets contain additional resources in them. They are usually used to organise resources so it isn't a giant mess in your resources folder.
  13. Grouping multiple objects together. If you group them together, you're able to make changes to them both simultaneous and in synchronization. If I grouped two objects together, and moved the parent (the one that is made as a result of the other two objects) 10 units on the Z axis, both objects would move together on the Z axis by 10 units. They become grouped together and anything that happens to one of them happens to both of them.
  14. Noki

    Loops

    You can also use local i = 1 while i <= 10 do i = i + 1 end But the above "for i=1,10 do" method is better.
  15. Are you running your server in a virtual machine?
  16. A serial is your unique identifier that is tied to your computer. In-game, press ` or F8 to bring up the console. In there, type 'serial'. The output after that is your unique serial. When a serial is banned, it is added to a ban list. A lot of servers have their own custom banning methods, my own included. But MTA has made it easy and has given us one for those who don't want to make their own ban system. Check this to see a list of ban functions. Bans are stored in banlist.xml under /server/mods/deathmatch.
  17. And modules can't be implemented client-side to add this functionality. I too am curious as to what they are and their functionality.
  18. Good to see that someone made a video where they actually talk, instead of writing in Notepad and expecting the viewer to not die of boredom. I can see that you're actually passionate about the subject and go further in detail than most tutorials. Also, good insight at the start of the fourth video about Lua as a language itself.
  19. I'm not sure exactly what you want to do, but createLight is worth looking at.
  20. It doesn't look like Windows 10 at all. It looks more like WP7.
  21. Noki

    Area name

    I've seen you do this a few times. We do not code for you. We either help fix your existing code, or give you pointers in the right direction.
  22. Noki

    Network encryption

    Good call. What is the strength and type of encryption used?
×
×
  • Create New...