
Atton
Members-
Posts
211 -
Joined
-
Last visited
Everything posted by Atton
-
The NBDSF is a tool that I have been working on for a while now. I got really pissed off with SQL lite and wanted to see if I could make my own DB. After doing some reading with stuff related to C++ I got a bit of a better idea about how data works and all that. So after a few days of messing around I was able to make this tool. -- The table that is used to store data into RAM. coreTable = {}; -- Used to split data function dataSplit (dataIn) local gate = true; local tag = false; local data = false; for a,b in pairs (split(dataIn,'*')) do if gate then name = b; coreTable[tostring(b)] = ""; gate = false; else coreTable[name] = tostring(b); gate = true; name = false; data = false; end end end; -- Read From File function readFromFile () local theFile = fileOpen("database.db"); local theData = fileRead(theFile,fileGetSize(theFile)); tableD = split(theData,'~'); for a,b in pairs (tableD) do dataSplit(b); end end; readFromFile (); -- Get's the data from the table. function getData (AC1) if AC1 then local InName = tostring(AC1); local theData = coreTable[inName]; if theData then return theData; else return false; end end end; -- Check’s if shit is original to prevent overwrites and database damage. function ifOriginal (name) if name then if coreTable[tostring(name)] then return false; else return true; end end end; -- Checks data going to the table and protects the database from corruption. function checkData (username,data) stat = tostring(string.find(tostring(username),"~")); stat2 = tostring(string.find(tostring(username),"*")); stat3 = tostring(string.find(tostring(data),"~")); stat4 = tostring(string.find(tostring(data),"*")); if username and data then if stat == "nil" and stat2 == "nil" and stat3 == "nil" and stat4 == "nil" then return true; else return false; end end end; -- Inject's data into table. function injectData (v1,v2) if v1 and v2 then local name = tostring(v1); local data = tostring(v2); if name and data then if checkData(name,data) then if ifOriginal(name) then coreTable[name] = ""; coreTable[name] = data; return true; else return false; end end end end end; -- Writes to table. function writeToTable (v1,v2) if v1 and v2 then local name = tostring(v1); local data = tostring(v2); if name and data then if getData(name) then if checkData (name,data) then coreTable[name] = ""; coreTable[name] = data; return true; else return false; end end end end end; -- Used to write data to file in order to prevent information from being lost. function writeToFile () local theFile = fileOpen("database.db"); for a,b in pairs (coreTable) do -- fileWrite(theFile,"\n".."~"..tostring(a).."*"..tostring(b)); This might be useful for making the db look clean. fileWrite(theFile,"~"..tostring(a).."*"..tostring(b)); end fileClose(theFile); end; setTimer(writeToFile,120000,0); addCommandHandler("backup",writeToFile); -- Writes data to when the script closes. --[[ ```````````````````````````````````````]]-- addEventHandler ( "onResourceStop", root, function ( resource ) writeToFile (); end ); --[[ ```````````````````````````````````````]]-- function makeAccount (name,data) if injectData(tostring(name),tostring(data)) then return true; else return false; end end; addEvent("NBDSF.makeAccount",true); addEventHandler("NBDSF.makeAccount",getRootElement(),makeAccount); function readAccount (name) if name then local data = getData(tostring(name)); if data then return tostring(name),tostring(data); else return false; end end end; addEvent("NBDSF.readAccount",true); addEventHandler("NBDSF.readAccount",getRootElement(),readAccount); function editAccount (v1,v2) if v1 and v2 then local name = tostring(v1); local data = tostring(v2); if name and data then if writeToTable (name,data) then return true; else return false; end end end end; addEvent("NBDSF.editAccount",true); addEventHandler("NBDSF.editAccount",getRootElement(),editAccount); function dumpDataBase () for a,b in pairs (coreTable) do return a,b; end end; addEvent("NBDSF.dumpDataBase",true); addEventHandler("NBDSF.dumpDataBase",getRootElement(),dumpDataBase); It performs rather well and does not seem to run into any issues when I put it through testing. I was at one point able to load about 10,000 account into the system and it seems to work fine. But rather going on about testing I think I should explain how it works or at least try. Tables are sort of like Arrays they can store data under a key sort of like this. theTable Atton:LOLATUNAPASSWORD BUXBOI:PASSWORD1234 theTableEnd You get the data by using the key so if I wanted my password I can use Atton as the key to find it on the DB. The only issue is that when you store data to tables it is stored in ram where if the script is stopped that information is destroyed. That is why non volatile memory was invented so you can just write it to your hard drive and read it when you need to restore it. In the table the only data stored is the account name being used as the key and the password. You can defeat this using split and base64Encode for example. Let say you wanted to store your username,password hash,cash,x,y,z you can do this. username..","..hash..","..cash..","..x..","..y..","..z The "," is used to provide a break where the split function can work if you write one. I would suggest encoding this using base64 as it looks cleaner on the db. ~dbroot*dbroot~Atton*543798hghfkdhgfdjkhgjkfdhgjkfdhkjewqewqewq If you create your data structure you can write it to the DB rather easy with a few functions below. editAccount Accepts two arguments (AccountName,Data) returns true or false readAccount Accepts one argument (AccountName) returns the account name and data makeAccount Accepts two arguments (AccountName,Data) returns true or false dumpDataBase Returns the database stored in ram They are all exports and should be rather easy to use, writing your data structure and making it load right is the hard part. I have not actually got around to making it work but you are welcome to make one and post it. But what do you guys think would you use this is it shit or what. https://community.multitheftauto.com/in ... s&id=10683
-
That can likely be done with texture replacement.
-
F1 FR GUI >> Paint Jobs
-
Retro gaming has been a thing for years.
-
Pretty much nothing of any seriousness check the wiki if you want.
-
I see thanks it is quite a head spinner.
-
I have been messing around and reading some of the MTA Source code. I have wanted to make a system of sorts that could decrypt and encrypt outside of MTA. I am just curious of what dependency’s are there with Sstring. tea.cpp http://pastebin.com/ErAr2rcQ Sstring.hpp http://pastebin.com/vTMnkkAr Sstring.h http://pastebin.com/VE2hWwd2
-
Try implementing the code below. -- Server function serverRun (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent("name",getRootElement(),thePlayer) end end addCommandHandler ( "talktoplayers", serverRun) -- Client function theClient () end addEvent("name",true) addEventHandler("name",localPlayer,edit)
-
Take a look at the MTA source code. https://code.google.com/p/mtasa-blue/wi ... uilds?tm=2 It is massive and impossibly complex most of it would need to be redone for MTA IV. It would only ever happen with GTA 5 and that has been planed by the guys who made the mafia 2 multiplayer.
-
Do yourself a favor and just download an emulator like most people do. http://emulator-zone.com/doc.php/psx/epsxe.html
-
If anyone can come up with a fix for the cam post it here.
-
That is quite strange it should work, any sort of errors you can tell me of.
-
Some time ago I made a remote control car script. It works on the client and works pretty well apart from the cam. I might make a video about it later on have fun with it. [url:1vdj4qfi]http://www.mediafire.com/download/3kcc3h71jid1djj/remotecar.lua[/url:1vdj4qfi] --[[ Made by Atton Risk in 2014 ]]-- -- Script local x,y,z = 0,0,12 local car = createVehicle(578,x,y,z) setVehicleDamageProof(car,true) local pedd = createPed(0,x,y,z+69) warpPedIntoVehicle(pedd,car) createBlipAttachedTo(car,0) setElementStreamable(car,false) setElementStreamable(pedd,false) fw = "num_8" bw = "num_2" le = "num_4" ri = "num_6" upk = "num_9" downk = "num_3" function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end function foward () if getKeyState(fw) == true then setPedControlState(pedd,"accelerate",true) end if getKeyState(fw) == false then setPedControlState(pedd,"accelerate",false) end end function back () if getKeyState(bw) == true then setPedControlState(pedd,"brake_reverse",true) end if getKeyState(bw) == false then setPedControlState(pedd,"brake_reverse",false) end end function left () if getKeyState(le) == true then setPedControlState(pedd,"vehicle_left",true) end if getKeyState(le) == false then setPedControlState(pedd,"vehicle_left",false) end end function right () if getKeyState(ri) == true then setPedControlState(pedd,"vehicle_right",true) end if getKeyState(ri) == false then setPedControlState(pedd,"vehicle_right",false) end end function up () if getKeyState(upk) == true then setPedControlState(pedd,"special_control_up",true) end if getKeyState(upk) == false then setPedControlState(pedd,"special_control_up",false) end end function down () if getKeyState(downk) == true then setPedControlState(pedd,"special_control_down",true) end if getKeyState(downk) == false then setPedControlState(pedd,"special_control_down",false) end end function cam () local offX,offY,offZ = getPositionFromElementOffset(car,0,0,1.5) local offX2,offY2,offZ2 = getPositionFromElementOffset(car,0,0,1.5) setCameraTarget(offX,offY,offZ) setCameraMatrix(offX,offY,offZ,offX2,offY2,offZ2) end function timeSystem () foward () back () right () left () up () down () -- cam () end dswitch = false function switch () if not dswitch then addEventHandler ("onClientRender", root, timeSystem) dswitch = true elseif dswitch then setCameraTarget(localPlayer) dswitch = false removeEventHandler ("onClientRender", root, timeSystem) --[[ setCameraMatrix(localPlayer) setCameraTarget(localPlayer) ]]-- end end addCommandHandler("onoff",switch) --[[ lor: #66cc66;">) then outputChatBox("row "..i.." removed") else outputChatBox("err") end end the loop is the problem, this might be the solution. Same result, but thanks. Ah, I just realised the problem. When row index 0 is deleted, index 1, 2 .. etc. are shifted upwards to 0, 1.. so the next index 1 that is being deleted is actually the original index 2, but the original index 1 never gets touched. I guess it worked that way for all the odd numbers. Tests confirmed it. Solved code: for i=0,rowCount do guiGridListRemoveRow(cart,0) end
-
Ale is more to create a concept of what can be done, then it is to provide real advantage since there are simply limitations in MTA Lua. I have never claimed that the code was mine and yes I might have removed your credits in the Meta. However it seems a bit hypocritical since you are not crediting Vincent Rijmen & Joan Daemen. Seriously? Jusonex being hypocritical? You must be freaking kidding. There is a huge difference between intentionally removing someone's credits (credits to Jusonex are entirely missing) and leaving out a "license.txt" file of an encryption method that is so fundamental (still, Jusonex' MTA AES port did include credits to bighil's Lua AES port!). Most people don't bother garbaging their code with licenses of trivial Base/AES implementations anyways. ...trying to justify your own insolence by pointing at other people's (alleged) faults: HYPOCRITE DETECTED. Having to download/cache client files on each server join creates unnecessary data traffic and wait time. Yet, Ale is still obsolete given the fact MTA now has it's own built in AES encryption for client-side scripts (https://luac.multitheftauto.com/) - with its encryption being in the safest part of MTA: The closed-source netc.dll. I went ahead and added credits for Jusonex,Bighill,Viencent Rijmen and Joan Daemen. I'll admit I was lazy there and Jusonex is a sexy beast so it is a must do. Also the mta encrption can be defeated with a few lines of Lua code.
-
Ale is more to create a concept of what can be done, then it is to provide real advantage since there are simply limitations in MTA Lua. I have never claimed that the code was mine and yes I might have removed your credits in the Meta. However it seems a bit hypocritical since you are not crediting Vincent Rijmen & Joan Daemen.
-
If you don't want to use the mta compiler use this. https://forum.multitheftauto.com/viewtopic.php?f=108&t=81422
-
I do not know if I am thick in the head or something but it never want's work in a straight line. local x,y,z = 1427,-2494,15 car = createVehicle(578,x,y,z) setVehicleDamageProof(car,true) pedd = createPed(0,x,y,z+69) warpPedIntoVehicle(pedd,car) setPedAnalogControlState (pedd, 'accelerate', 0.01) createBlipAttachedTo(car,0) setElementStreamable(car,false) setElementStreamable(pedd,false) a,b,c = 0,50,0 fw = "num_8" bw = "num_2" le = "num_4" ri = "num_6" upk = "num_9" downk = "num_3" function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end function foward () if getKeyState(fw) == true then setPedControlState(pedd,"accelerate",true) end if getKeyState(fw) == false then setPedControlState(pedd,"accelerate",false) end end function back () if getKeyState(bw) == true then setPedControlState(pedd,"brake_reverse",true) end if getKeyState(bw) == false then setPedControlState(pedd,"brake_reverse",false) end end function left () if getKeyState(le) == true then setPedControlState(pedd,"vehicle_left",true) end if getKeyState(le) == false then setPedControlState(pedd,"vehicle_left",false) end end function right () if getKeyState(ri) == true then setPedControlState(pedd,"vehicle_right",true) end if getKeyState(ri) == false then setPedControlState(pedd,"vehicle_right",false) end end function up () if getKeyState(upk) == true then setPedControlState(pedd,"special_control_up",true) end if getKeyState(upk) == false then setPedControlState(pedd,"special_control_up",false) end end function down () if getKeyState(downk) == true then setPedControlState(pedd,"special_control_down",true) end if getKeyState(downk) == false then setPedControlState(pedd,"special_control_down",false) end end function cam () local cx, cy, cz = getVehicleComponentPosition(car, "windscreen_dummy") -- outputChatBox(tostring(cx).." "..tostring(cy).." "..tostring(cz)) local lookAtX, lookAtY, lookAtZ = getPositionFromElementOffset(car, cx - .5, cy, cz) -- Gets the center of the bumper component local camX, camY, camZ = getPositionFromElementOffset(car, cx - 0.5, cy + 2.3, cz + .3) -- Gets the positions for the camera setCameraMatrix(camX, camY, camZ, lookAtX+a, lookAtY+b, lookAtZ+c) end function timeSystem () foward () back () right () left () up () down () cam () end dswitch = false function switch () if not dswitch then addEventHandler ("onClientRender", root, timeSystem) dswitch = true elseif dswitch then setCameraTarget(localPlayer) dswitch = false removeEventHandler ("onClientRender", root, timeSystem) end end addCommandHandler("onoff",switch) --[[ for k in pairs (getVehicleComponents(car)) do outputChatBox(tostring(k)) end ]]-- function change (nill,x,y,z) a,b,c = tonumber(x),tonumber(y),tonumber(z) outputChatBox(tostring(x)..tostring(y)..tostring(z)) end addCommandHandler("set",change)
-
MTA does not have inbuilt AES which was the target of this project. This is really all just a short demonstration of the capacities that exist in MTA.
-
I want to glue a cam onto the bumper of a car. My attempts to use the cam functions did not work. function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end function cam () local offX,offY,offZ = getElementPosition(car) local x,y,z = getPositionFromElementOffset(car,offX,offY,offZ) setCameraMatrix(x,y,z) setCameraTarget(x,y,z) end
-
It does not really seem to be really helpful.
-
How would it be possible to create a cam that follows on the front of the truck. Without it messing up like if you stuck a cam on the bumper of a car. car = createVehicle(578,x,y,z) function getPositionInfrontOfElement ( element , meters ) if not element or not isElement ( element ) then return false end if not meters then meters = 3 end local posX , posY , posZ = getElementPosition ( element ) local _ , _ , rotation = getElementRotation ( element ) posX = posX - math.sin ( math.rad ( rotation ) ) * meters posY = posY + math.cos ( math.rad ( rotation ) ) * meters return posX , posY , posZ end function cam () local x,y,z = getPositionInfrontOfElement(car,4) setCameraTarget(car) --setCameraTarget(x,y,z) setCameraMatrix(x,y,z+2,x,y,z,0,0) end
-
The AES GUI or Advanced Encryption Standard runs entirely off Lua without dependency. It is a simply download and start below is a video and a github link for the resource. Anyone is welcome to add to the resource if they want to. https://github.com/thenuke321/Multi-The ... TAAESGUI-/