Jump to content

Gallardo9944

Members
  • Posts

    442
  • Joined

  • Last visited

Posts posted by Gallardo9944

  1. First thing to do is to create a texture shader. Just a simple one which will store your interface (dxCreateShader).

    Then, you should make a render target (dxCreateRenderTarget) and draw all your interface in it (dxSetRenderTarget)

    After that, calculations come in. Your 0;0 position is mid-screen. Specify how hard you want to rotate the shader: like -15 to 15 degrees. Do some math for degrees calculation:

    local ox,oy = 0,0 -- We will use it for current offset
    	local mx,my = 15,15 -- 15 degrees for x and y position
    	local rt = dxCreateRenderTarget(sx,sy,true) --replace sx,sy with the size of the box
    	local shader = dxCreateShader(shaderfile) -- replace shaderfile with path to your texture shader
    	function updateRotation()
    	  dxSetRenderTarget(rt)
    	  -- Draw your interface here
    	  dxSetRenderTarget()
    	  dxSetShaderValue(shader,"texture",rt) -- Pass the render target to the shader
    	  local px,py = getCursorPosition()
    	  ox,oy = (px-0.5)*mx,(py-0.5)*my -- mid screen (0.5) will make 0 for ox,oy values. Others are relative
    	  dxSetShaderTransform(shader,ox,oy) -- Here goes your main magic
    	  -- And just draw your shader mid-screen here with dxDrawImage
    	end
    	addEventHandler("onClientRender",root,updateRotation) -- We wanna do it each frame, right?

    • Like 1
  2. This can be achieved by using onClientExplosion event to determine whether a rocket exploded in a player radius and then get the creator from the projectile. Then, if a player dies, check if any rocket exploded within a certain radius for last ### seconds

  3. INSERT INTO serverdata.userdata (member_name) SELECT member_name FROM smf.smf_members WHERE member_name=`??` AND NOT EXISTS(SELECT member_name FROM serverdata.userdata WHERE member_name=`??`); 
    

    This is how my one works. It clones name from another database & table if it exists and inserts row only if it doesn't exist (check last part).

  4. One connection is obviously much easier to take care of. You may create as many connections as you want, of course, but keep in mind that making a ton of connections might slow down your server (+ avoid reopening connections frequently as it may cause slowdowns).

  5. If you want to keep the weapons, save the weapons on the elementData, spawn the player, give all the weapons from the elementData, remove the elementData. You can do the same for the skin.

    Make sure that the element data is not in sync mode otherwise it will generate a lot of traffic when a lot of players die.

  6. As Wine is bad in terms of the anticheat anyway, Wine support may be dropped soon entirely. Moreover, VMWare normally provides better performance than Wine anyway, so I'd suggest you to switch to Wine immediately.

    Thanks, will try it soon. What's recommended OS for running MTA in VMWare?

  7. Hello. I'm a developer of a server and currently I'm busy making another gamemode which is almost ready for public release. I haven't done the interface yet (won't take long though), so I'm thinking about waiting for 1.5 in order to make an HTML-based one. Is it worth waiting by delaying the gamemode release? I know asking for ETAs is not polite, but in this case I think it's an exception. Are there approximate dates? Thanks.

    Also, lel. http://resources.mtasa.com

  8. Updated the github repo again.

    Changes:

    * Added more comments

    * Added /debugmode (to add a debug hook to a particular resource) (supports excluded functions)

    A little note: this is not really the way I want it to work because it doesn't get serverside functions. It will be remade a little bit later (but may affect server performance)

    * Added an option to pause the debug line with F2

    * Added a small gap between left side of the screen and the messages (so error counter shows properly)

    * Added welcome message

    FIXED A TYPO IN THIS COMMIT: https://github.com/Gallardo994/codebugg ... a378dfeb00

    Please make sure to redownload it if you got it before seeing this message.

  9. 150517140943.png

    Hello.

    When you're making a very big project and make a simple mistake, the code fails to work and it may see a huge list of errors spamming your debugstring. This small debugger is made to see errors counter instead of a huge spamlist of those.

    The latest version can always be found here: https://github.com/Gallardo994/codebugger

    (Licenced under GPL, you must provide sources if you modify the resource)

    How to use:

    1. Add it as a resource

    2. Add command.debug to your ACL

    3. /debug

    This is far not the final version and more than that, it has been made for several minutes because the original debugscript kept annoying me. Colours can be switched to your needs, same with everything else like lines amount, positioning and more.

    Currently it doesn't support many things like wordwrapping, scrolling, etc and I'm not really planning to add that as for now.

    It's my first public work and if you're not planning to use it, please don't make a mess in the comments. If you're planning to contribute, you can send your pull requests, that's always welcome.

  10. If some data isn't required to be displayed / synced all the time for every client, it's more efficient to save that stuff into tables and trigger to client when required.

    If you're scared of a lot of MySQL requests, don't worry, the server is made to work properly under high load. Sites poll MySQL very often though work absolutely fine

×
×
  • Create New...