Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. Why don't you read the tutorial about GUI? You know where to learn from now. The center of the screen is just a simple math calculation which you should already know about... screenSize = { guiGetScreenSize() } -- make a table which is the size of player's screen, width -> [1], height -> [2] local centerOfScreenX = screenSize[ 1 ] / 2; local centerOfScreenY = screenSize[ 2 ] / 2; -- take a note of size of your image you want to display, eg. 100x200 -- and get the center of it or rather get half of its dimensions local centerOfImageX = 100 / 2; local centerOfImageY = 200 / 2; MYIMAGE = guiCreateStaticImage( centerOfScreenX - centerOfImageX, centerOfScreenY - centerOfImageY, 100, 200, "IMAGE.png", false ) -- hide: guiSetVisible( MYIMAGE, false ); -- make it underneath everything: guiMoveToBack( MYIMAGE ) READ THE WIKI AND TUTORIALS IF YOU HAVE QUESTIONS REGARDING SUCH THINGS. Most of the functions names are self-explanatory.
  2. Use this instead: triggerClientEvent ( "showRedWinImage", getRootElement() ) And don't use this in for loop because that's just slower.
  3. I'm 100% sure this will help you: https://forum.multitheftauto.com/viewtop ... 91&t=25032
  4. ... OK, https://wiki.multitheftauto.com/wiki/Debugging
  5. The reason why it doesn't work is probably this: https://forum.multitheftauto.com/viewtop ... 00#p289183
  6. Because there are people like you who know how to use "Search" feature! lol
  7. =================================================================== Besides, your ped model ID is located at index 5 not 4.
  8. You can try MTA:Script Editor and help to improve it by reporting bugs.
  9. Either toggleVehicleRespawn or setVehicleRespawnDelay doesn't work properly. The best way to respawn vehicle after it explodes is to set a timer which will respawn the vehicle in onVehicleExplode event. https://wiki.multitheftauto.com/wiki/RespawnVehicle (the example shows exactly what I described)
  10. Join FREESTATEPROJECT server and you'll get drunk.. also driving cars is harder, not to mention flying helis.
  11. I will probably let users to add their own extensions in the future but for now I'll stay with .lua and .xml. I made the "profiles" feature so that user can change colours to his liking not for other extensions. It doesn't work yet as many other options in options window.
  12. - Oh, I know it doesn't save files that weren't added to any resource that's because of the way I open files. - What did you mean by "after trying to change my profile settings"? Your PC profile? And what settings? - MTASE is not stored in registry yet. MTASE supports XML files as well. That was mainly to let users change their map files manually.
  13. Debug your script. Check what setElementVelocity and getElementVelocity return.
  14. 50p

    Object - Camera

    They can't send you here simply because the plugin doesn't support MTA functions. You better start using MTA and learn Lua from our wiki. You will make scripts that are not possible in SA-MP. BTW, what does SA-MP camera bug has to do to MTA? It's just wrong.
  15. First you need to learn Lua. Just because you can do it in Pawn doesn't mean you can do it straight away in Lua. All you need to do is learn the basics of Lua and make simple scripts from scratch. You aim too far for your skills in Lua.
  16. Have a look at this and some screenshots: https://community.multitheftauto.com/index.html?p ... ils&id=347
  17. http://www.lua.org/pil/2.5.html -.-'
  18. The point of this function is not to add it to command handler but call it from anywhere. You can call this function from onClientMarkerHit for example to start the countdown.. Or you can call this function when player dies to tell him how long until he respawns.
  19. LEAVE THE COUNTDOWN FUNCTION ALONE! DO NOT MODIFY IT UNLESS YOU KNOW WHAT YOU'RE DOING! From what I see you don't know what you're doing. Your code will not work... What's the purpose of Countdown function? It starts countdown and takes only 1 parameter. I was hoping you can add command handler function yourself easily but it seems to be headache for both of you. addCommandHandler( "countdown", function( _, secs ) secs = tonumber( secs ) if secs then Countdown( secs ) end end )
  20. I never asked you to add Countdown function inside onClientResourceStart... It will still not work because you don't have a command.
  21. First of all, I haven't added any commands there. You have to add it yourself. Second of all, guiCreateStaticImage doesn't hide the image after it's created... You must hide it yourself with guiSetVisible. Besides, image shouldn't be created outside a function (move it inside a function that is called when resource starts or somewhere else). Last but not least, debug your script.
  22. I've started making one long time ago but couldn't figure out why it stops rendering after loading cgui.dll up... There is no MTA Developer that knows why at least that's what they said when I asked them on IRC. If there is anyone that wants to help me, feel free to do so with my source code (it's C++): http://scripteditor.beta.mtasa.com/file ... or_src.zip I'm including here binaries if you can't compile it yourself: http://scripteditor.beta.mtasa.com/file ... Editor.zip As I said, I started making it pretty long time ago when MTA went open source, so the "CGUI..." classes and cgui.dll are old but that doesn't mean it's the cause of stopping DirectX from rendering since it worked with MTA. There are following features: - change resolution of rendering window (from 640x480 to 1680x1050) - loads cgui.dll from "File" menu - context menu (right-click menu) on "black screen" which is meant to let user create GUI elements quickly (it's useless since cgui.dll doesn't initialize at all) I'll say it again, MTA Developers weren't able or willing to help me and I got pissed off after a few weeks of trying to fix it.
  23. If your array is small (say, 1 - 4), you can loop through it but it's not good idea to do so. Just send the array with 1 call.
  24. If you're planning to make your own countdown script with GUI then I'll give you some advice before you start: - Use 1 "static image element" and use guiStaticImageLoadImage instead of creating 4 images and showing/hiding them whenever needed.. this doesn't just save bandwidth but also memory where images are stored in - make 1 function that starts the countdown and counts down by itself. The less code your client-side script has the more bandwidth you save and shorter download time is. Take this as a sample: -- create your image (any image, can be "images/0.png") IMAGE = guiCreateStaticImage( ........ ); -- put your own arguments here -- call this function to start countdown, eg. Countdown( 3 ); function Countdown( seconds ) guiStaticImageLoadImage( IMAGE, "images/" .. tostring( seconds ) .. ".png" ); guiSetVisible( IMAGE, true ); if ( seconds > 0 ) then -- do we need to continue countdown? setTimer( Countdown, 1000, 1, seconds - 1 ); -- call this function again in 1sec. with decreased value of "seconds" else CountdownFinished( ) end end function CountdownFinished( ) --[[ DO WHATEVER YOU WANT HERE WHEN COUNTDOWN ENDS... YOU CAN HIDE THE IMAGE ]] guiSetVisible( IMAGE, false ); -- OR SHOW "GO!" for a second or 2 guiStaticImageLoadImage( IMAGE, "images/go.png" ); setTimer( guiSetVisible, 2000, 1, IMAGE, false ); end
×
×
  • Create New...