Dealman
Members-
Posts
1,421 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Dealman
-
If you're new to this, GUI Editor is by far the best option you have. It's so easy to use and well-made it's amazing. What problems are you having?
-
I don't think you quite understand what spamming actually mean. Asking for help - is not spamming. @Adi: As 50p stated, you'll have to learn yourself. And it's arguably the best way to do it anyway. The MTA Wiki has everything you need to get started. You'd be best of to read some basics about LUA to get a grasp on how things work, then start with creating something simple for MTA - and go from there. And don't come asking for help the moment you get an error or a warning, read it, try to understand and pin-point what's causing it. Try to fix it.
-
You could use this resource.
-
Are you entirely sure this is true? I seem to recall that when a car is on fire, ramming walls and such does not speed up the progress. However, I might be wrong or it could be that only shooting it damages it while on fire.
-
I've already tried mine, so it should be working. It would be helpful if you could post all of the code. If you don't feel too keen on doing it on the forums, you can go ahead and PM me. Also, if you have any error or warnings, post those too.
-
First of all, I'd suggest you get rid of the table containing the GUI Elements which the GUI Editor created for you. And assign each element with a variable. It makes it much easier to work with your code later on. Here's how to make buttons work; mainWindow = guiCreateWindow(345, 201, 556, 442, "Will", false) guiWindowSetSizable(mainWindow, false) guiSetAlpha(mainWindow, 0.68) guiSetProperty(mainWindow, "CaptionColour", "FFD6B104") closeButton = guiCreateButton(156, 403, 246, 22, "Close", false, mainWindow) guiSetProperty(closeButton, "NormalTextColour", "FFC1A801") function exampleCode() if(source == closeButton) then guiSetVisible(mainWindow, false) end end addEventHandler("onClientGUIClick", getRootElement(), exampleCode)
-
My last reply has been tested and it should work. Something else in your code is breaking it. There are no errors or warnings in the debug at all...?
-
I believe setCameraMatrix and interpolateBetween should be enough to do what you desire.
-
Since you've got some repeating images, you should make your if statements look like this instead for it to work; function exampleCode() if (LV >= 0) and (LV <=22) then setElementData ( source, "Rankicon", ":Class\\Rank\\rank_"..LV..".png") end if(LV >= 23) and (LV <= 25) then setElementData(source, "Rankicon", ":Class\\Rank\\rank_23.png") end if(LV >= 26) and (LV <= 30) then setElementData(source, "Rankicon", ":Class\\Rank\\rank_24.png") end if(LV >= 31) and (LV <= 33) then setElementData(source, "Rankicon", ":Class\\Rank\\rank_25.png") end if(LV >= 34) and (LV <= 37) then setElementData(source, "Rankicon", ":Class\\Rank\\rank_26.png") end if(LV >= 38) and (LV <= 40) then setElementData(source, "Rankicon", ":Class\\Rank\\rank_27.png") end if(LV >= 41) and (LV <= 45) then setElementData(source, "Rankicon", ":Class\\Rank\\rank_28.png") end if(LV >= 46) and (LV <= 49) then setElementData(source, "Rankicon", ":Class\\Rank\\rank_29.png") end if(LV == 50) then setElementData(source, "Rankicon", ":Class\\Rank\\rank_30.png") end end Edit: Don't care too much about how I use the parentheses, I write it like that only to make it easier to read.
-
The number of errors are not interesting, the errors themselves are. How do you expect us to help you when you don't provide us with the errors you're getting? It's not like we're gonna sit here and guess what's wrong and why. Posting the errors would speed up the process tremendously.
-
Ah, good catch. Either way, it can be modified for that purpose as well. No need to use tables at all.
-
Get the player's Level using getAccountData, store said level into a variable - for example, LV as above. Then check if the Level is equal or greater than 0 and equal or lower than 50. If true, then setElementData like above. You're concatenating the variable into the string, so for example, if the player's level is 13: This; setElementData(source, "Rankicon", ":Class\\Rank\\rank_"..LV..".png") Would translate into this; setElementData(source, "Rankicon", ":Class\\Rank\\rank_13.png")
-
Because source for those events does not return a player element. > The source of this event is the started resource's root element.
-
Either way works, it's but a matter of personal preference. It would be of great help if you post all the errors and/or warnings you're getting. Rather than having us guess what errors you're getting...
-
What Bandi94 suggested should do the trick. And is arguably the easiest way of doing it. I don't see how the images being "repeated" matter. Since you're getting the player's level, then replacing the rank with it. So if the data returns 5, it will set the element data to rank image #5 and so on.
-
By using gsub. function Advertisment(thePlayer, commandName, ...) local players = getElementsByType("player") local playerName = getPlayerName ( thePlayer ) local chatContent = {...} for index, player in ipairs ( players ) do outputChatBox( "[[AD FROM - " .. playerName:gsub("#%x%x%x%x%x%x","").. "]] " ..table.concat ( chatContent, " "), player, 0, 255, 0) end end addCommandHandler( "ad", Advertisment )
-
It surprises me that this hasn't been added as a native function yet... It sure would allow for some neat menus or whatnot.
-
I do, but I'd have to help you later as I've got to go for a few hours now. The meta I posted above is already fixed for you. All you have to do is copy and paste it. Copy my script into a text file and save it as Music.lua inside your map folder. Move the song you want to be played into your map folder and rename it Music.mp3(Make sure it's a mp3).
-
Make sure the mp3 file is called exactly "Music.mp3" and the script is called "Music.lua". Unless you want to edit it in the script.
-
Save it as Music.lua. Add this to the Meta.xml
-
Try commenting out Line #146 as well. if source == g_Me then return end
-
If you want it to be absolutely square and not rounded, you'd either have to use a image or draw a DX Rectangle.
-
New or replace the existing one it is up to you. Whether you need to add it to the meta file or not is up to you - whether you add it as a new file or replace the old one. Either way, it has to be in the Meta. Remember that it's case-sensitive!
-
Feel free to use my code below if you'd like, it features a volume control so players can decrease/increase the volume of the song that is played. Remember the re-name the mp3 file either in the script or the file itself! Music.lua Edit: If your map doesn't show up, it might be that the Editor is bugged. It happens sometimes, try to restart MTA and open the editor again, see if it shows up.
-
Assign your playSound with a specific variable. Then get all sound elements when a map is started, and destroy all sound elements that is not yours. Example taken from my Radio;