Jump to content

Spajk

Members
  • Posts

    285
  • Joined

  • Last visited

Everything posted by Spajk

  1. MySQL is better then sqlite.
  2. Spajk

    Logs

    None of these use RAM.
  3. "selection" isn't defined.
  4. Spajk

    Cars

    How do you mean you want to control both of them? At the same time or to switch between them?
  5. Ugh, could you give me the original source-code, so I could change it so it would use account names instead of player names.
  6. addEventHandler("onPlayerLogin", root, function(_, acc) setElementData(source, "accountName", getAccountName(acc)) end ) addEventHandler("onPlayerLogout", root, function() removeElementData(source, "accountName") end ) Are you sure you have put this to the server-side script ?
  7. I don't have any idea how that script works, but here's the code that you can use to get player's account name client-side: addEventHandler("onPlayerLogin", root, function(_, acc) setElementData(source, "accountName", getAccountName(acc)) end ) addEventHandler("onPlayerLogout", root, function() removeElementData(source, "accountName") end ) Then on the client-side you can just use: getElementData(player, "accountName")
  8. Send the account name to the client when player logins and store it in a table, remove it once he quits/logout.
  9. It would be better to add a field named "map" to the players table. executeSQLQuery("CREATE TABLE IF NOT EXISTS 'players' (playerName TEXT, playerSerial TEXT, timeMS REAL, timeText TEXT, dataRecorded TEXT, extra TEXT, map TEXT)") executeSQLQuery("INSERT INTO 'players' (playerName, playerSerial, timeMS, timeText, dataRecorded, extra, map) VALUES(?,?,?,?,?,?,?)", playerName, playerSerial, timeMS, timeText, dataRecorded, extra, map) Having tables for each map would be a bit bad.
  10. Could you explain a bit more what you are trying to do?
  11. setElementData has nothing to do with SQL. XML is not more secure then SQL. Now, for the SQL questions. 1. executeSQLCreateTable is deprached. executeSQLQuery This function is used to execute any SQL query on MTA's internal database. To create a table, use: executeSQLQuery("CREATE TABLE IF NOT EXISTS tablename (column1 type1, column2 type2, column3 type3)") Search on google for SQL data types. 4. Moving data with SQL is a bit more complicated, you'd need to open your registry.db file from mods/deathmatch using SQLite browser: http://sourceforge.net/projects/sqlitebrowser/ Then, you'd need to export the table and then import it to the registry.db of the other server. 5. SQL syntax hasn't changed in some time, there's no type called "STRING" so, "TEXT" is the correct one. All the bigger MTA servers use SQL, most of them even have an MySQL server running on the same host because it's faster then MTA's SQLite.
  12. Spajk

    Ground

    There's no need for that. local distance = playerZ - groundZ
  13. Spajk

    Ground

    https://wiki.multitheftauto.com/wiki/GetGroundPosition If you are really high in the air, there's a chance this function won't work. What do you need it for, there might be a better way. EDIT: CrystalMV was faster
  14. local vehicle = createVehicle(506, 2100.2697, 1397.4947, 10.3, 0, 0, 0) setElementData(vehicle, "HLS", "groupname") addEventHandler("onVehicleStartEnter", root, function(thePlayer, seat, jacked, door) local vehicleOwner = getElementData(source, "HLS") local gangGroup = getElementData(thePlayer, "HLS") if (not vehicleOwner) then return end if (gangGroup ~= vehicleOwner) then outputChatBox("This car is locked and belongs to the following class: Admins", thePlayer, 245, 20, 20, false) cancelEvent() end end ) Replace the groupname on line 2 with the name of the group.
  15. Well, does it contain the group name or just true/false ?
  16. line 9: local gangGroup = getElementData( client, "HLS", skin.name ) What's skin.name supposed to be? Also, use thePlayer instead of "client" local gangGroup = getElementData( thePlayer, "HLS" )
  17. Spajk

    Oxygen Bar

    and what should "r" be? addEventHandler("onClientRender", root, function() if (isElementInWater(localPlayer)) then local oxygen = getPedOxygenLevel(localPlayer) dxDrawRectangle(900, 94, 266, 20, tocolor(0, 0, 0, 255), true) dxDrawRectangle(901, 95, 264*(oxygen/getPedStat (localPlayer, 225)), 18, tocolor(8, 154, 246, 255), true) end end) Try this one.
  18. https://wiki.multitheftauto.com/wiki/Cl ... _functions
  19. You arent declaring functions correctly and a lot of other stuff, I will fix it for you once I get to my PC.
  20. Yes, you can add your own events by doing addEvent and then trigger them using triggerEvent
  21. Spajk

    Skin of gift

    He means a model for a christmas gift box.
  22. The game is quite diffrent for the phones and the PC, they would need to do every update twice.
  23. There's no way a bind could have done that, probably some kind of a program.
×
×
  • Create New...