-
Posts
2,753 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Captain Cody
-
B.L.A.S.T. V5!!! ALL NEW!! ALL GOOD!! ALL SPAM!!
Captain Cody replied to Mr.Bill's topic in B.L.A.S.T.
A. I can indeed stock a tent Q. What's the answer to the universe? -
Oh never mind then.
-
That certainly works to.
-
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.
-
There are infinite dimensions.
-
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")
-
Yes it it has been removed.
- 64 replies
-
- awesomeness
- mtasa 1.5.3
-
(and 4 more)
Tagged with:
-
Looks quite good.
-
Can i save a script to my computer, from admin panel?
Captain Cody replied to Turbe$Z's topic in Resources
If you were to modify the admin panel yes, but with the default one no. -
Any possibility to make IZ3D compatible with MTA?
Captain Cody replied to GoroPL's question in Client
Alright nothing I can really help, wait for a reply from a MTA dev. -
local x = check.x local y = check.y local z = check.z -- And so on.
-
Check if mta is allowed through fire wall.
-
Try disconnecting from the internet, then try again; and see if there is the same error message.
-
Any possibility to make IZ3D compatible with MTA?
Captain Cody replied to GoroPL's question in Client
Can you post the crash message, or a screen shot of it (If any). -
Some time in 2017 is when it's scheduled, but will probably be delayed further.
- 64 replies
-
- awesomeness
- mtasa 1.5.3
-
(and 4 more)
Tagged with:
-
Make sure the server side script is defined before the client side script in the meta file.
-
Replace your server side script with the one I just posted and try it.
-
Make sure it is set as a client side script in the meta file, also next time please add the script in lua brackets.
-
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.
-
The issue with maps is due to said objects having a certain flag applied to them.
- 64 replies
-
- awesomeness
- mtasa 1.5.3
-
(and 4 more)
Tagged with:
-
What panel are you speaking of?
-
Can you explain more as to what you are trying to achieve?
-
[QUESTION] Replace only one specified car, not all models
Captain Cody replied to Dzsozi (h03)'s topic in Scripting
Not possible, you can for the most part replace the TXD using shaders though. -
Well there's only so much ways that you can get details from another server.
