Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. 50p

    getAccountName

    There is no need to fight over simple stuff. Copying the code? The code that author of the topic needed help with? Cool down. Don't go offtopic.
  2. You simply apply the same .txd to all the wheels. If you know the wheel ID you're replacing then apply .txd to the same ID. Creator of the mod made it this way to save the amount of files needed to be loaded. PS. Do not double post! You've sent 5 posts, one after another which is unacceptable. Be warned.
  3. 50p

    Resolved

    You're scaling the image UP 200 times of the screen size?
  4. Locked. Topic author's signature is epic. "Need help with something? Message me, and maybe I'll get back to you. And might even do it for a fair price." If you don't have a clue if data is set or not then how can you help others?
  5. I'm aware of this guys, thanks. There is a temporary link now, so you can give it a go.
  6. 50p

    EventHandler

    I forgot to reply but I've checked the source code and yes, the events are removed as well.
  7. 50p

    EventHandler

    Ideally, it would make sense if MTA removed all the references, info and actions related to that element but from the scripting side of view, it is you who is responsible to deal with such problems. I have recently heard that setTimer has problems when passing player element as argument. When player leaves and another player joins the server (before the timer finishes) that new player will be used when timer calls the specified function. Why that happens? Because MTA reuses the same address in memory for players (userdata).
  8. 50p

    EventHandler

    They do use memory since you've attached it to event but the function won't be called because before the event calls a function it gets "validated". If you're building a gamemode that will be ran 24/7 then I'd advice to remove the handler before destroying element.
  9. 50p

    EventHandler

    If the event was attached to the element that gets destroyed there is no way the function will be called because the element doesn't exist any more.
  10. function addPlayerXP(thePlayer, _, who, much) -- func definition ------------------------------------ exports.Experience:addPlayerXP(killer, xp) -- calling the function: thePlayer = killer, _ = xp
  11. 1. Make sure the file that contains the functions is shared by both server and client. Meta.xml 2. Fix the arguments when you're calling the exported functions. The parameters are different to the arguments from line 7 (client-side script sample). Tip: Don't give player money in client-side script because it will not sync with the server. Players will still have the same amount of money when you call getPlayerMoney in a server script.
  12. 50p

    about markers

    You're not helping us. What did you try?
  13. 50p

    about markers

    dxDrawRectangle. If you want to draw a rectangle in 3D then use dxDrawLine3D and make it face along +Z. Just check its parameters.
  14. 50p

    about markers

    It's not missing. There should be no "end" on that line.
  15. 50p

    Hex Color

    If you want hex as string: function RGBtoHEX( r,g,b ) return string.format( "0x%x", tocolor( r,g,b ) ); end If you want hex as number: tocolor( r, g, b );
  16. 50p

    about markers

    Check the code again. Your line must be placed in onClientRender event.
  17. 50p

    about markers

    Simply copy the function to your file. Then loop through all the markers, make them invisible (alpha=0) and draw the circle in the same spot. addEventHandler( "onClientRender", root, function( ) for _, marker in pairs( getElementsByType("marker") ) do if getMarkerType( marker ) == "cylinder" then setElementAlpha( marker, 0 ); -- make the marker invisible local x,y,z = getElementPosition( marker ); local radius = getMarkerSize( marker ); local color = tocolor( getMarkerColor( marker ) ); dxDrawCircle3D( x, y, z, radius, 24, color ); end end end )
  18. @Elengar, thanks for that. I've just checked that function on wiki and it's clear why it does that. I'll fix that. @RottenFlesh, that's what I meant. I have to run my app which then sends a request to the server to restart resource. So, I can Ctrl+B for that. I could also compile resources this way before restarting them. @ixjf, that is why there are many text/script editors; to suit everyone. I've always said that. Same with anything in the world, eg. cars. Want to go offroad? Get a 4x4 offroad car. Want to drive fast? Get a Bugatti. I appreciate everyone's opinion. Enjoy your weekend everybody.
  19. Good idea but maybe can you add detection by folder name too? For example if script is in .../client/main.lua plugin will detect it as client-side script. I will do that. It's good idea since I put my client scripts in "client" sub-folder too. Just a little update on the progress. I managed to build a plugin that will restart resource. I'll have to make it customizable so users can bind keys to run the plugin (I think the default will be set to Ctrl+B). I might change it so that resource (of which file you're editing) will restart when you save the file. But there is a huge problem.. To make it work, users will have to download and put my resource in their resources folder as well as run it and give it admin rights or at least allow it to call restartResource and startResource functions because that resource will allow Sublime Text to restart resources that users will be editing. I hope it makes sense. If it doesn't, just ask and I'll explain in details how it works.
  20. He probably wants to replace model by element. For instance, there are 5 people driving Infernuses and you see them driving different (custom) models, 1 Mitsubishi, 1 Ferrari, etc. Unfortunately, you can't replace model of elements. If you replace 1 model of ID 410, it will replace the model of all instances.
  21. Just wanted to let you guys know, I'm working on a little plugin, the screenshot should say it all: https://dl.dropboxusercontent.com/u/437 ... plugin.png If you create a .lua file anywhere in a resource folder (I'm using SideBarEnhancement plugin, I recommend it but it doesn't trigger event when file is created) and when you try to save it, my plugin will check if the file already exists inside the resource meta.xml if not then you will get this message box asking you if you want to add it. The most important thing is that if the file name starts with "c_" then file will be added as client-side script, otherwise server-side; no the file name doesn't have to start with "s_" but for organization purposes I recommend you follow this naming convention. At the moment it's exclusive to Sublime Text 3, I will try to port it to Sublime Text 2. Also, unfortunately Sublime Text doesn't trigger an event when file is renamed so I cannot update meta.xml when you rename a file. I'll will have to create a service or a hidden app that will be ran when Sublime Text starts and it will do that for me. Don't ask for release date, I will release it soon, very soon.
  22. @John Smith If you have WinRAR installed then you can put the .zip in C:\Users\\AppData\Roaming\Sublime Text 3\Packages\User\ folder and right-click the .zip and choose "Extract to 50pMTAEditor\" then the folder will be created and all the files from .zip file extracted to it. I didn't know it can be so difficult for some people, so in the future I'll have to use Package Control, which is useful plugin and allows easy installation without need to do it manually.
  23. @Controlled, Yes, you can hit TAB and it will auto-complete function name and in addition function parameter names, so you know what arguments function is expecting. I will keep it up to date but I don't know interval on how often I will run my bot. I'm basically running an application which gets all the function names from the wiki and generates the content I need for Sublime Text. The problem is it has to connect to every function page on the wiki to get all the details, no matter if I already have that function in the package or not. So, that's a killer (bandwidth-wise) for wiki to get requests from my bot for all wiki pages (that's almost 1500 functions, client and server only functions as well as shared functions). MTA team doesn't add new functions every day so that's fine, I can update it from time to time. Thanks for the comments and questions so far. I'm glad you're all liking it. Questions and suggestions are welcome.
  24. I will in the future but due to rush I thought it's not a big deal to install manually. Give more details please.
×
×
  • Create New...