- 
                Posts6,089
- 
                Joined
- 
                Last visited
- 
                Days Won216
Everything posted by IIYAMA
- 
	Ah yea, did send you it.
- 
	You are talking about having encoded files on the client his hard drive? Probably there is no way of avoiding that. It might be possible to request the keys from the server, but that also means that you will have to encode and decode the keys while this is being transferred over the network. Even so the risk is more in the client editing the files, so you still have to compare hash strings before loading it. When 1 of the edited files have been loaded, all other files are being at risk. Even the eventhandlers on serverside and all the elementdata.
- 
	If the money is stored on for example the column money then you could access it like this: local money = tonumber(result_account.money) if money then else -- something went really bad ;[ end If your mysql "money" column is not correctly set-up to already fill in the money as a 0. Then this is also an option: local money = tonumber(result_account.money) or 0
- 
	It seems like you copied some wrong (invisible) characters in to your code. (can happen with the forum text editor, not sure what the issue is) I cleaned it for you. addEvent("PlayerCheck", true) function PlayerCheck(player, username, password) if type(username) == "string" and type(password) == "string" then local qh_account = dbQuery(db, "SELECT * FROM accounts WHERE username=? LIMIT 1", username) local result_account = dbPoll(qh_account, -1)[1] if result_account then if result_account.password == password then else end else end end end addEventHandler("PlayerCheck", root, PlayerCheck)
- 
	@Mr. Maxilian Afaik yes, but you still need to (manually) debug it in order to figure out it is 100% working. As being a human I can overlook things after all.
- 
	Ah yea. (and I also wrote a wrong example. ops sorry) How about something like this? if type(username) == "string" and type(password) == "string" then local qh_account = dbQuery(db, "SELECT * FROM accounts WHERE username=? LIMIT 1", username) local result_account = dbPoll(qh_account, -1)[1] if result_account then if result_account.password == password then -- success else -- wrong password end else -- wrong username end end
- 
	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.

 
            
        