-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
If you mean masked: guiEditSetMasked Else please explain more.
-
Well there is 3 left, but they're not a 'Scripting' tutorials, I think their right place is Other creations. Thanks btw.
-
local theMarker = createMarker ( 2467.8647460938, -1648.7094726563, 12.47255897522, "cylinder", 1, 255, 255, 0, 170 ) function mission1Marker(marker,matchingDimension) if (matchingDimension) then triggerClientEvent ( source, "showMission1", source) end end addEventHandler("onPlayerMarkerHit",theMarker,mission1Marker) addEvent("rejectTheMission", true) addEventHandler("rejectTheMission", root, function () triggerClientEvent ( source, "unshowMission1", source ) end ) addEvent("acceptTheMission", true) addEventHandler("acceptTheMission", root, function() triggerClientEvent ( source, "unshowMission1", source ) end ) The 'source' of onPlayerMarkerHit is the player, not the marker.
-
function onLogin (_,account) setElementData(source, "Level", getAccountData(account, "lvl") or "Level 0 !") setElementData(source, "EXP", getAccountData(account, "exp") or "0") end addEventHandler ("onPlayerLogin", root, onLogin) function onQuit() local account = getPlayerAccount(source) if not account then return end if not isGuestAccount(account) then setAccountData (account, "lvl", getElementData(source, "Level")) setAccountData (account, "exp", getElementData(source, "EXP")) end end addEventHandler ("onPlayerQuit", root, onQuit) And why are you checking the EXP for each level, just use + 1.
-
md5 ?
-
My bank script, it's bugged and I lost the uncompiled scripts. https://community.multitheftauto.com/index.php?p= ... ls&id=2657
-
SQLite it's similar to MySQL, but it doesn't require a SQL server like MySQL does. I will explain the new db functions. dbConnect dbExec dbQuery dbPoll dbFree dbConnect So you must use dbConnect, to open a connection with the database (the .db file) which you can later use with dbQuery to execute a query. dbConnect connects to a .db file, or create it if it doesn't exist. The path can be the resource, another resource or the global databases folder. Ex: --In the same resource local connection = dbConnect ( "sqlite" , "newDB.db" ) --Another resource local connection = dbConnect ( "sqlite" , ":resourceName/newDB.db" ) --Global databases folder local connection = dbConnect ( "sqlite" , ":/newDB.db" ) And later you will use the variable connection with dbQuery. You can destroy the connection with destroyElement. dbQuery You use dbQuery to execute a query and it returns a query handler which can be used with dbPoll to get the result, or dbFree if you don't want it at all. You can also use dbExec If you want to execute a query and you don't want a result. Ex: The example is a continue to the above example. local queryHandle = dbQuery ( connection , "SELECT * FROM someTable" ) --Another example local queryHandle = dbQuery ( connection , "CREATE TABLE IF NOT EXISTS someTable (column1 TEXT,column2 TEXT)" ) --Another example local queryHandle = dbQuery ( connection , "INSERT INTO someTable (column1,column2) VALUES (?,?)", "text" , "text2" ) The question mark can be used to insert a value as an argument, without having to quote it or anything, I use them personally. If you don't know what to type in the query, look in the old sqlite functions wiki page for examples. dbPoll When you use dbQuery it returns a query handle, in order to get the result you have to use dbPoll. Ex: --Without timeout setting. local queryResult = dbPoll ( queryHandle , -1 ) --With timeout setting. local queryResult = dbPoll ( queryHandle , 10 ) The second argument: dbFree just frees the result no more explaining needed. dbExec executes a string, without any values returned. Ex: dbFree ( dbQuery ( connection , "UPDATE someTable SET column1 = ?" , "row1" ) ) --OR JUST (AS A REPLACEMENT) dbExec ( connection , UPDATE someTable SET column1 = ?" , "row1" ) viewtopic.php?f=91&t=37892#p390384
-
Note: This is a tutorial about the old executeSQL* functions. For the recent and better db* functions, check the first reply here SQLite: There is two ways: Using executeSQLQuery and supplying the query string (The Query needs a certain string to define what to do That string can be found @ each SQLite function WIKI Page) or using the functions like (executeSQLCreateTable, executeSQLDelete). Let's start by creating a table: (2 ways) --executeSQLCreateTable(string tableName , string columns in table with the type) see below executeSQLCreateTable("tableName", "column1 TEXT,column2 NUMBER,column3 TEXT,column4 NUMBER") OR: --executeSQLQuery(string theQuery) see below executeSQLQuery("CREATE TABLE IF NOT EXISTS tableName (column1 TEXT,column2 NUMBER,column3 TEXT,column4 NUMBER") If you take a look at executeSQLCreateTable wiki page @ the top you will find:
-
Congratulations, MTA finally got what it deserves. Gratz to the team.
-
It actually works, if it's the same, it's the one I'm using. Anyway, don't post the script here again please.
-
This is my script. Can some mod or admin check Jesse's account IP? He says it been hacked.
-
This is what I mean, more than one color is bad. One color for the whole name is fine. Anyway this is not that important.
-
You can also just use a timer, each minute use setAccountData or setElementData and increase the player's spent time on the server.
-
It's not, it got fixed.
-
Because more than one color in the name will affect our eyes.
-
But not hex, as we will have some servers with 10 colors.
-
5 hours left. Good luck.
-
Just use the skin argument in spawnPlayer. Like onPlayerWasted set a timer to spawn the player, and specify the skin argument with getElementModel. Ex: addEventHandler ( "onPlayerWasted" , root , function ( ) fadeCamera ( source , false , 3 ) setTimer ( function () spawnPlayer ( source , 1178.9 , -1323.7143554688 , 15 , 270 , getElementModel ( source ) , 0 , 0 ) fadeCamera ( source , true , 2 ) end , 5000 , 1) end )
-
And you need to make a car respawner script.
-
Make a logs script? Use the file functions: fileClose fileCreate fileDelete fileExists fileFlush fileGetPos fileGetSize fileIsEOF fileOpen fileRead fileRename fileSetPos fileWrite EDIT: fileRename and all the db functions need to be added to [lua] tags.
-
You are already updating the sql table. Be more specific about your problem. Also, I would suggest you to use '?' instead of using the variables in the query string. Ex: if dbFree ( dbQuery ( server, "UPDATE vehicles SET characterID = ? WHERE vehicleID = ?" , faction, data.vehicleID )) then Take a look here for more information: executeSQLQuery.