-
Posts
6,058 -
Joined
-
Last visited
-
Days Won
208
Everything posted by IIYAMA
-
local selection = dbQuery(db, "SELECT * FROM accounts WHERE username=? AND password=? LIMIT 1", username, password) P.s. you shouldn't never save un-hashed passwords in the database. Yet, one step at the time.
-
@Hackmanus See your inbox.
-
@gotinha General MTA > Other languages > Portuguese / Português > Programação em Lua (topic moved)
-
He probably meant this topic:
-
And don't forget this as well: (meta.xml) <download_priority_group>100</download_priority_group> else the timer will probably start too late.
-
It is just an extra block, which runs 1 time. Similar to: if true then end And no it is not required, but it makes it very clear that some action are happening there. You more often see those be used to enclose reused variables, without overwrite the original. local base = 1 if 1 == base then do local base = 2 print(base) -- 2 end do local base = 3 print(base) -- 3 end print(base) -- 1 end Or delete unused variables: local a do local b = 100 a = b * b * b end
- 21 replies
-
- 2
-
- onclienthudrender
- onclientprerender
-
(and 1 more)
Tagged with:
-
@Kenix @majqq I think the issue is now solved. Had to make some annoying adjustments, before it finally did work in all the different context/scenario's. Now it doesn't matter when and where an item gets remove at any index. When it is remove, it gets temporary replaced by a boolean and removed while iterating/rendering. The render order is correct as well. I know it is a bit of a dirty hack, but it does not things up as it is in some of the known scenario's. Let me know if there are no new issues occurring. New version: (need some more testing, just in case)
- 21 replies
-
- 1
-
- onclienthudrender
- onclientprerender
-
(and 1 more)
Tagged with:
-
I received a report about your two posts requesting help for a leaked gamemode. (other one) After quickly checking the internet it seems that this accusation makes sense. So I will lock this one for now. If your request for help for a leaked gamemode is not the case, then please send me in a personal message + proof that you are indeed a valid owner of this gamemode. Not public: https://github.com/OwlGamingCommunity
-
Is your issue solved @Tokio?
-
Yes. I have a definitive solution in mind, but currently not the time to solve it.
- 21 replies
-
- 1
-
- onclienthudrender
- onclientprerender
-
(and 1 more)
Tagged with:
-
I will send it you, when I am back from my holiday. Please send me a reminder during the coming weekend. Elementdata is indeed something with more risks. Clients can edit element data from each element, no restrictions. Potential risks: cheat engine stuff, custom cached scripts loaded with loadstring, staff with executed command rights and downloaded resources. I don't know what exactly you are going to build, but if the values shouldn't be edited on clientside, then don't edit them clientside. The server is the teacher and all the students have to listen and shut up, until they have a question or suggestion. ?
-
@Skraund It shouldn't be a problem. The output is nothing but a string. I guess the only reason why you need the db connection is to determine within which language it should be escaped. MySQL and SQL are not 100% the same after all. But not 100% sure if that is the reason behind it.
-
For the cause of the issue, see post of @JeViCo Fallback in case of failure: local TwCen14s = dxCreateFont('TwCen.ttf', 10) or "default" @Tokio Also delete the file out of your mta cache folder. You may have it, but if you changed the destination of the file + in the meta but not in the script. You do have the font from the previous download, but everybody else does not. Files do not delete themselves after all. So check that as well, as @HassoN said.
-
Nah, if you do not spawn yourself in to the (new) marker then there shouldn't be a reason for this kind of overflow behaviours. Are you 100% sure these 5 lines are responsible or are there more? Anyway, there is some strange error in the console that makes no sense: Expected player at argument 1, got marker. It is almost as if your new created marker triggers the event by colliding with the other marker. Which is kinda ... How about you move the new created marker at a very different location?
-
local firstMarker = createMarker(2, 0, 2.22, "cylinder", 1.0, 255, 100, 100, 100) addEventHandler("onMarkerHit", firstMarker, toSpawnIt) Hmm, aren't you teleporting yourself into your just created marker? If yes. Which teleports again in 2 markers, which then teleports you in 3 markers and then it teleports you in 4 markers, (not even a frame as been past by), markers: 5, 6, 100, 1000, 10000000 ... ??? @GrainHHH
-
JS object format types, which is more or less the same as JSON. Just it is not a string but an entity. Which is a way for myself to separate array structured tables from tables with mixed keys. Might be good or bad practice, I myself to be honest do not know. @majqq If you need confirmation, then the best way is to test it yourself. local newTable_array = {} local newTable_object = {} local loops = 1000 for i = 1, 1000 do newTable_array[i] = true newTable_object[i .. ""] = true end do local timeNow = getTickCount () for _ = 1, loops do for i=1, #newTable_array do local value = newTable_array[i] end end outputChatBox(getTickCount () - timeNow) end do local timeNow = getTickCount () for _ = 1, loops do for key, value in pairs(newTable_array) do end end outputChatBox(getTickCount () - timeNow) end do local timeNow = getTickCount () for _ = 1, loops do for key, value in ipairs(newTable_array) do end end outputChatBox(getTickCount () - timeNow) end do local timeNow = getTickCount () for _ = 1, loops do for key, value in pairs(newTable_object) do end end outputChatBox(getTickCount () - timeNow) end
-
@majqq Using triggerClientEvent you can actually making it harder as you can create your own keys to secure the scripts. But it will comes at a huge price. You are risking your variable names. You have to create your own security. You are risking your security keys. Converting your encrypted code to loadstring code comes at a cost of performance. (+ it is done in Lua and not C++) The download speed isn't optimised as you are requesting files per resource. The start sequence of the files for all resources in total is something you do not have full control over. ... My recommendation for high security: compile them (losing variable names +) (Optimised +) obfuscation (secure layer +) (decrypt time - ) disable cache (not available as file) (download time - ) But if you want to give high load/download time to the players. Do only step 1.
-
Sending code with triggerClientEvent's and loading it with loadstring can give the stealer not just the code, but the exact same code as you wrote it. Note: If a stealer has stolen compiled code (event without obfuscation), the variable names you gave before are gone.
-
You got your answer on my second post. Now give it a try. Configure the column `id` and insert an item.
-
The 0's is something you should do with Lua. id's are counting up: 1, 2, 3, 4, 5 etc. Those prefixes should also be done by Lua.
-
This is column specification for auto increment ID's when new items are added. ID int NOT NULL AUTO_INCREMENT This does not reset, as DB ID are not suppose to be reset. That is asking for trouble So make sure you understand your own question very well!
-
Have you considered using a XML file? If you are not using a database, but only something to generate id's for later use, XML would be the quickest to set-up something like that. https://wiki.multitheftauto.com/wiki/XmlCreateFile @slapz0r
-
@Sisqo0 That is not how a gridlist works. Each row has multiple columns. Which means that it also has multiple properties. Each row has property: "Player" & "Vehicle" If you want to separate them, you need 2 gridlists: Gridlist 1. Row with property "Player" Gridlist 2. Row with property "Vehicle"
-
function test (arg1, arg2, ...) local restOf = table.concat({...}, " ") end ... < dynamic arguments. function test2 (...) setElementPosition(...) end test2(element, 1220, 100, 100)
- 1 reply
-
- 1