Jump to content

DiSaMe

Distinguished Members
  • Posts

    1,461
  • Joined

  • Last visited

  • Days Won

    34

Posts posted by DiSaMe

  1. I don't understand this either. After all, function cannot be "local" or "global", it's just a value which, like any other value, can be stored in local and global variables.

    A function can be made local, look at this example:

    local function testFunction () 
      
    end 
    

    Each function you create without the 'local' will automaticly be created as a 'global' function. I have no idea what's the exact difference between them but there is something haha. Maybe it's because of the scope for other files, but not sure if this is because of the OOP version of LUA...

    That's wrong. Every value can be accessed from anywhere it is passed to. All I can see in your example is that you're creating a function and storing it to a local variable 'testFunction'. Yet, I don't see such things like "local" or "global" values, no matter if they're numbers, strings, tables or functions. The line 'local testNumber = 1' doesn't create a "local number" either.

  2. Only low LOD (level of detail) objects can be seen from long distances. You need to create another object and set it as low LOD counterpart of existing object using this function:

    setLowLODElement 
    

    When objects become invisible because of long distance, low LOD objects become visible.

  3. showCursor 
    

    toggleControls: A boolean value determining whether to disable controls whilst the cursor is showing. true implies controls are disabled, false implies controls remain enabled.

    And even if there was no such argument, there's still a function setControlState which can make you walk.

  4. [CSG]NOki, you seem to find the problems in the script when they're actually not in there.

    If client-side functions do not work (but other functions do), then the script is clearly server-sided, which is either specified explicitly in meta.xml or not specified, in which case MTA uses it as server-side script by default.

  5. .:HyPeX:., don't write if you don't know.

    KRZO, if you need to sync data (such as money), you need to use the element data or custom events:

    setElementData 
    getElementData 
      
    addEvent 
    addEventHandler 
    triggerClientEvent 
    

    In case of element data, whatever you set (using setElementData) on server or any of the clients, becomes visible for everyone (unless you choose not to sync it using the 4th argument of setElementData), so that the data can be retrieved using getElementData.

    As for events, you can create an event on the client using addEvent, then add the handler using addEventHandler, and when you call triggerClientEvent on the server using the same event name, the handler function will be called on the client with the same parameters which were specified in triggerClientEvent.

  6. replies within 10min

    Replies about useful suggestions within 10 min, because SA-MP has more useful suggestions, since many things people suggest to make MTA are actually already there, such as your suggestions in this topic.

    low system requiements for hosting server, free gamemodes, filterscripts, scripting help on there forums

    When you say SA-MP is better, you're supposed to say things which SA-MP has and MTA doesn't...

    fair administration team

    Hahahahaha. Funny joke, man. Do you realize how they would react to discussion like this on SA-MP forums?

    many players

    Argumentum ad populum. Considering the brainwashing (such as lying to newbies who don't know which program to choose) done to make SA-MP player count as high as possible, this is a strong argument against SA-MP.

    simple register system

    When you say SA-MP is better, you're supposed to say things which SA-MP has and MTA doesn't... Oh, by the way, MTA allows designing GUIs, and it has always been that way, not like SA-MP, where all you can use is what's already done. Though I've seen a GUI designed using textdraws or something like that on SA-MP, it's not nearly as flexible as MTA GUI because of server-only scripting.

    with the new update my ping has gone down a bit

    Who cares about numbers? Who cares how much time the signal goes forth and back if it's still as laggy as it can be? I once tested the smoothness of player movement on SA-MP and MTA, and SA-MP with ping of 50 ms was lagging as much as MTA with 200 ms. That was back in the days when MTA didn't have as many lag reduction techniques as it has now.

    Deep down in your hearts you know samp is way better

    With all your "arguments" destroyed, this phrase becomes nothing but faith. You can say "I can feel it in my heart", "you just have to believe it", "many people say it's true, therefore it's true" or "this book says it's true, therefore it's true", but statements without evidence are useless.

  7. All logical arguments are useless in debates against SA-MP fanboys. SA-MP is SA-MP, MTA is not SA-MP, therefore SA-MP rules and MTA sucks. That's it - assumption that SA-MP is better will always lead to the conclusion that SA-MP is better. Although it's possible to use objective reasoning and consider the fact that SA-MP lacks many possibilities compared to MTA, what's the point of trying to find the facts when you can rely on faith? The advantage of logic is that it helps you find the truth. Rejection of evidence, on the other hand, has much more important advantage: it lets you believe whatever you want, no matter how much proof shows you're wrong. Faith will never let you down :)

  8. Apart from missing commas and usage of variable before it is assigned the function value, this line hardly has any meaning:

    local dxDraw3DText = exports.3D_DX_Texts:dxDraw3DText 
    

    This syntax:

    table:method(arguments) 
    

    is another way to write this call:

    table.method(table, arguments) 
    

    So it's not like 'table:method' has any meaning without a call.

  9. Coordinates have to be put in the correct order. x1 and x3 should be less than x2 and x4, y1 and y2 should be less than y3 and y4. So the code shoud look like this:

    createWater(613, -294, 12, 635, -294, 12, 613, -229, 12, 635, -229, 12) 
    

  10. That wouldn't work, savePedStats and loadPedStats wern't defined at the time they were called. Therefore, savePedStats would return nil

    Wrong, they are defined by the time they are called. No matter where you put the function, it is called when it is called.

  11. if attacker == localPlayer then 
    

    Therefore the rest of the function is only executed if local player is the one who inflicted damage. And since client-side scripts can only control the health of local player, this results in script actually taking effect if player causes damage to himself/herself.

  12. I didn't confuse you in the first place. Your mind confused you because it tricked you into believing you see DX rectangles, text, images and lines. What you see is actually lots of pixels with various colors on the screen. When DX drawing function is called, colors of some pixels are changed and your mind interprets these combinations of colors as distinct elements, while in MTA, nothing is created. So if you don't want DX drawings to be visible, simply don't draw them when they shouldn't be visible.

  13. There are no DX elements. Such things like "DX elements" do not exist. Therefore they can't be created/destroyed/moved/hidden/linked/whatever. DX drawing functions do exactly what their names say: they draw, that means, the function call changes the colors of some pixels. This change is visible for one frame because all pixels on the screen are cleared, so whatever the function drew is already gone the next frame.

×
×
  • Create New...