![](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
-
Hey, sorry for the delay. I recorded and put together a quick video just recently. Currently it doesn't show much other than a few of the power-ups, as the others still need more work. And it also features a very, very old and out-dated HUD interface. I'm not sure why I didn't disable it before recording, really... Haha Will be announcing and showcasing the other gamemode within the following days!
-
Been working on porting over vehicles to MTA for a while now, and the last thing I worked on was a tank model. It's not quite as wide nor as long as the default Rhino model, which becomes kind of an issue. The wheels are very big, and slightly inside of each other. I tried to use setVehicleComponentVisible, but it would turn everything BUT the wheels invisible. Does anyone know of a way to make the wheels invisible, but still work? The tank is drivable, but it looks so darn awful when the wheels are stickin' through the treads. I can post a picture later if it would be of any help. Thanks in advance!
-
Nah, it's not dead. Just kind of halted for the time being. I might record a video today to showcase each of the powerups. Majority of it I would say is done, I'd just need to make a prettier interface. Really, the biggest thing left to do is the actual gamemode itself, which is pain to set up. But I've got team-based spawning to work, and objects and all that. I just haven't found the motivation to create more maps to ensure it's loading maps properly. I will continue work on this at a later stage, as I'm writing a few other gamemodes as well for my upcoming server. One of which will be a very unique type of shooter. I'll probably announce it today!
-
I would assume there are some issues with the timers, try to delay this one like this - see if it gets any better; setTimer(function() removeEventHandler("onClientRender", root, onRender) end, fadingDuration+50, 1);
-
When you're in the editor, you'll have to set the Definitions and/or Gamemode to Race. After you have done that, move your cursor to the icons at the bottom left - and scroll up or down, it will change to race-specific options.
-
As far as I am aware, it is currently not possible as it would likely require changes to the .dff file.
-
That's because getElementsByType, gets the elements by their type and stores it in a table. You're getting elements with the element type "vehicle". So what you will get is a vehicle element. Use getElementModel instead. Edit: John beat me to it. However, I doubt this will make any difference. I'm pretty sure engineRestoreModel restores to whatever model is inside the GTA3.img. So even if they did modify a vehicle, it would just restore it to the one they modified anyway. engineRestoreModel won't magically repair the GTA3.img to original.
-
As was stated, his tutorial is more tailored towards people that have no previous experience in coding at all. And want to start here, at MTA. MTA uses a very, very noob-friendly API. So if you have basic knowledge of coding already, then no, I would not recommend it. I would recommend the Wiki instead. If you're looking to learn the very utmost basics, then yes, read it. Newcomer or not, in the end you will have to learn to navigate the Wiki and understand the examples given to get anywhere here.
-
This is included in the mtaserver.conf file as far as I'm aware. <!-- By default, the server will block the use of customized GTA:SA data files. --> <!-- To allow specific client files, add one or more of the following: --> <!-- client_file name="data/carmods.dat" verify="0" --> <!-- Comma separated list of disabled anti-cheats. For details see [url=https://wiki.multitheftauto.com/wiki/Anti-cheat_guide]https://wiki.multitheftauto.com/wiki/Anti-cheat_guide[/url] e.g. To disable anti-cheat #2 and #3, use: 2,3 --> <disableac></disableac>
-
There are changelogs for every patch as far as I know. The most significant being 1.4.
-
If I understand you correctly, you want 4 different cameras of in-game rendering, right? If I am right, that won't work very well. For example, there's a rear view mirror script, and since MTA/GTA doesn't support PIP technology - you have to effectively cut your frame rate in half. In the rear view mirror script, you have 2 cameras. One for regular camera - and one for the rear view mirror, and since you need to switch the camera matrix back and forth with every consecutive frame - you will only get half your FPS. For example; Gameplay Without Mirror: 60 FPS Gameplay with Mirror(Camera): 30 FPS
-
If you pay attention, he did. You really need to study the MTA Wiki a bit more. The reason it only triggers for one player, is because of this; triggerClientEvent ( thePlayer, "openPresGui", thePlayer ) Now go to the wikipage of triggerClientEvent and look at the arguments for it. Currently the Send To argument is a player element. That means one player. If you change that to root instead, you'll send it to all players. For example; triggerClientEvent(root, "openPresGui", resourceRoot); -- Argument 1(Optional): Should it trigger for specific players, or all of them? -- Argument 2: The event to trigger. -- Argument 3: The source element.
-
What you're doing here is that every time a zombie is spawned, you get ALL elements by the type Ped. This means, that any and all peds(zombies) will be stored in a table. You then created a for loop, which runs through every index in the table and set their health to 50. Thus, every time a zombie is spawned - you will repeat this procedure, setting all the zombie's health to 50. You can use this solution, albeit in a different way - using Element Data. Since Element Data is a very powerful tool at your disposal, I'll provide you with an example of how to use it along with your above solution. Do note, this is not the optimal solution - just one of the possible ones. Example; (I apologize in advance if I made some errors, didn't test it) function setZombieSpawnState_Handler() local allZombies = getElementsByType("ped"); for _, thePed in ipairs(allZombies) do if(getElementModel(thePed) == 281) then local theData = getElementData(thePed, "NoobZombie.HealthState"); -- Couldn't come up with any better name for it... if(theData == false) then setElementData(thePed, "NoobZombie.HealthState", true); setElementHealth(thePed, 50); end end end end addEvent("onZombieSpawn", true); addEventHandler("onZombieSpawn", root, setZombieSpawnState_Handler); The logic behind this solution is that by element datas are set to false by default if it has not already been set or contains no value. Thus, you can use this to your advantage to check if the health has already been set to 50 before or not. Most likely why his solution did not work is because source is returning nil. It is important that you learn to debug your script. For example you can use the tostring function to see what source is returning; outputChatBox("Source: ["..tostring(source).."]"); --If it returns Userdata, you can do this outputChatBox("SourceType: ["..tostring(getElementType(source)).."]"); I would need to see how the event onZombieSpawn is triggered to further help you with a solution similar to the one he suggested(it would be more effiecent).
-
With most likeliness, improper use of triggerClientEvent . It sounds like you're triggering it for all players, instead of the one that clicked the button. Can't really help without code
-
No, he is indeed right - I missed that. A label needs a string, a number is not a string. Therefore you need to convert the number to a string using tostring.
-
Try this, what does it output? local health = exports["extra_health"]:getElementExtraHealth(v) outputChatBox("Value: ["..tostring(v).."]") Edit: Are you absolutely sure the resource "extra_health" is running? It has to be running for it to work.
-
You did some things wrong, you'll have to read about triggering events a bit further - play around with it. Just make some test functions to transmit data back and forth - once you get used to it, it's pretty easy to understand. You also used getAccountData wrong. Try this; Server: function sendTheData_Handler() local theAccount = getPlayerAccount(client); local theData = (getAccountData(theAccount, "myData") or 0); -- When using getAccountData, you don't need a 3rd argument. Only when you set data. if(theData) then triggerClientEvent(client, "sendTheData", root); -- Send the data back to the client. end end addEvent ("getTheData", true); addEventHandler ("getTheData", root, sendTheData_Handler); Client: -- Trigger the server event, which gets the Account Data. addEventHandler("onClientGUIClick", root, function() if(source == data.button[3]) then triggerServerEvent("getTheData", localPlayer); end end) -- This client event will be triggered if data was retrieved without error. The server transmit the data to this function (playerData). function retrieveTheData_Handler(playerData) if(playerData ~= nil) then guiSetText(datalabel, "Your life time iron: "..tonumber(playerData)); end end addEvent("sendTheData", true); addEventHandler("sendTheData", root, retrieveTheData_Handler);
-
Judging by the error he posted - it returns nil. @boro: Where and how is the variable v defined?
-
You can use triggerClientEvent to transfer the data to a client. triggerClientEvent and triggerServerEvent are key functions for communicating between clients and the server. Definitely worth reading up on those
-
Of course you won't understand it if you refuse to even try to understand it. Some of the examples there are a bit over the top for those new to the function, but the last example is easy enough to understand the basics of it. As previously mentioned - play around with it. In the end, trial and error is a big part of coding.
-
That's very nicely presented, myonlake. I'd say it might be worthy of a sticky stick
-
I doubt it's the GPU that is at fault, but I've got a GTX 780 if you'd want me to check it out - see if we both get the same result. But it does indeed seem like a limit, can't you try to find when it occurs? Play around with the number of executions.
-
Read this post which I made in another thread.
-
So make a timer, whenever he's taken to 250 or below - set it to 250 and then start a timer. Find out how long it's on fire before explodes and use that. Dunno how well it'll work, but might be worth a shot
-
Just check if the health is equal to, or lower than 25%(250). If it is, make the health display 0. I believe it slowly goes from 250 to 0 whilst on fire...?