Jump to content

Dealman

Members
  • Posts

    1,421
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dealman

  1. Use the event onClientMouseEvent, and when the mouse is over the specified GUI Element it will trigger the function, for example; Remember that you will also have to make it so it sets the Alpha back to the default when the mouse is not hovering over any of the specified elements.
  2. To modify a script, you need at the very least a basic understanding of the language it's written in. And to get a basic understanding of said language, you need to learn it. Not the other way around. I tried to modify scripts at first myself when I got into lua, but couldn't for the love of god understand anything. So I decided to start at the bottom and work my way up, and it has yielded me great results so far - gotten way further than I thought I would. And regarding you using leaked scripts, this forum does not give support of any description when the subject at hand is a leaked script - like this one seems to be.
  3. Make sure that the path to the file is correct and you didn't make a typo. Also, check to make sure that the mp3 file is not corrupted - and at last, remember to restart the resource after every change you make. So long as the file exists in ResourceName/sound/ it should be working. Also, there's no need to set the volume to 1 since that is the default value anyway.
  4. When something is quoted, such as "true" - it becomes what's known as a string. A boolean is a value of either true or false. So in this case, change "true" to true.
  5. It says "any ingame GUI (rendered by CEGUI).", and as such it will only make it so that DX Drawings are rendered on top of other GUI Elements. The way DX Drawings work in MTA is based on the order, for example; Try adding this to your script and move dxDrawText and dxDrawRectangle around and you'll see how it behaves.
  6. Yeah I wrote it out of memory so might have missed something, sorry about that Glad you got it sorted at least
  7. When the commands are entered, use triggerServerEvent in which checks if the player is an Admin or not, with isObjectInACLGroup. If the Player's an Admin, then use triggerClientEvent to trigger the functions duty and offduty. Client-Side: Server-Side:
  8. I'm not entirely sure if this would work but you could try to use onClientExplosion to detect the explosion, and cancel the event. Thus, the explosion won't occur. Get the co-ordinates of where the explosion would have occured, and use createExplosion to create a new one, and set the parameter makeSound to false. Then the created explosion will not use a default sound - and you can play your own sound instead. I haven't tried it but I don't see why it wouldn't work. Edit: Couldn't help but to try this myself, and it sort of works - just that the sound is a bit awkward. This checks if the explosion was a Rocket, and if it was - it will cancel the explosion, replace it with a new one without sound and then play a custom sound effect at that location. Edit2: You can use setSoundMaxDistance to play around with the max distance of the sound, I found a value of 100 to be rather nice. Hope this suits your needs!
  9. Thank you, will fiddle around with it a bit and see if I can get it to work!
  10. Would Mr.Castillo perhaps be so kind to provide me with some example? As I said, I'm new to downloading files like this through MTA, am not entirely sure as to how fetchRemtoe works... I have all the files in the one same resource, but with a folder structure, would it be possible to fetch a specific file/folder within that resource using fetchRemote...? Would that even work? Since the file(s) need to be saved on the Client? In either way, wouldn't fetchRemote be a better approach?
  11. Hello, I've started working on a GUI to make changing vehicles client-side easier and I have a rather big variety of models and textures as of now and the total size of the resource is starting to get rather big. I'm wondering if there's some kind of way to have the client download a specified file within the resource from the server on demand, for example: If the player selects Infernus 1, it would have to be downloaded first. As such, the client would be able to only download the ones he'd like instead of every single one. I know there's fetchRemote, but I don't think that is quite what I need. I'm new to this whole downloading stuff within MTA so any kind of help would be greatly appreciated. If this is not possible, what would be the most efficient way to go about things? Would I need to make a separate resource for every different model and then use call? Edit: I know of downloadFile, but of course it's not to be released until MTA 1.4
  12. I had this exact same problem on our new server, seems like it's some weird bug as it does not output any warnings or error messages of any description. I never checked the actual code to see if something was missing. I managed to fix this however, I simply downloaded MTA SA again and selected it to install nothing but the server, in a folder I specified. I then took the admin resource from this and replaced my old one with this. They were both the same version, 1.3.1 I believe. It has worked so far, not sure why...
  13. Read about these isPedInVehicle warpPedIntoVehicle
  14. Try this, I have not tried it myself though. Client-Side: Server-Side:
  15. Do you mean that it does not have collision? Scaling objects does not scale the collision.
  16. Because the variable is set as GUIEditor.window[1] not window. function showGUI() if(guiGetVisible(GUIEditor.window[1]) == true) showCursor(false) guiSetVisible(GUIEditor.window[1], false) else showCursor(true) guiSetVisible(GUIEditor.window[1],true) end end bindKey("F2", "down", showGUI) Personally I'd suggest that you rename each and every variable for the GUI Elements. You can also get rid of this unless you want it to be stored in tables; GUIEditor = { button = {}, window = {}, staticimage = {}, label = {} }
  17. Open the Admin Panel(P) and go to Resources, search for Scoreboard and click the Settings button. You'll see a setting for colour-coded names, change false to true and restart it. And it should work.
  18. Dealman

    help meta

    You're trying to close what you have already closed; <file src="example/example.txd"/></file> Should be... <file src="example/example.txd"/>
  19. So a while ago I made this GUI for a team I'm part of, where as it utilizes a gridlist where you can mute/unmute and remotely set the channel of other players, however, while it was working fine on my local server when we tested it with 3-4 people it does not work on their server. You can mute other players using the GUI, but they are automatically unmuted again after a few seconds and I can't for the love of god figure out why. And looking at the Voice Resource, I also managed to find this; And this is the code I use for server-side muting; Is it not working because I'm using what I assume are outdated functions? I don't know which functions else to use for this, looking at the Voice Resource, there's addPlayerMutedBy and setPlayerVoiceMuted. Is setPlayerVoiceMuted the function I should use? I assume addPlayerMutedBy is the client-side muting where as for example you use the scoreboard to mute a specific player? Any help would be greatly appreciated!
  20. Dealman

    GUI Bug.

    Oh sorry, I thought you still had issues with it
  21. Dealman

    GUI Bug.

    Because you're not isolating it. You're simply checking if left-mouse button is clicked. You'll need to find a way to make sure that the mouse is being clicked on the staticimage. I haven't actually done this before myself, but it might be possible to use onClientGUIClick and then make it like; if(source == staticImageHere) then
  22. See the problem? Client tries to trigger onLoadedAtClient, but this event does obviously not exist server-side. Though this might be because you didn't post the entire script. You have also bound F4 twice. Example(I have not tested it. Not guaranteed to work.): Client-Side: Server-Side:
  23. I don't believe that is quite what I want... onClientProjectileCreation has a parameter for the creator, which I believe would be used for the "You were killed by..." message. The problem though is that I can't find a way to recognize when a player was killed by a projectile... I've also tried onClientPlayerDamage but to no avail. It might just be that I'm doing it entirely wrong
  24. I've been working on a new shooter script for a while and so far all is good, however I'd like to be able to output messages. For example if you shoot a rocket, and manage to hit a player which kills him, you'd receive a message "You killed Player 2", where as Player 2 would receive a message "You were killed by Player 1". So far I haven't been able to accomplish anything. I've tried using the events onClientPlayerWasted as well as onClientProjectileCreation but I couldn't find a way to make it work. Does anyone have any good pointers as to how to go about to achieve this? If so, that would be greatly appreciated!
  25. Dealman

    Question

    What Pres is saying is that while you have the GUI Editor open, you'll need to right-click each GUI Element such as a Window or Button and change it from Absolute to Relative. And then output your code and copy that. You'll see it uses a scale from 0-1 related to the parent element(I think) instead of X and Y co-ordinates.
×
×
  • Create New...