Jump to content

Captain Cody

Members
  • Posts

    2,753
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. A. I can indeed stock a tent Q. What's the answer to the universe?
  2. Give me a bit and I'll have an example ready. Here's just a quick example set up I threw together, with enough work it could be turned into a functional script. executeSQLQuery("CREATE TABLE IF NOT EXISTS `phoneNumbers` (`number` NUMERIC,`name` TEXT)") executeSQLQuery("CREATE TABLE IF NOT EXISTS `Messages` (`number` NUMERIC,`Snumber` NUMERIC,`text` TEXT)") -- Retreive source account name / check if said number exists -- Usage // local NumbersOwner = checkIfItExits(phoneNumber) function checkIfItExits(number) return executeSQLQuery("SELECT `name` FROM `phoneNumbers` WHERE `number`=?", number ) end -- Add a phone number -- Usage // addNumber(theNumber,AccountNameOfOwner) function addNumber(number,accountName) executeSQLQuery("INSERT INTO `phoneNumbers`(`number`,`name`) VALUES(?,?,?)", number, accountName ) end -- Send a message -- Usage // dropMessage(tonumber,fromnumber,text) function dropMessage(number,sourceNumber,text) if checkIfItExits(number) then executeSQLQuery("INSERT INTO `Messages`(`number`,`Snumber`,`text`) VALUES(?,?,?)", number, sourceNumber, text ) end end -- Retreive a persons messages -- Usage // getMessages(personsNumber) // Returns a table table[1] = text table[2] = fromNumber table[3] = senders name function getMessages(number) local table = {} local messages = executeSQLQuery("SELECT `*` FROM `Messages` WHERE `number`=?", number ) for i,v in pairs(messages) do local text = v.text local sourceNumber = v.Snumber local SourceName = checkIfItExits(sourceNumber) table.insert(table,{text,sourceNumber,SourceName}) end return table end -- Update a message -- Usage // updateMessage(originalMessage,newMessage) // Returns true or false 'I think' function updateMessage(originalMessage,newMessage) return executeSQLQuery("UPDATE `Messages` SET `text`=? WHERE `name`=?", newMessage, originalMessage) end If you have any questions ask em, and I'll try to answer them.
  3. You could store it in an SQL database. https://wiki.multitheftauto.com/wiki/ExecuteSQLQuery Also you could use tables to keep track of who is online - number = {} number[player] = getAccountData(getPlayerAccount(player),"phoneNumber")
  4. If you were to modify the admin panel yes, but with the default one no.
  5. Alright nothing I can really help, wait for a reply from a MTA dev.
  6. local x = check.x local y = check.y local z = check.z -- And so on.
  7. Try disconnecting from the internet, then try again; and see if there is the same error message.
  8. Can you post the crash message, or a screen shot of it (If any).
  9. Some time in 2017 is when it's scheduled, but will probably be delayed further.
  10. Make sure the server side script is defined before the client side script in the meta file.
  11. Replace your server side script with the one I just posted and try it.
  12. Make sure it is set as a client side script in the meta file, also next time please add the script in lua brackets.
  13. Server - local mysql = exports.mysql addEvent("logIn", true) function logThePlayer(thePlayer,username,password) if thePlayer and username and password then if getElementType(thePlayer) == "player" then local account = mysql:db_Query("SELECT FROM users WHERE username'" .. username .."'") for i, sor in ipairs(account) do if sor["password"] == password then mysql:db_Exec("UPDATE users SET serial='" .. getPlayerSerial(thePlayer) .. "' WHERE username='" .. username .. "'") mysql:db_Exec("UPDATE users SET ip='" .. getPlayerIP(thePlayer) .. "' WHERE username='" .. username .. "'") local character = mysql:db_Query("SELECT * FROM characters WHERE accountname ='" .. username .. "'") if character then outputDebugString("Sikeressen talaltam charactert") for i, sor in ipairs(character) do setElementData(thePlayer, "acc:username", username) setPlayerMoney(thePlayer, sor["money"]) spawnPlayer(thePlayer,sor["posX"], sor["posY"],sor["posZ"], sor["pRot"], sor["pSkin"], sor["pInt"], sor["pDim"])) setPlayerName(thePlayer, sor["charactername"]) setCameraTarget(thePlayer, thePlayer) triggerClientEvent(thePlayer, "showHide", getRootElement()) outputChatBox("elvileg jo :D") end end else -- triggerClientEvent(thePlayer, "charactervalaszto", getRootElement()) triggerClientEvent(thePlayer, "showHide", getRootElement()) end end end end end end addEventHandler("logIn", getRootElement(), logThePlayer) Typo at line 11, had is instead of if.
  14. The issue with maps is due to said objects having a certain flag applied to them.
  15. What panel are you speaking of?
  16. Can you explain more as to what you are trying to achieve?
  17. Not possible, you can for the most part replace the TXD using shaders though.
  18. Well there's only so much ways that you can get details from another server.
×
×
  • Create New...