Jump to content

Bonsai

Members
  • Posts

    1,031
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Bonsai

  1. I'm not sure how to stop sounds. If its done by destroyElement, then you just have to add something like this: elseif ( source == Radyobutton3 ) then sound3 = playSound( "***", false ) if isElement(sound1) then destroyElement(sound1) end if isElement(sound2) then destroyElement(sound2) end if isElement(sound4) then destroyElement(sound4) end
  2. Whats still the problem? When a player selects a category, you just insert all the weapons into the main gridlist. When he changes to another category, you clear the gridlist and insert the weapons of the new category.
  3. Unbelievable, I got it working! Now where I know how it works it's not complicated anymore at all. I'm just not sure about __newindex. Everything seems to work fine without it. In what situations is this being needed?
  4. yes, it's fixable, I'll ask Arezu if I may share the way with you, and if yes - i'll give you the code. Well thanks, but it's not too bad if he doesn't want to. I really want to understand how it works, especially what's causing the problem.
  5. Nooo, why or how would brackets work? I was talking about rawget.
  6. At least it seems to be fixable. Even though I'm not sure how to do what you said there.
  7. You can't use absolute values. E.g. screenW - 206, 1600-206 or 800-206, its a big difference. You have to use values relative to the size. screenw*0.9. This will always be the same position.
  8. I don't even know if this works at all. Not sure if the file has to exist the whole time. Wouldn't it be easier to keep your scripts safe? People can still take screenshots if your pictures are that awesome.
  9. fileDelete("image.png")
  10. You could also just lock your server if you don't like people. But I'd would start with file functions.
  11. Just delete the registry database in that folder where acl.xml is. But that might delete other stuff e.g. player stats too
  12. This https://wiki.multitheftauto.com/wiki/Dx ... rialLine3D and https://wiki.multitheftauto.com/wiki/DxCreateTexture and https://wiki.multitheftauto.com/wiki/GetElementPosition.
  13. Don't forget to fadeCamera to true again.
  14. You want the weapons to be sorted into their categories? Guess u have to sort them first into a table and then just add the to the Main gridlist, but only the ones that fit to the selected item. And don't forget to clear the gridlist.
  15. Ye, I found out its not the markers. Its the source. The source of that onClientMarkerHit event is always the local player. It's probably because the function that loads the script is triggered by an event and the source of that event is indeed the localPlayer. I've no idea how to get that right..
  16. What do you mean, Chat is always global. You can make it "local" by canceling and sending to certain elements and it children aka players only.
  17. Stupidest thing I've ever seen. Doesn't this make u even more lag?
  18. After some testing, I'm not sure its solved at all. When I do this environment stuff and e.g. create an marker this happens: Script of a map contains if source == marker1 onClientMarkerHit Nothing happens. I checked the userdata of the source and marker1, and they are not equal, even though its the only marker being created. I don't understand how this happened..
  19. Alright, I got it working now. Thanks to you guys.
  20. I cannot reproduce that - local variables stay in the scope of the function created by loadstring and shouldn't exist outside of it. Do you have some code that I can use to attempt to reproduce your issue? Yes, this is an alternative, but the code loaded at env will be able to access functions that were defined in the default environment, and as such, it may call these functions and cause issues. I have a map that sets a variables after u hit a marker, to make u have to follow an order. But after map restart, that variable is still set so u can just go for the last marker. I'll send u that map.
  21. Example would basically be the whole code. You need to get the cursor position and check if its on the button. Not that hard. If it's on the button u could change the alpha or something so players get a response.
  22. But if locals are not stored in the new environment, they won't be deleted after you clear that table, right? Okay, I'll try to do that. EDIT: It's working by copying the table, but clearing the table does not affect variables..
  23. https://wiki.multitheftauto.com/wiki/LoadMapData But it loads for all players.
  24. Alright, I tested loading a few different script. Turned out they all work, except the ones who contain eventHandlers. CommandHandlers or timers work fine, but eventHandlers are screwing it up. Works: env = {} env.setTimer = setTimer Doesn't: env = {} env.addEventHandler = addEventHandler Now, whats the problem here? EventHandler work fine when I'm not using setfenv. And of course I'm replacing the "onResourceStart" event. Bonsai
  25. Yeah, I know. I added all the function that are in that script like env.function. But it didn't work. I'll add this again and show it to u guys.
×
×
  • Create New...