Jump to content

Lestat

Members
  • Posts

    36
  • Joined

  • Last visited

Posts posted by Lestat

  1. https://wiki.multitheftauto.com/wiki/Se ... ounceValue

    "This function allows you to change ASE announce values for any player using a specified key. As an example this can be used to change the "score" value which will be shown at game-monitor.com's server list."

    As I understand, an Announce Value is pretty much the same as an Element Data. It has a key and it has a value. The difference is that the Announce Value can be accessed from outside the server.

    I understand the example about game-monitor.com. That one checks for a "score".

    Can you provide me other examples of where Announce Values are used or how can I use them?

  2. Unfortunately that didn't work, but I could do what I wanted to do other way. Not as good but it works :P

    Suggestion, we should be able to get the camera zoom when using sniper and camera.

  3. You can get the fov of the camera with getCameraMatrix, but the fov doesnt change when you zoom with sniper so its not that.

    the position of the camera, the player and the target (lets say other player) doesnt change when you zoom with sniper.

    So the camera doesn't move, the fov doesnt change. It has to be a zoom value. But it seems we cant get it xD

  4. Hi, I reported this bug some days ago.

    http://bugs.mtasa.com/view.php?id=8952

    It was closed as duplicate but I no issue was linked as the "original". And I searched and I couldn't find it. So I think it was closed by error. I think they thought I was reporting the "counting hex codes in chat char count", but its not about that. Its about the width of EACH character not being calculated correctly if using colorcodes. the issue provides a screenshot so you can see what I'm talking about.

    Can you give it a check, I'm sure it won't be hard to fix (unfortunately I don't know c++ but as soon as I learn I will contribute).

  5. Hi. I have upgraded my development server (for a WIP gamemode) to 1.5 Server.

    I noticed now if you use a Color code in outputChatBox (with colorcodes enabled obviously) it will add a space character automatically. I think this is undesired behaviour as we should be able to decide if we put a space character when using colorcodes.

    I will explain it better graphically:

    suppose you use this:

    outputChatBox("#FFFFFFHello #FF0000W#00FF00O#0000FFR#FFFF00L#FF00FFD", root, 255, 255, 255, true)

    In Server 1.4 it would have output this:

    Hello WORLD

    In Server 1.5 outputs this:

    Hello W O R L D

    A space character is added automatically, thats not always the desired behaviour. So kindly request to let us handle the spaces :P

    Thank you for your time.

    Forget it, I found the issue, gonna report as a bug.

  6. https://wiki.multitheftauto.com/wiki/OnConsole

    "Note: The event will not be triggered if the message can be processed by an existing command handler"

      
    function inputConsole ( text ) 
        if ( getElementType ( source ) == "player" ) then 
            --Typed by a Player 
            outputChatBox("Player C: "..text, getRootElement()) 
        else 
            --Typed by the Server Console 
            outputChatBox("Server C: "..text, getRootElement()) 
        end 
    end 
    addEventHandler ( "onConsole", getRootElement(), inputConsole ) 
      
    

    When I first created this code it worked flawlessly, the event only triggered for non-handled(non-existent) commands. But after sometime (refreshing resources, restarting the server etc), now the events triggers even for handled commands. Is it a bug? or am I missing something?

    Or maybe I imagined it and it triggered for handled commands since the start.

  7. Try:

      
    function createprog () 
        loadingprog = guiCreateProgressBar(475, 653, 330, 33, false) 
        setTimer (progress, 1000, 10) 
        setTimer (destroyElement, 10010, 1, loadingprog) 
    end 
      
    function progress() 
        curprog = guiProgressBarGetProgress (loadingprog) 
        guiProgressBarSetProgress(loadingprog, curprog+10) 
    end 
      
    

  8. I want to prevent users being able to execute commands while not logged in. (The moment they are presented with the login screen).

      
    function preventCommand(command) 
        if isGuestAccount(getPlayerAccount(source)) then 
            outputChatBox("Guest using command", source) 
            cancelEvent() 
        end 
    end 
    addEventHandler("onPlayerCommand", root, preventCommand) 
      
    

    The above code succesfully cancels commands handled in the server. But it doesnt cancel commands handled in the client. Both prints the message in the chatbox.

    Any workaround?

  9. Hi. Can someone tell me the vehicles that have 3 and 4 colors?

    This file has some predefined color ids for spawning vehicles without specifying a color:

    >> vehiclecolors.conf

    Are ALL cars listed there? only these 3 vehicles seem to have 4 colors listed:

    483 1 31 1 0

    483 1 31 1 0

    483 1 20 3 0

    483 1 5 0 0

    483 0 6 3 0

    483 3 6 3 0

    483 16 0 8 0

    483 17 0 120 0

    524 60 24 23 0

    524 61 27 123 0

    524 65 31 31 0

    524 61 61 30 0

    524 81 35 23 0

    524 62 61 62 0

    524 83 66 64 0

    524 83 64 64 0

    446 0 0 0 1

    446 1 5 1 1

    446 3 3 0 1

    446 1 22 1 1

    446 1 35 1 1

    446 1 44 1 1

    446 1 53 1 1

    446 1 57 1

    Is it safe to assume only these 3 vehicles support 4 colors, there are 0 who support exactly 3 colors and all the others are 2 colors only?

    Also, these 3 cars who support 4 colors, if I "customize" them using the admin resource, the 4th color is no where to be seen. So are they actually 3 colors only?

    As you can see in the screenshot, the 4th color (yellow) is not there.

    http://s15.postimg.org/4e2q4120p/mta_sc ... _03_22.png

    (I know the difference between color ids and rgb values, my questions are not about that)

  10. addEventHandler("onClientPlayerDamage", localPlayer, function (_, _, body, loss) 
         if body == 9 and not wasEventCancelled() then 
              setElementHealth(source, getElementHealth(source)-(loss*0.5) 
         end 
    end) 
    

    The "not" means if the event was NOT cancelled. But you want to check if it was. Also you should ensure the second EventHandler gets called after the first always. So use the priority argument (the first one is "normal" by default, so "normal-1" should work flawlessly):

    addEventHandler("onClientPlayerDamage", localPlayer, function (_, _, body, loss) 
         if body == 9 and wasEventCancelled() then 
              setElementHealth(source, getElementHealth(source)-(loss*0.5) 
         end 
    end, true, "normal-1") 
    

  11. Any way to get the World Models (objects) of default sa map?

    I want to get all models of the map of a certain Model ID.

      
        for i, v in ipairs( getElementsByType ( "object" ) ) do 
            if  getElementModel ( v ) == 1257 then 
                local x,y,z = getElementPosition(v) 
                createBlip ( x,y,z, 12 ) 
            end 
        end 
    

    This seem to get only the objects created by the gamemode .map

×
×
  • Create New...