Jump to content

Dealman

Members
  • Posts

    1,421
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dealman

  1. You haven't spelled the functions correctly. engineLReplaceModel -> engineReplaceModel engineSetModelLoadistance -> engineSetModelLODDistance
  2. ...If you were a "pro" you'd know how to make it fit for all resolutions, it's nothing but very basic math, really
  3. Dealman

    Help me!

    function rules () rulestxt = fileOpen("Rules.txt", true) rulestxt1 = fileRead(rulestxt, 50000) guiSetText(helpmemo, rulestxt1) end addEventHandler("onClientGUIClick", Rules, rules) And what exactly is Rules supposed to be? From what I can tell it's not defined. Also use debugscript.
  4. Pretty sure it's just meant to make the bass a little bit louder in San Andreas, at least in the original. Whether it works in MTA or not - I can't answer.
  5. Umm, I think there's already a resource that lets you do this - so you'd be best off looking at that I guess. I don't know whether it's compiled or not. Personally though, I'd probably attach something like a collision box or cylinder to each tree, and check if a player is near it. If a player is near it, then check if he's wielding a chainsaw. If he is wielding a chainsaw, then you can check whether the player is performing a certain action and/or animation. If all of the above are true, you can do whatever you want. Decrease the "health" of the tree or simply make it fall over.
  6. You'll probably want to edit the maxVelocity flag through setModelHandling or setVehicleHandling.
  7. You're trying to bind the key server-side, so obviously you need to tell the server what player should bind the key. You can't just assume that the server will magically know what you want. You need to define "player", it is returning nil because it's empty - it doesn't contain anything. You'd be better off doing this in a client-side script instead; function testFunction() showCursor(not isCursorShowing()) -- Toggles between true and false end bindKey("X", "down", testFunction)
  8. Chaos is right, I believe getSoundBPM scans through the entire file - from start to finish(hence the lag when you use this function). And as there is no actual end for streamed files, you can't get the BPM.
  9. Dealman

    Come on

    You already made a thread about this, the function you want to use is addPedClothes. You have a few examples in there as well as links to the clothing IDs.
  10. Why not just use xmlNodeGetChildren instead? It returns a table, so you can just count the number of entries in the table.
  11. If it shows up as orange when using the Lua tags on these forums, it means it's server-sided only. If it's red, it's client-side only. If it's blue, you can use it on either client or server.
  12. They way it's done is by using different dimensions, see setElementDimension for more information. For example, the lobby could be dimension 1, race could be dimension 2 and so on and so forth. As for the markers, you just use the marker functions and events.
  13. Dealman

    server

    I think you need to stop either play or freeroam.
  14. High resolution textures should be possible, so long as they're in a power of two; 256x256, 512x512 etc. Depends on whether you unwrapped it or not.
  15. The error is right there for you; Error loading TXD @ 'engineLoadTXD' [box02.txd]. If it does say that there was an error loading something - it most likely means it wasn't loaded at all. Thus, there is no texture for you. Your texture file is either corrupted or done the wrong way.
  16. Dealman

    ammunition 0

    Check if the remaining ammo is 1, and if it is - prevent the player from firing it and notify them that their weapon is out of ammo. Just subtract 1 from the ammo you show on the HUD, and it'll look as if it has 0 ammo. There are some other ways to do it as well I guess.
  17. They're drawn in order, either enable Post GUI or move it down towards the end of the function. function drawStuff() dxDrawText() dxDrawImage() -- As this is drawn AFTER the text, it would be drawn ON TOP of the text. end
  18. Client A -> Server -> Client B triggerServerEvent -> triggerClientEvent triggerClientEvent("eventName", playerElementToSendTo, messageVariable) Read the wiki pages thoroughly, they're usually well documented.
  19. You can not use client-side events in a server-side script. guiGetText and guiCreateLabel are client-side only.
  20. Of course both work, but I believe using element data would be much less efficient. Especially if set to synchronize the data.
  21. You can use either element data for this, or you can use events. Personally, I think I'd go with events as it allows for more control. You'll have to think logically, if it helps, try to draw on paper or in some software(You'd be amazed how many professional programmers draw their solutions before actually making them). Think of it this way; 1. Player A tries to send a text message to Player B. 2. Player A submits the message, which is then sent to the server using triggerServentEvent. 3. Server handles the submission, and if everything looks alright - passes it on to Player B. 4. Server uses triggerClientEvent to trigger a client-side event on Player B, and Player B only. 5. The phone system is updated for both Player A and Player B upon sending/receiving the message. It's a very simple procedure once you get accustomed to triggering client- and server-sided events.
  22. It's pretty basic math, lets say you have a rectangle that is 200 pixels wide - you divide this by 2, and you get 100. Starting from the left, going to the right(0-100 out of 200) will be the center of the rectangle. So if you want this window centered, get the resolution using guiGetScreenSize and then divide the screen width by 2 to get the center. Draw the rectangle at this position, and subtract it by 100 and it will be centered. For example; local screenW, screenH = guiGetScreenSize() dxDrawRectangle(screenW/2-100, screenH/2-100, 200, 200, ...) You can also use relative values. Which means you use the source resolution and the current resolution. So if you designed the interface on a 1920x1080 resolution, you'd do this; local screenW, screenH = guiGetScreenSize() dxDrawRectangle((200/1920)*screenW, (200/1080)*screenH, ...) Edit: You can do this for rapid conversion of absolute values to relative values. Simple copy and pasting.
  23. Post your code and we might be able to help you
×
×
  • Create New...