Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. Explain a little bit more your case. If it's a bug we'll forward it to the devs. Also, don't forget to make a report on http://bugs.mtasa.com
  2. tempLabels = { }; -- create table of lables that correspond to edit boxes function updateLabels( ) -- create function which will be called when edit box will be change (text input) guiSetText( tempLabels[ source ], guiGetText( source ) ); -- set the label text to the same text as the edit box end beleppanel = guiCreateStaticImage( (screenX-349)/2, 260, 349, 229, "kepek/belepespanel.png", false ) felhasznalo_edit = guiCreateEdit(177 ,52 , 150, 18, "", false, beleppanel) guiSetAlpha ( felhasznalo_edit, 0 ) tempLabels[ felhasznalo_edit ] = guiCreateLabel( 177 ,52 , 150, 18, "", false, beleppanel); -- create first label for edit box guiMoveToBack( tempLabels[ felhasznalo_edit ] ); -- move the label below the editbox jelszo_edit = guiCreateEdit(177 ,72 ,150 ,18 ,"", false, beleppanel) guiSetAlpha ( jelszo_edit, 0 ) tempLabels[ jelszo_edit ] = guiCreateLabel( 177, 72, 150, 18, "", false, beleppanel); -- create another label for the next edit box guiMoveToBack( tempLabels[ jelszo_edit ] ); -- move the label below the editbox addEventHandler( "onClientGUIChanged", jelszo_edit, updateLabels, false ); -- whenever jelszo_edit text is changed then call updateLabels function addEventHandler( "onClientGUIChanged", felhasznalo_edit, updateLabels, false ); -- same here You may have to play with the location of the labels to make sure they align with the caret (the line you showed on the screenshot) and the edit boxes themselves.
  3. Do you get any warning messages? Check the debug window (/debugscript 3). If your progress variable is not set then you're probably getting an error message.
  4. You're doing it almost right. Just move the interpolateBetween before you draw the image and use the returned values but don't use the same variable names like a and b because these are the returned values you want to use in dxDrawImage.
  5. Want to steal a compiled script? Go somewhere else. Locking the topic.
  6. What line and what error are you getting? There is nothing at line 27 that would make any sense. You're not helping us to help you. You just make it difficult for us to find the problem. The code looks fine to me except for that targetPlayer. onClientRender does not pass any arguments to the handled function so targetPlayer will always be nil.
  7. It's client-side code then why do you use it server-side? What does the line with getElementHealth do? You don't even assign its return value to a variable and you pass another argument even though that function only need the element whose health you want to get. What is targetPlayer at line 25?
  8. I've worked some time on my own model importer and so far it works fine but it only supports static models (no skeleton/animated models are supported). I've also read up on .img file format and it's pretty easy so I also made an .img archive viewer that will also let users import the models straight from the .img files (no need to export the model from .img archive with Spark or IMG Tool before importing to 3DS Max). It's in very early stages so no release date known yet. I'm also thinking of a TXD material in 3DS Max for models, so that users could texture their model within 3DS Max and export the .txd as well as .dff. Last but not least, I've researched the .col file format as well and made a script to import .col files, works fine too. I made a short video showing only one of the scripts, which is .img viewer, so enjoy (watch on YouTube for 1080p quality):
  9. You can't just put the top players out of nowhere. You need to save the stats somewhere and then load them to show the "top" players. I suggest you use element data to store the top players temporarily and save them to SQL or MySQL database from time to time eg. 10 minutes, when they log out or quit the server (when player leaves his element data stats will be lost so they need to be saved somewhere). It all depends how other scripts work if you have them. If you don't have any scripts that track/save players' stats then you won't be able to show these players in the edit box. Like I said earlier, you have to save the stats first before you can show them. Also, when you're posting an error make sure you copy the exact message and at which line it occurred.
  10. If you fade the camera out then what did you expect? Debug the script to find out when it fades out and when it should fade in.
  11. 50p

    unbindkey help

    I'm not talking about his code but his method. You have to declare the function first and then bind it to a key so then you can unbind it. His code will work properly since first he's setting gui visibility to opposite visibility state (if it's visible, not will make the return value: false = invisible), then he's getting the gui element visibility state to set the same to cursor. So, eg: hiding the gui first, then using the same visibility (guiGetVisible @ line 3) to cursor so hiding the cursor too.
  12. 50p

    unbindkey help

    There is not already when defining the variable. The problem here is that you can't unbind anonymous functions. You can do what {RoG}xXMADEXx suggested. This way you can use: unbindKey( "F4", "down", windowAdjusting );
  13. 50p

    Is this possible

    MTA uses highly modified CEGUI library. Many UI properties are ignored by MTA and as far as I know rotation is one of them. If you want to rotate UI elements then you would have to draw them yourself on a new render target which can then be drawn with dxDrawImage. As you may know dxDrawImage lets you rotate drawn image or render target. https://wiki.multitheftauto.com/wiki/Dx ... nderTarget
  14. Instead of using setCameraMatrix I'd suggest to create fake explosion underneath the player. https://wiki.multitheftauto.com/wiki/CreateExplosion bool createExplosion ( float x, float y, float z, int theType [, bool makeSound = true, float camShake = -1.0, bool damaging = true ] ) When calling this function pass false as makeSound argument and damaging as false. This way player will not get damaged by the explosion and there won't be any sound but camera will shake.
  15. You just copy and paste some random code not explaining what you need help with so don't expect people answer if they don't know the question.
  16. That's probably why it shows you the warning message. Remember, ALL players are peds but NOT ALL peds are players. You should use the other variant of the function and if it needs to follow the ped then you'll need to use onClientPreRender.
  17. If it works when you're using the command then you can call this function from onPlayerQuit event. addEventHandler( "onPlayerQuit", root, function( ) onExit( source ); end )
  18. Better way is to use tables instead: local vehs = { createVehicle( ... ), createVehicle( ... ) }; for _, veh in pairs( vehs ) do local x,y,z = getElementPosition( veh ); outputChatBox( x .. ", " .. y .. ", " .. z ); end If you really want to get variables by their names you can use global table (_G) but I do not recommend it because in some cases this will return nil: local veh1 = createVehicle( ... ); outputChatBox( "Vehicle name: " .. getVehicleName( _G["veh1"] ) )
  19. You can see but you can't hear. The topic name says it all SFX (sound effects). @krischkros, I like the sounds personally. I like Windsor's best. Bullet's sound is a bit too quiet and sounds like if it was inside a box.
  20. That's the only way to do it. You need to know the offset positions and then it's as easy as adding GUI position to the offset of the rectangles. It's like adding any other child GUI elements to a window, they also take offset positions not absolute screen coords. There is no rocket-science maths involved, just simple addition: (windowX + offsetX) (windowY + offsetY).
  21. https://wiki.multitheftauto.com/wiki/On ... abSwitched
  22. @ciber, the whole point is to use the sprite image. Since you can't simply draw .gif animation in MTA I made this sprite animation library. As you can see in the video I switch between sprites.
  23. I made an separate tool to generate sprites from gifs as well to help you out: viewtopic.php?f=108&t=49179&p=482290
  24. If you're storing data in element in "invincible" key then check it in onClientRender then draw the text (dxDrawText is what you asked about and what you should use in onClientRender event). addEventHandler( "onClientRender", root, function( ) for _, plr in pairs( getElementsByType( "player" ) ) do -- iterate through all players if isElementOnScreen( plr ) and getElementData( plr, "invincible" ) then -- check if player is on screen, then draw the text or an image -- dxDrawText or dxDrawImage -- you'll need to use getScreenFromWorldPosition to get the screen position (X and Y coords) of the player (getElementPosition or getPedBonePosition) end end end, )
  25. You can't make floating ped dance in mid air because the ped will start falling and the animation you set will be canceled. You need to create something underneath the ped so that he/she can stand on and dance. That's what I did in my spawn script check the source code if you need to: https://community.multitheftauto.com/in ... ls&id=1152
×
×
  • Create New...