![](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
-
If you tried to understand the examples given to you, and read about the functions they used - you would know why. interpolateBetween has a progress argument, where you need to provide a float between 0 and 1. In this case a progress of 1 would mean full health, green. 100/100 = 1.0 (100%) 100/200 = 0.5 (50%) That's why it showed as orange when at 100%.
-
<meta> <script src="script.lua" type="client/server"/> </meta> That's all you really need in the meta for a testing resource. If it still doesn't work it's probably the script itself. Debug it and look for errors and warnings.
-
As it's mentioned in the description of the video; "Working tracks will be available in San Andreas At War after the release of Eir. Such functions were CLEO-only befor i made this script." This was made on MTA: Eir and not MTA: Blue. I find it hard to believe you'd as easily achieve something like this with MTA: Blue. Now, it might be possible if you're good with shaders as really all you'd have to do is change the UV co-ordinates of a texture. You could then use the function dxSetShaderValue to change it depending on your velocity/speed/direction/whatever. You'd probably be best off asking someone like Ren_712 on these forums, he's very experienced with shaders.
-
Maybe it's something within the mapmanager resource?
-
Well that's all the hits for "fade" in the entire Race resource. If it's neither of those, it's another resource controlling it.
-
Did you try using Notepad++'s search function? In case you missed something... Search "fade" (36 hits in 7 files) F:\Games\MTA San Andreas 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\countdown.lua (1 hit) Line 69: self.client.fade = enable F:\Games\MTA San Andreas 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\countdown_client.lua (1 hit) Line 70: if self.fade then F:\Games\MTA San Andreas 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\editor_support_client.lua (2 hits) Line 32: -- Do fadeup and tell server client is ready Line 33: setTimer(fadeCamera, 200, 1, true, 1.0) F:\Games\MTA San Andreas 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\nametags.lua (1 hit) Line 24: -- Make the text a bit brighter and fade more gradually F:\Games\MTA San Andreas 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\race_client.lua (16 hits) Line 18: fadeCamera(false,0.0) Line 122: -- Start the fadeout as soon as possible Line 171: fadeCamera( false, 0.0, 0,0,0 ) -- fadeout, instant, black Line 171: fadeCamera( false, 0.0, 0,0,0 ) -- fadeout, instant, black Line 190: fadeCamera(true) Line 266: fadeCamera( false, 0.0 ) Line 283: -- Do fadeup and then tell server client is ready Line 284: setTimer(fadeCamera, delay + 750, 1, true, 10.0) Line 285: setTimer(fadeCamera, delay + 1500, 1, true, 2.0) Line 415: if Spectate.fadedout then Line 790: Spectate.fadedout = true Line 1067: Spectate.fadedout = true Line 1075: Spectate.fadedout = false Line 1092: if Spectate.fadedout then Line 1185: fadeCamera(false,0.0, 0,0,0) -- Instant black Line 1189: setTimer(fadeCamera,250+500,1,true,1.0) -- And up F:\Games\MTA San Andreas 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\race_server.lua (2 hits) Line 762: fadeCamera ( g_RootPlayers, false, 0.0, 0,0, 0 ) Line 814: fadeCamera ( g_Root, false, 0.0, 0,0, 0 ) F:\Games\MTA San Andreas 1.4\server\mods\deathmatch\resources\[gamemodes]\[race]\race\util_client.lua (13 hits) Line 315: -- Trigger an event when the screen fades in/out Line 317: local fadeInFinTimer = Timer:create() Line 319: _fadeCamera = fadeCamera Line 319: _fadeCamera = fadeCamera Line 320: function fadeCamera(fadeIn,timeToFade,...) Line 320: function fadeCamera(fadeIn,timeToFade,...) Line 321: _fadeCamera (fadeIn,timeToFade,...) Line 321: _fadeCamera (fadeIn,timeToFade,...) Line 323: if not fadeIn then Line 324: fadeInFinTimer:killTimer() Line 327: fadeInFinTimer:setTimer( onfadeInFin, math.max(50,ticksToFade/8), 1 ) Line 327: fadeInFinTimer:setTimer( onfadeInFin, math.max(50,ticksToFade/8), 1 ) Line 331: function onfadeInFin()
-
You could search through the community resource and you'll find a few to choose from. I've got one linked in my signature, but it streams internet radios client-side. I haven't touched it in a while, so it's pretty out-dated.
-
Are you sure the Rhino takes damage by the RPG? Otherwise, I assume you'll have to check whenever there is an explosion - and who the creator was. If there's a Rhino within a distance of X, either damage it or blow it up.
-
What exactly are you trying to achieve? You've got me rather confused
-
Yes, first of all you need to get all player elements and then check their team. After that, add them to a table. For example; -- Define the table. local mtaTeamPlayers = {}; -- First of all, fetch all current player elements local allPlayers = getElementsByType("player"); -- Then loop through all players and check their team name for k, v in ipairs(allPlayers) do if(getTeamName(getPlayerTeam(v)) == "MTA") then -- If their team name matches the one you want, get their player name and store it in a local variable local playerName = getPlayerName(v); -- Insert their name into our previously defined table table.insert(mtaTeamPlayers, #mtaTeamPlayers, playerName); end end Of course that's just an example. You'll have to make code which updates the table whenever a player join and quits. You'll also have to loop through the table to draw their names using dxDrawText. Edit: Or use the function manawydan suggested
-
Just curious if anyone has found any reliable way of differentiating a map from a resource? I recall trying to do this before when I was working on a script to alter the volume of music played via maps. For the most part the issue lies with how onClientSoundStarted is designed. It would be a very welcome addition if it also returned the name of the resource that started it. But it doesn't. None of the sort. Before that event was introduced, I relied on a script that checked for sound elements with a length of 30 seconds or above when it was started. Then it used events available by the Race resource(onRaceStateChanging) to start a new timer every time a map changed(and then kill the timer if a sound was found). It worked pretty well, only issue was that it would sometime interfere with streamed music as well. Now I thought this would be easy to solve using getElementParent and getResourceName. However, that wasn't quite the case - and I'm not sure what the logic behind those functions are. For example, if I found a sound that was longer than 30 seconds - it was either a song started via a map or the music streamer. If I got the parent of that, it would return "map" for both sounds. And if I got the parent of that parent, it returned "resource" for both. After this I thought, well, I'll just get the resource name of the two and compare them. But this wasn't possible either, since getResourceName requires "resource-data" and not a resource element. Am I missing something here? Or is the logic behind getResourceName a bit odd?
-
Mmm, I assumed there would be a way to get world models since you can remove them. I guess not. Only way I can think of then would be to do it manually. Unless there's a way to extract the XYZ co-ordinates of them via GTA files - which I doubt.
-
Personally I would get the offsets of the lamps you wanna edit. Then get all lamps by that model and simply use the offset.
-
You have the wonderful Dynamic Lights resource by Ren712, he's quite the sexy little shader god around here. The resource also has a Wiki Page. Whether it's what you're looking for or not, I don't know.
-
Never worked with weapon properties, but try something like this; Server-side function setPropertyOnStart_Handler() setWeaponProperty("colt 45", "poor", "maximum_clip_ammo", 2) end addEventHandler("onResourceStart", resourceRoot, setPropertyOnStart_Handler)
-
This is covered under Writing Gamemodes on the Wiki.
-
You'll find the text itself under race_server.lua; function updateNotReadyText() if howManyPlayersNotReady() == 0 then deactiveNotReadyText() end if g_NotReadyDisplay then -- Make sure all ready players are observers for i,player in ipairs(g_Players) do if isPlayerNotReady(player) then textDisplayRemoveObserver(g_NotReadyDisplay, player) else if not textDisplayIsObserver(g_NotReadyDisplay, player) then textDisplayAddObserver(g_NotReadyDisplay, player) g_NotReadyDisplayOnTime = getTickCount() end end end -- Only show 'Waiting for other players...' if there actually are any other players if getTotalPlayerCount() > 1 then textItemSetText(g_NotReadyTextItems[1], 'Waiting for other players...' ) end end end
-
You read the wrong part of the tutorial. I meant this part;
-
You can use my tutorial for an example on how to make the process(convert absolute to relative) much faster. Since onClientRender is triggered several times a second, getting rid of any calculations within it is recommended. Multiplying it once will be more efficient than dividing it first and then multiplying it - since you'll be doing this 30-60 times a second.
-
Use proper indentations and you won't be having as a hard time seeing where you messed up. Also, reading up how if statements work within Lua could be useful.
-
It's mostly used to indicate where a block of code ends, but since Lua is a slightly different language - it's not necessary like it is in other languages such as C++. I think it's good practice to do it anyway in case you'll find yourself doing some C++ later since missing a semi-colon or putting it in the wrong place can break your entire thing.
-
Aye, it's very easy, you already have some of the code for it here.
-
What exactly is it you're trying to do with this? As far as I can tell, this is only to add different methods of logging into your IP Forum - for example, sign in through Steam or similar.
-
Because every time the function enterVehicle is called, a new event handler is created for "BusMarsh1". You'll have to remove it using removeEventHandler.