Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/02/22 in all areas

  1. change with result if result and #result > 0 then return end
    2 points
  2. I updated Burak his example. But I have not refactored the variable names. function AccDatacallback(AccData, player, account, AccName) local result = dbPoll( AccData, 0 ) if AccData and #AccData > 0 then return end local ID = getFreeID() local SetData = dbExec(db,"INSERT INTO stats (ID,Account) VALUES (?, ?)", ID, AccName) end function getpaccount (_,account) local AccName = getAccountName(account) setPlayerName(source,tostring(AccName)) dbQuery(AccDatacallback, {source, account, AccName}, db, "SELECT * FROM stats WHERE Account=? LIMIT 1", AccName) end addEventHandler("onPlayerLogin",root, getpaccount) The function was called instead of provided as function. local AccData = dbQuery(AccDatacallback(), db,"SELECT * FROM stats WHERE Account=? LIMIT 1", AccName) This is now moved inside of the call back function. Since the data is not immediately available. if(AccData) then if(#AccData > 0) then return end end local ID = getFreeID() local SetData = dbExec(db,"INSERT INTO stats (ID,Account) VALUES (?, ?)",ID, AccName)
    2 points
  3. I've created this lightweight script that allows you to search all of GTA:SA's ide files (+SAMP) in-game using a simple command. These IDE files contain information about all models in the game (ID, dff, txd, etc). https://gta.fandom.com/wiki/IDE For example, you can use this script to find which DFF models use a certain TXD file. For people trying to add environment mods from SA-MP into an MTA server this can save you some time finding the model IDs of your DFF & TXD files ? GitHub repository: https://github.com/Fernando-A-Rocha/mta-ide-search Community: https://community.multitheftauto.com/index.php?p=resources&s=details&id=18651 /searchide /listide
    1 point
  4. I found out you can do something like this : addEventHandler("onClientPlayerDamage", root, function(attacker, damage) local health = getElementHealth(localPlayer) if (health - damage) < 1 then cancelEvent() setElementHealth(localPlayer, 1) -- your stuff (setElementFrozen() etc...) end end ) tested in-game. When the player recieves damage, if damage set health below 1, you cancel the event and you set 1 health point to the player. After this you can freeze him and set an animation. To really kill him, just need to use setElementHealth(localPlayer, 0).
    1 point
  5. I get it! thank you
    1 point
  6. Account data is a database interface and manager for ONLY account-bounded-data. dbConnect + all other db functions, allows you to create your own database interface and manager. This gives you a lot of freedom, but it also means that you have to write a lot yourself.
    1 point
  7. Thank you Nando I appreciate your kind words! As are you too, your resources will no doubt save me a lot of work. ?
    1 point
  8. good map, there were some spots with super nice light decorations that i really loved haha.. good job aye
    1 point
×
×
  • Create New...