Tails

Members
  • Content count

    688
  • Joined

  • Last visited

  • Days Won

    2

Tails last won the day on January 17

Tails had the most liked content!

Community Reputation

91 Popular

5 Followers

About Tails

  • Rank
    Crime Partner

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Tails

    Youtube + createBrowser

    Are you supplying the video file through the resource meta? if so, you don't have to worry about it. the resource will only start once the download has finished. Otherwise if the browser is not a local browser then there's no way to know if something has finished downloading.
  2. Tails

    Make class with methods in it?

    @sanyisasha, check out bakagaijin: http://anirudh.katoch.me/project/bakagaijin/ I think this is as close you will get to interacting with other scripts in an object oriented way. I've used it before in one of my projects and it worked pretty well.
  3. Tails

    Give me a level system

    This is no place for a beggar like yourself. I advice you to look somewhere else.
  4. Very nice Loki! Hopefully this will help out everyone who needs help setting this whole thing up. It's not an easy thing to do if you're completely new to all of this.
  5. Tails

    Lod, objects and distance

    You need to make a separate LOD object for every object. https://wiki.multitheftauto.com/wiki/SetLowLODElement Here's an example: local obj = createObject(id, x, y, z, rx, ry, rz) local lodObj = createObject(id, x, y, z, rx, ry, rz, true) setLowLODElement(obj, lodObj) engineSetModelLODDistance(id, 300)
  6. Use https://wiki.multitheftauto.com/wiki/OnClientGUIChanged it will trigger whenever someone is typing in an editbox. If you want to constantly check if someone is typing then use the focus and blur events like MIKI suggested.
  7. Tails

    passing a player in triggerServerEvent

    When a client triggers a server event a hidden variable called 'client' is passed in the event. triggerServerEvent("blabla", bla) -- server addEvent('blabla', true) addEventHandler('blabla', resourceRoot, function(bla) print(bla, getPlayerName(client)) end)
  8. Tails

    [HELP] GridList

    @SSKE The scrollbar is part of the gridlist, it shows up when there are more items than can be shown.
  9. Tails

    [HELP] GridList

    http://static.cegui.org.uk/static/WindowsLookProperties.html#ForceVertScrollbar guiSetProperty(gridlist, 'ForceVertScrollbar', 'False') I think that should do it.
  10. Tails

    Outlined text

    You can use render targets perfectly fine. They aren't rendered to the screen they are rendered to a new texture at run time. The image is the only thing that's being drawn to the screen. So, you could have a 100 draw functions and render it to a single texture and only draw that texture to the screen with dxDrawImage. The reason your text became blurry with render targets is because you were either stretching the image or the positions/dimensions were off. Take this simple object oriented approach and you'll have an easy to use function. It works similar to the CEGUI functions except that you're responsible for drawing it, although you could make the function handle that as well. function dxCreateFramedText(text, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI) local self = {} local rt = dxCreateRenderTarget(width, height, true) self.draw = function(x, y, w, h) dxDrawImage(left, top, width, height, rt) end self.update = function() dxSetRenderTarget(rt, true) dxDrawText(text, 1, 1, width + 1, height + 1, tocolor(0, 0, 0), scale, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, 1, -1, width + 1, height - 1, tocolor(0, 0, 0), scale, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, -1, 1, width - 1, height + 1, tocolor(0, 0, 0), scale, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, 1, 1, width - 1, height - 1, tocolor(0, 0, 0), scale, font, alignX, alignY, clip, wordBreak, postGUI) dxDrawText(text, 0, 0, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI) dxSetRenderTarget() end self.setText = function(v) text = v self.update() end self.setColor = function(v) color = v self.update() end self.update() return self end local msg1 = dxCreateFramedText("Hello there",222,300,520,140,tocolor(0,255,0),3,'default','left','top',false,false,false) local msg2 = dxCreateFramedText("How are you?",222,400,520,140,tocolor(0,255,0),3,'default','left','top',false,false,false) addEventHandler('onClientRender', root, function() msg1.draw() msg2.draw() end) msg2.setColor(tocolor(0,255,255)) addCommandHandler('c', function() msg1.setColor(tocolor(255,99,0)) end) It may look a little over the top but yeah, it works, and it's fast.
  11. Tails

    Outlined text

    You can pre-render everything with a render target and then draw it with a single dxDrawImage An example: local text = dxCreateRenderTarget(width, height, true) dxSetRenderTarget(text, true) dxDrawText ( message , left + 1 , top + 1 , width + 1 , height + 1 , tocolor ( 0 , 0 , 0 , 255 ) , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxDrawText ( message , left + 1 , top - 1 , width + 1 , height - 1 , tocolor ( 0 , 0 , 0 , 255 ) , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxDrawText ( message , left - 1 , top + 1 , width - 1 , height + 1 , tocolor ( 0 , 0 , 0 , 255 ) , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxDrawText ( message , left - 1 , top - 1 , width - 1 , height - 1 , tocolor ( 0 , 0 , 0 , 255 ) , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxDrawText ( message , left , top, width, height, color , scale , font , alignX , alignY , clip , wordBreak , postGUI ) dxSetRenderTarget() addEventHandler('onClientRender', root, function() dxDrawImage(left, top, width, height, text) end) It should be pretty easy to understand. If you need help putting it in an easy to use function let me know.
  12. Tails

    Transparent Editbox

    You can set the alpha property with setProperty: local edit = GuiEdit(200, 200, 200, 30, '', false) edit:setProperty('Alpha', 0.5)
  13. Tails

    Question about guiCreateEdit

    Use this https://wiki.multitheftauto.com/wiki/GuiEditSetCaretIndex with onClientKey
  14. Tails

    Ground Position (server)

    You can make a function on the client side and trigger it using a custom event. Then you trigger another event on the server that receives the ground position. An example: -- client side addEvent('getGroundPos', true) addEventHandler('getGroundPos', resourceRoot, function(x, y, z) triggerServerEvent('onGetGroundPos', resourceRoot, getGroundPosition(x, y, z)) end) -- server side addEvent('onGetGroundPos', true) addEventHandler('onGetGroundPos', resourceRoot, function(groundPos) print(groundPos) -- continue your function here end) The only bad thing about this is that you always need a player nearby to get the ground position but there's no other way around it as far as I know. You may also need an additional check to make sure the server event is only triggered once, if you have multiple players on your server then it gets triggered by every player.
  15. Tails

    [HELP] How to do action with every array element

    @Randesady I know you fixed it already but your example works if you remove the return false statement and the return true in the else block. When you return something within a loop you'll also break the loop so that's why it never goes past the 1st iteration.