![](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
-
I believe you can open and edit the MTAFuncs database with DB Browser. Whether it'll work simply by doing that or not, I don't know.
-
JR10 made a script which retrieves all the client and server functions. You can download it here.
-
Do you mean an error in 3ds Max or MTA? I believe applying a GTA Material to the mesh gets rid of the message in 3ds Max.
-
You can try to change this; triggerServerEvent ( "NGJobs->GivePlayerMoney", localPlayer, localPlayer, m, "You were paid $"..tostring(m).." for completing the flight path!" ) To this; triggerServerEvent("NGJobs->GivePlayerMoney", localPlayer, localPlayer, m) outputChatBox("You were paid $"..tostring(m).." for completing the flight path!", 0, 187, 0) This may or may not work - depending on how they set up the server event. At least I think this is what you want to achieve. If the above doesn't work, try this; triggerServerEvent("NGJobs->GivePlayerMoney", localPlayer, localPlayer, m, "") outputChatBox("You were paid $"..tostring(m).." for completing the flight path!", 0, 187, 0)
-
This is an odd one, it seems as if whenever you import something that's just a box or a rectangle - some faces will fail to render. I tried to make boxes of various sizes, and kept getting the same issue you're having. However, a more complex mesh such as the teapot shows up just fine.
-
I believe it was due to me accidentally setting a vehicle's maxVelocity to 0.
-
I was working on a script on my own local server, and I was messing around with the maximum velocity of vehicles - where as suddenly the game went all mental, I kept warping back and forth and the lighting became a bit awkward for a few seconds. I restarted my resource to fix it, but I then got kicked with the following message; "Disconnected: You were kicked by (VF #6 B09-Z01)". I've restarted my server several times but I can't rejoin it. Am I banned through the master server or what's going on here? Edit: Restarted both the server and the client and I am no longer receiving this message.
-
And you're sure that some of the polygons haven't been flipped? Sometimes this happen when you import models that have been exported from other games. You can PM me with the 3ds Max scene if you'd like and I'll take a look.
-
You're not a very patient person, are you? How about you actually try to debug it yourself, instead of always relying on examples given by others? John already told you what you should need for this. So, first step would be to find out what values they return; local testValue1 = getWeaponProperty(31, "poor", "anim_loop_start") local testValue2 = getWeaponProperty(31, "poor", "anim_loop_stop") outputChatBox("Value 1: "..tostring(testValue1).." // Value 2: "..tostring(testValue2)) And then take it from there. Never expect everything to be straight forward when scripting. It's all about trial and error.
-
Also the last math.random has a period instead of a comma, resulting in a float value rather than an integer.
-
viewtopic.php?p=798595#p798595 I want create script where player can see objects/cars/skins on the display. I like saving memory. We're helping the OP, not you Drawing a few images won't be too bad on your memory, especially not if they're small.
-
Could you provide screenshots of both the 3ds max scene and/or in-game screenshot? Better yet, the 3ds max scene itself?
-
Do you mean sort of like a showroom preview? Because if so, you can use setCameraMatrix to set the camera to the location you want, and then spawn the vehicle in front of the camera. Then you can rotate it as you please.
-
You can increase it over 100 by other means, I believe Solidsnake made a resource which does this very thing using element data. I'd recommend you look it up
-
Since it's just applied to the exhaust in general(I think), I don't think there's currently a way to rule out what exhaust belongs to what or who. However, I could be wrong as I haven't really worked with shaders in MTA.
-
There's element data and account data. The element data is lost when the element is deleted. A player element for example is deleted when the player disconnects. Account data is, like the name implies - tied to their account. So long as the player uses the same account, the data will be available if the player reconnects or whatnot. setAccountData getAccountData
-
0.png, 5.png, 10.png, 15.png, 20.png, 25.png, 30.png........ (100.png) What kind of design are you going for? Could you post one or two of the images? Because generally it's a better idea to just make something you can just alter the width and/or height of depending on the value. Rather than having 20 different images.
-
You'll want to make sure you understand the function before you try to use math like this. getVehicleNitroLevel returns a float value between 0.0001 and 1.0. And with your math, this will always output as 5, whether the Nitro Level is 0.1, 0.5 or even 1.0 - your calculation will always return 5. I suggest you use a website such as http://repl.it/languages/Lua to make quick mathematical tests, that way you won't have to do it with your resource - it's actually a really convenient website and I use for everything between testing mathematic calculations and generating meta.xml files. I don't know how many images you have, so I can't really help you get the results you seek.
-
Storing the path in a variable instead. dxDrawImage(x*960+x2, y*470+y2, 306, 232, hb_Image, 0,0,0, tocolor(255, 255, 255 , 255)) would be the same as dxDrawImage(x*960+x2, y*470+y2, 306, 232, "files/2/hb2.png", 0,0,0, tocolor(255, 255, 255 , 255))
-
How do you check if they're military so they can use the command?
-
Probably through element data, I would assume it's a range of 0-100, yeah.
-
I don't think there's any DX Library that is quite finished. Woovie and laserlaser both have their own WIP's. I tried laserlaser's resource once and it was pretty easy to work with. But it's far from finished, so you'd have to make changes for it to suit your needs. You can find his latest revision here; SDT
-
You could try something like this. I've been away from MTA a while studying C++, so something might not be working as I didn't test it. But it should local hb_BoundKeys = {} local hb_SoundState = false local hb_TheSound = nil function getHandbrakeKeysOnStart_Handler() hb_BoundKeys = getBoundKeys("handbrake") -- Get all the keys they have bound to the Handbrake. end addEventHandler("onClientResourceStart", resourceRoot, getHandbrakeKeysOnStart_Handler) function checkKeyPresses_Handler(theButton, theState) if(isPedInVehicle(localPlayer) == true) then -- Make sure they player's in a vehicle, should minimize the times it's run a bit. You can also add a check to make sure he's in a driver seat. for key, value in ipairs(hb_BoundKeys) do -- Run through the stored keybinds, and check if they match. if(theButton == value) then -- If they match, trigger the function that plays the sound. (I left out theState so it triggers both on press and release.) handbrakeSound_Handler() end end end end addEventHandler("onClientKey", root, checkKeyPresses_Handler) function handbrakeSound_Handler() if(getControlState("handbrake") == true) then -- Another check to make sure the control is active. if(hb_SoundState == false) then -- Only run if hb_SoundState is false, to prevent it from being played twice. hb_SoundState = true -- Update the variable as we're about to play the sound, it will still trigger the rest of the code before the code block ends. hb_TheSound = playSound("files/handbrake.wav", false) -- Play the sound and store it as a variable, this lets you manipulate the sound later on if you want to(Change volume, pitch etc). end else -- If the handbrake control is not true, reset the rest. if(hb_SoundState ~= false) then hb_SoundState = false if(hb_TheSound) then stopSound(hb_TheSound) end end end end Edit: You can also use this code to update what image should be drawn, something like this; local hb_BoundKeys = {} local hb_SoundState = false local hb_TheSound = nil local hb_Image = "files/2/hb.png" function getHandbrakeKeysOnStart_Handler() hb_BoundKeys = getBoundKeys("handbrake") -- Get all the keys they have bound to the Handbrake. end addEventHandler("onClientResourceStart", resourceRoot, getHandbrakeKeysOnStart_Handler) function checkKeyPresses_Handler(theButton, theState) if(isPedInVehicle(localPlayer) == true) then -- Make sure they player's in a vehicle, should minimize the times it's run a bit. You can also add a check to make sure he's in a driver seat. for key, value in ipairs(hb_BoundKeys) do -- Run through the stored keybinds, and check if they match. if(theButton == value) then -- If they match, trigger the function that plays the sound. (I left out theState so it triggers both on press and release.) handbrakeSound_Handler() end end end end addEventHandler("onClientKey", root, checkKeyPresses_Handler) function handbrakeSound_Handler() if(getControlState("handbrake") == true) then -- Another check to make sure the control is active. if(hb_SoundState == false) then -- Only run if hb_SoundState is false, to prevent it from being played twice. hb_SoundState = true -- Update the variable as we're about to play the sound, it will still trigger the rest of the code before the code block ends. hb_TheSound = playSound("files/handbrake.wav", false) -- Play the sound and store it as a variable, this lets you manipulate the sound later on if you want to(Change volume, pitch etc). hb_Image = "files/2/hb2.png" end else -- If the handbrake control is not true, reset the rest. if(hb_SoundState ~= false) then hb_SoundState = false hb_Image = "files/2/hb.png" if(hb_TheSound) then stopSound(hb_TheSound) end end end end
-
It's looping endlessly because you're running it through onClientRender, you'll be running it every 15-30ms. You can prevent this by using a variable and if statements as shown earlier in this thread - or you can use a separate function that handles the sound. Which triggers via onClientKey or whatever.
-
If I recall correctly what I did for my ABS prototype, whenever a player connected I retrieved all the keys they had bound to the control "brake". Using getBoundKeys. What you then can do is check that whenever a player is in a vehicle, whenever either of these keys are pressed down - draw the red one, otherwise draw the red one. I'd give you my ABS prototype but I can't remember where I stored the uncompiled version. It might have been on my laptop which I formated