![](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
pa3ck
Members-
Posts
1,141 -
Joined
-
Last visited
-
Days Won
7
Everything posted by pa3ck
-
Okay, then get rid of the "unix_socket = ..." thing, because that's for Linux and most of the times you don't need to specify that at all anyway.
-
If you delete the one with -1, do you get the success then the error message? BTW when you are using a loop to find something and you actually found it, you should always break the loop, there would be no point continuing, makes sense?
-
What operating system is it running on? Are you sure you are using XAMPP? If so, that's for Windows, but the unix socket you are using is related to Linux and that is LAMP.
-
Kicsit próbáld meg őket elmozdítani egymástól valamelyik tengelyen. Nem kell általában sokat elég egy .05 vagy .1-et attól függ, hogy mekkora az object.
-
Okay, so you probably have list of players / groups in the table, but when you are updating it, you never specify what you want to update. You forgot the WHERE clause. Try this: exports.NGSQL:db_exec(" UPDATE `group_stuff` kills =? WHERE name = ?", Kills_[Killer], groupPlayer) I removed the name = ? part, because I'm pretty sure you don't need to update the name of the group, if you do (depends on what you actually want), just put it back in.
-
Yes, it gets called when falling from a bike, but onClientVehicleStartExit isn't. So basically if someone exits the bike and onClientVehicleStartExit never got executed, you know that they fell of the bike (or it got destroyed etc).
-
When a player "exits" the bike, the event onClientVehicleStartExit never gets called. I tried this and it worked: local startExit = false addEventHandler("onClientVehicleStartExit", root, function(p) if p == localPlayer then if getVehicleType(source) == "BMX" then startExit = true else startExit = false end end end) addEventHandler("onClientVehicleExit", root, function(p) if p == localPlayer then if getVehicleType(source) == "BMX" and not startExit then outputChatBox("you just fell off") end startExit = false end end)
-
Okay, what I would try: create a render function which gets all the markers and get their element data. Any marker with the element data for example "markerType" will have the dxDrawTextOnElement function on it. Or if you can, think about another way, but if the outputChatBox is right, the problem is the way you are using dxDrawTextOnElement.
-
if weaponShopType == 1 then weaponShopTypeText = "Fegyverbolt" -- <- this is the weaponshop text for shop type number 1, it would have weapons in it markerColorR, markerColorG, markerColorB = 150, 150, 150 blipIcon = 6 --weapon blipColorR, blipColorG, blipColorB = 150, 150, 150 outputChatBox("created type - weapon") elseif weaponShopType == 2 then weaponShopTypeText = "Barkácsbolt" -- <- this is the toolshop text for shop type number 2, it would have tools in it markerColorR, markerColorG, markerColorB = 255, 180, 0 blipIcon = 27 --wrench blipColorR, blipColorG, blipColorB = 255, 180, 0 outputChatBox("created type - tools") end See what the outputChatBox returns.
-
That's not how you loop through tables. for k, v = for key, value So k is the index or key and v is the value. In your case, v is the table itself, so if you run this on your table: for k, v in ipairs(weaponShops) do print("Marker: ", unpack(v.markerPos)) print("Preview: ", unpack(v.previewPos)) print("Exit: ", unpack(v.exitPos)) print("Weapons: ", unpack(v.weapons)) end You will get something like this back.
-
Somehow you need to know which marker the player hit. You can do it with 2 tables and saving the marker element in one table with the other table index and loop through it. I would suggest you to organise the tables in a easy to read way. Like: table = { [1]={ marker = { 0, 0, 0 }, blip = { .......}, type = 5 }, [2]={ marker = { 5, 5, 5 }, blip = { .......}, type = 1 } } Always aim to have a JSON like structure because it's easy to loop through and read this way (ie unpack ()).
-
Do you even read your code and debugscript? local character = dbQuery(handler, "SELECT * FROM characters WHERE accountname = ?", username "'") Tell me what's wrong with that line of code, read it carefully.
-
No, that's not how a SELECT statement looks and the rest of your code is terribly wrong as well. Like local password == accounts["password"]... What's that for? Shouldn't it be in an if statement? How do you define a variable? It's local variable = "value"... local account = exports.mysql:_Query("SELECT * FROM `users` WHERE `username` = ? LIMIT 1", username)
-
Because source is not the marker element server side. In the triggerServerEvent, trigger the value from: local current = getElementData(source, "markerID-->skinShop") -- in the onClientMarkerHit function the source is the marker
-
In what way are you storing the players' money?
-
Remove one of the question marks in VALUES (?,?,?) in the addNumber function.
-
Read this line: connection = dbConnect("mysql", "databse=mtarp; host=127.0.0.1; port=3306;", "root", "9852174563") There's a typo in "database=mtarp" and it shouldn't be database anyway, it should be: connection = dbConnect("mysql", "dbname=mtarp; host=127.0.0.1; port=3306;", "root", "9852174563")
-
He probably wants to have the top first, so I would use "DESC" rather than "ASC" and also a "LIMIT 20" or something like that so you only get the top 20.
-
When you have two tables and the data is normalized in some way, you have to join the two table, right? You will need a primary key in the users table (for example userId) and a foreign key in the characters table which is same as the userId in the users table. If you have no idea what I'm taking about, go and check out a youtube tutorial about foreign key and primary key joins. Example: SELECT usr.SomethingFromUserTable, chars.SomethingFromCharacterTable FROM users as usr INNER JOIN on characters as chars ON usr.userId = chars.userId WHERE usr.userName = guiGetText(txtUsername) // obviously you can't have client side code (guiGetText) on server side, you will need to trigger this value from client
-
Yea, like: local skinShops = { -- markerX, markerY, markerZ, markerDimension, markerInterior, previewX, previewY, previewZ, previewRot, previewDimension, previewInterior, previewCamX, previewCamY, previewCamZ, previewCamLX, previewCamLY, previewCamLZ, exitPosX, exitPosY, exitposZ, markerID --marker #1 {1950.908203125, -2049.2995605469, 12.4, 0, 0, --shopMarkerPos, dimension, interior 1976.33984375, -2048.2937011719, 12.884400367737, 80, 0, 0, --previewPos, rot, dimension, interior 1963.5827636719, -2053.611328125, 15.560099601746, 1964.4354248047, -2053.1540527344, 15.307735443115, --previewCamPos 1974.8217773438, -2056.7233886719, 14.861300468445, 60, 0, 0, --exitPos, rot, dimension, interior 1, skins = {2, 4, 6, 8} },
-
How do you save the position in the table? Show us your table structure
-
Try to outputChatBox the 3 values you are passing to string.format, because you have no syntax error, the problem must be the values.
-
You can have tables inside tables like: local tbl = { {"Shop 1", skins = {1, 2}}, {"Shop 2", skins = {3, 4, 6}}, } outputChatBox(tbl[1].skins[1])
-
No, in the loop you want to have: setElementData(skinShopMarker, "shopID", currentShop) In the selectSkin function: local current = getElementData(source, "shopID") Edit: Make sure "local current ..." is the very first line of the selectSkin function