![](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Dealman
Members-
Posts
1,421 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Dealman
-
Just out of curiosity, have you tried drawing the image in the browser? You should be able to enter the decoded data directly into the src attribute of an image class.
-
This picture sums it up pretty nicely I believe;
-
You could indeed use their serial to generate means of achieving secure auto-login, but I believe there is a small chance for users to have the same serial number. Do note though, that the chance of this happening is extremely small(read this some while ago, it's very possible this might have changed since then). Then there's also the problem of the serial being generated as per your hardware(and IP I think?). So there's also the possibility of their serial being changed if they change some of the hardware and thus the auto-login would cease to work. You'll also want to make sure you use a salt when you store people's passwords. Preferably a salt that is randomly generated every time someone attempts to register, this way each user would have their own unique salt. Quite frankly I'm not entirely sure what would be the best approach to create auto-login within MTA in terms of security. I would guess their serial is a good place to start. Personally I would refrain from storing any kind of information regarding their username and/or password on their computer, instead try and store it all on the server. You would be amazed by the amount of trouble some people can and will go through to get someone else's details. Also, as a programmer - you should always think ahead and assume that the user will do something wrong.
-
Start with something simple, such as an image. Store the picture on the server, then you can use fileOpen to open the file - after you have opened the file, you can use fileRead to read its contents. If you store the data in a variable, you can later send this variable(now a string) to the client. Upon sending this data to a client, the client can then use this string to create a new file via use of fileCreate and fileWrite. Once created, you can then draw this picture using GUI/DX functions. I've been away from MTA for some time, so I forget whether you can use the file functions on a file that does not exist in the meta.xml or not. But if such is the case, you should be able to use the XML functions to edit the meta file. fileExists -- Check if the file exists beforehand(optional since fileOpen sort of does it for you) fileOpen -- Open a file of your choice, to read it and store the data fileRead -- Read the data of an opened file, store it in a variable fileClose -- Close the opened file to clear up memory fileWrite -- Write data into a new file addEvent -- Create a custom client-side event to retrieve the data with addEventHandler -- The event obviously needs a handler triggerClientEvent -- Use this to trigger the client-sided event you created. Pass the data as an optional argument Go ahead and try it a bit, in the end - programming and scripting is pretty much all about trial and error. If you get stuck I'll try and help you from there - but I will not provide you with lengthy examples as I believe it won't really teach you anything
-
..."Fuck Down Up"? What does that even mean?
-
Or better yet, simply do this and it will be automatic; function getPositionFromElementOffset(element, offX, offY, offZ) local m = getElementMatrix(element) local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] 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 end function webBrowserRender() -- This will fetch the top middle point of the drive-in screen (Remember to replace the INSERTSCREENELEMENTHERE variable with your object pointer) local screenPosX, screenPosY, screenPosZ = getPositionFromElementOffset(INSERTSCREENELEMENTHERE, 0, 0.04, 10.6) dxDrawMaterialLine3D(screenPosX, screenPosY, screenPosZ, screenPosX, screenPosY, screenPosZ-8.5, webBrowser, 18, tocolor(255, 255, 255, 255), screenPosX, screenPosY+1, screenPosZ) end This way you can put the screen object pretty much wherever you please as the position is relative to the object and not worldspace. You can also easily adapt this for more than 1 screen if you so desire.
-
So if the script actually do work, but it doesn't warp them fast enough - why not make the shape a little bigger? Are you using timers or the colshape events?
-
Well, first of all you're using the event "onClientResourceStart". So that should be rather obvious. Also, when you use the [lua] tags on these forums, functions will be highlighted in a certain colour. Red means it's client-side only, Orange means it's server-side only and blue means it's available both for client and server. As for the TXDs working, I'm not quite sure what you're asking. So long as the TXD is set up properly, then yes, it should work.
-
I know there is a object limit and I'm fairly sure there's also a limit on how many objects you may replace, believe I've read it somewhere on these forums. If you do some searching you might be able to find the thread. If not one of the devs should be able to give a more accurate and helpful answer if they swing by.
-
Yes, you can use the map editor to find Model IDs for objects, vehicles and ped skins. engineLoadTXD returns a TXD file, meaning it will store a pointer inside the given variable for later reference. If you were to do this once, and then a second time - it would replace the first one. So to answer your question, yes, you would either need to use different variables or a table. The variable will contain the pointer to the TXD file so long as you don't clear the variable or overwrite it. Thus, you can apply it to multiple objects if you need to.
-
You actually don't need to enable OOP if you prefer not to use it. If you look at the wiki page of getElementMatrix you have this example which does exactly what you want; 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 -- Get the position of a point 3 units to the right of the element: x,y,z = getPositionFromElementOffset(element,3,0,0) -- Get the position of a point 2 units in front of the element: x,y,z = getPositionFromElementOffset(element,0,2,0) -- Get the position of a point 1 unit above the element: x,y,z = getPositionFromElementOffset(element,0,0,1)
-
So if you don't want it to be bigger than 50x50 pixels, then just put the size as 50 pixels wide and high. You could just add an if statement that checks if the resolution is bigger than 1280x768. If true, size of the image is 50x50 pixels. If false, follow your usual formula. Also you can create different images, of course. Some games usually have interface textures designed for multiple ratios like 4:3, 16:9 and so on.
-
You'll need to contact him if you want to get your hands on the source code.
-
Put the files on the server instead, and read them using fileRead. Then use triggerClientEvent to send the information to the client(s). You can then use fileCreate to create a new file and use fileWrite to write the information sent to the client via the server. And there you have it, simply delete it after it has been loaded.
-
Of course you can, just assign it to a different variable(if you wanna manipulate it using audio functions). You could have found this answer in less than 5 minutes simply by trying it.
-
Player spawning is done via the server, thus you need to post the server-sided script. The event you want to look for is; "onPlayerSpawnButton".
-
Assuming the files exist, both of them should work. The issue however, is that you replace the sound almost immediately. You create a sound, playing the song.mp3 file, then you check if this sound is an element - if true, you stop it. Then you start playing landing.mp3 under the same variable. So basically what you're doing is stopping the sound right after you created it, and then play another one.
-
I like the idea behind the gamemode, but the interface design is absolutely awful. Also for the minigun, you can place a dummy one to make it look like it's facing forward instead of upwards. Also seems like the minigun would be massively overpowered for this gamemode. So you'll have 2 miniguns, one invisible(does the shooting). And one that is visible(dummy).
-
You'll want to use setVehicleHandling and modify the maxVelocity value.
-
You'll need to use triggerServerEvent for a client to send information to the server. Use addEvent to create a custom event and addEventHandler to handle your custom event.
-
Using a colshape would work, yes. You could also use getZoneName I suppose, but it wouldn't be as accurate. The event you need to use is onVehicleEnter. Then you check their team using getPlayerTeam and/or getTeamName. If you have access to the script that spawns the vehicles, you could also use setElementData and getElementData. If they're not in the team "Psycho Mans Gang" then use cancelEvent.
-
Well we cant't really help if we're not given information. What are the timers meant to do? What is it that they stop doing?
-
And you expect us to magically know what's wrong? You'll need to show us the script, with the timers. You need to help us help you
-
That's because you're overwriting the same variable, object. Player 1 runs the command, an object is created with the pointer object. Player 2 runs the command, an object is created - but the pointer object already exists. It overwrites it. Player 1 runs the command to delete the object, last created object is deleted. (In this case, the one made by Player 2) You'll indeed need to use tables for this; table.insert table.remove