Jump to content

myonlake

Members
  • Posts

    2,312
  • Joined

  • Days Won

    40

Everything posted by myonlake

  1. myonlake

    question

    Do you mean you want to make a marker visible only for a team and no one else? In that case you should refer to the last optional argument of createMarker -function.
  2. Once again, he did not ask for that. Secondly, your code makes no sense and is absolutely irrelevant to the issue. Read replies before posting, honestly.
  3. That's not what he wanted. He wanted a script that would trigger only when a player has changed interior. For example, I change interior from 0 to 1, it would trigger something in his code. But there is no direct way to do this unless you had your own interior system, which would handle all interior changes itself.
  4. Pretty much making your own download system with the following would be the answer. downloadFile
  5. Not sure what you really want with this code but here you go. Client-side local newname = "n/a" addEvent("lobby", true) addEventHandler("lobby", root, function() -- Effects sound = playSound("sound/sea.mp3", true) setSoundVolume(sound, 1.0) setElementDimension(localPlayer, 255) showCursor(true) -- Design background = { ["lobby"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/lobbyBG.png", true), ["sider"] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/sider.png", true) } guiSetEnabled(background["lobby"], false) guiSetEnabled(background["sider"], false) -- Text name = guiCreateLabel(0.79, 0.01, 0.16, 0.04, "Name:" .. newname, true, background["lobby"]) guiSetFont(name, "default-bold-small") guiLabelSetVerticalAlign(name, "center") end ) addEventHandler("onClientRender", function() if (newname ~= getPlayerName(localPlayer)) then newname = getPlayerName(localPlayer) end end )
  6. Nice job there! I like it.
  7. This would be one of the best features for the MTA server of all time if it ever gets implemented. This multi-core system should also be toggleable via mtaserver.conf.
  8. You have to trigger the function first. Where are you triggering the function? If nowhere, then type info() in the end of the file.
  9. There is no direct way to check it. You just have to make your own events for those. If you're making your own interior system, I don't think it should be too hard I have suggested a couple events for detection but to be honest they're useless after all (http://bugs.multitheftauto.com/view.php?id=6977).
  10. Oh, okay. The following worked fine for me. local screenY, count, space = 0, 0, 66 -- y-coordinate, the amount of boxes and the multiplier how far the boxes are set from each other -- function to draw the rectangles function drawBg() for i=1,count do -- repeat until we reach the amount of boxes dxDrawRectangle(0, screenY+(space*i), 256, 64, tocolor(0, 0, 0, 100), false) -- draw the rectangle so that it counts the space multiplied with the box count incremented with the y-coordinate end end -- initialization for background rendering function initBg() screenY, count = 20, 5 -- set the variables how we want them addEventHandler("onClientRender", root, drawBg) -- trigger the event handler for the rendering end initBg() -- launch the initialization It's kinda tricky but to be honest mathematics are always the answer to the toughest questions after all. It usually solves most of the problems when trying to be accurate. In this case it was rather simple: 20+(5*count)
  11. Not sure if this would fix much but do the following. Instead of doing this; "freshman.ttf" type="client" /> Do this; "freshman.ttf" />
  12. Sorry but we do not help with the roleplay gamemode you are referring to. In order to add mapping you have to have the map resource inside the 'resources' folder of your MTA server. Then you'll have to start it via the server console by typing in 'start '. If you want the map to always be there you have to add it to the mtaserver.conf file down in the resource section.
  13. Nope. Instead of 'player' use 'localPlayer'.
  14. Make sure you put that thing in the "onClientResourceStart" event so that it will be properly set.
  15. Sorry but I didn't catch this idea as a whole. Alright so you want to create a marker, which will do something to a player when the player's element data has changed. Am I correct?
  16. I don't know what's the point in this. onClientRender renders infinitely corresponding to the client's rendering time and I am not sure why do you want a "count" in it. Do you want to show it a limited amount of time like five seconds or what is it?
  17. When and where does this happen? Is this appearing on all servers or just one, or any servers at all? Have you tried re-installing GTA and MTA? Also, read this; viewtopic.php?f=104&t=31668.
  18. Do you mean like, people connecting to the server all the time? That's already a feature of Multi Theft Auto. It disables connecting if there are too many connections in the frame. There is no way a Lua script would help you with this because Lua is always done after the connection, which wouldn't fix anything but make it just more crappy for you (connection + lua + kick instead of just connection).
  19. Accounts, which you make with addAccount ACL-function are saved in the internal.db file as far as I remember. You can find it from the deathmatch -folder.
  20. Is this what you want? The command triggers a function, which deletes an existing ramp or creates a new one with the z-rotation -130. addCommandHandler("mjump", function(player, cmd) if (isElement(ramp)) then destroyElement(ramp) outputChatBox("* Ramp object destroyed.", player, 255, 0, 0, false) else local x, y, z = getElementPosition(player) local rx, ry, rz = getElementRotation(player) ramp = createObject(1655, x, y, z, rx, ry, -130) setElementInterior(ramp, getElementInterior(player)) setElementDimension(ramp, getElementDimension(player)) outputChatBox("* Ramp object created.", player, 0, 255, 0, false) end end )
  21. 1. getTime(), setTrafficLightState(), setTimer() 2. onClientClick, guiCreateButton(), getElementType() 3. createMarker(), setElementData(), givePlayerMoney(), takePlayerMoney(), createVehicle() 4. setElementData(), getPlayerMoney() That will get you started. Come back if you need help.
  22. Are you certain on that? CapY and I have been scripting for a -very- long time.
  23. Me too. My server has two full versions for multi-gamemode, bug free.
  24. Please do bare in mind that it is more wise to trigger a server side event to fetch the money server-side rather than client-side, since server/client-side money are not synchronized.
×
×
  • Create New...