Jump to content

AGENT_STEELMEAT

Members
  • Posts

    551
  • Joined

  • Last visited

Everything posted by AGENT_STEELMEAT

  1. Not a 1.1 bug, it's a bug with whatever gamemode your using.
  2. Rather than raise the water level, try using createWater().
  3. Stop. Don't reply to this. Just let it go. Don't post "Yeah, we should end this". Don't click the reply button. /thread
  4. How about you stop pointing fingers at each other? 1 - You are BOTH noobs. CapY can't manage to fix a SINGLE argument in his script - it was so painfully obvious. The rest of you are noobs for starting a flame war in the scripting forum for little reason. Take the shit elsewhere. 2 - The script itself sucks. If ya'll are going to argue about something like this, do it in private. This is a place to ask questions, get answers, and have general discussion about SCRIPTING.
  5. local rootElement = getRootElement() local thisResourceRoot = getResourceRootElement(getThisResource()) local pagesXml local wndHelp, wndBlock, tPanel, btnClose local tab = {} local memo = {} local popupQueue = {} local Grid = {} local HELP_KEY = "F9" local HELP_COMMAND = "gamehelp" local POPUP_TIMEOUT = 15000 --ms local FADE_DELTA = 10 --alpha per frame local MAX_ALPHA = 10 addEvent("doShowHelp", true) addEvent("doHideHelp", true) addEvent("onHelpShown") addEvent("onHelpHidden") addEventHandler("onClientResourceStart", thisResourceRoot, function () wndHelp = guiCreateWindow(.2, .2, .6, .6, "Help", true) wndBlock = guiCreateWindow(0, 0, 1, 1, "", true) tPanel = guiCreateGridList(0.2086 ,0.1629, 0.6000, 0.6000, true, wndHelp) btnClose = guiCreateButton(.4, .92, .2, .08, "Close", true, wndHelp) guiSetVisible(wndHelp, false) guiSetVisible(wndBlock, false) guiWindowSetSizable(wndHelp, false) guiSetAlpha(wndBlock, 0) addEventHandler("onClientGUIClick", btnClose, function() if source == this then clientToggleHelp(false) end end ) pagesXml = xmlLoadFile("seen.xml") if not pagesXml then pagesXml = xmlCreateFile("seen.xml", "seen") end for i, resourceRoot in ipairs(getElementsByType("resource")) do --!w local resource = getResourceFromName(getElementID(resourceRoot)) if resource then addHelpTabFromXML(resource) end end addCommandHandler(HELP_COMMAND, clientToggleHelp) bindKey(HELP_KEY, "down", clientToggleHelp) end ) addEventHandler("onClientResourceStop", thisResourceRoot, function() showCursor(false) end ) -- exports function showHelp() return clientToggleHelp(true) end addEventHandler("doShowHelp", rootElement, showHelp) function hideHelp() return clientToggleHelp(false) end addEventHandler("doHideHelp", rootElement, hideHelp) function addHelpTab(resource, showPopup) if showPopup == nil then showPopup = true end -- block duplicates if tab[resource] then return false end local tabtext = getResourceName(resource) local helpnode = getResourceConfig(":" .. getResourceName(resource) .. "/help.xml") if helpnode then local nameattribute = xmlNodeGetAttribute(helpnode, "title"); if nameattribute then tabtext = nameattribute; end end tab[resource] = guiCreateGridList( tabtext , tPanel) if showPopup then addHelpPopup(resource) end return tab[resource] end function removeHelpTab(resource) if not tab[resource] then return false end if memo[resource] then destroyElement(memo[resource]) memo[resource] = nil end guiGridListClear(tab[resource], tPanel) tab[resource] = nil return true end addEventHandler("onClientResourceStop", rootElement, removeHelpTab) --private function addHelpTabFromXML(resource) -- block duplicates if tab[resource] then return false end local helpnode = getResourceConfig(":"..getResourceName(resource).."/help.xml") if helpnode then local helptext = xmlNodeGetValue(helpnode) local showPopup = not (xmlNodeGetAttribute(helpnode, "popup") == "no") if helptext then guiGridListAddRow(resource, showPopup) memo[resource] = guiCreateMemo(.01800, .00040, .08080, .09960, helptext, true, tab[resource]) guiMemoSetReadOnly(memo[resource], true) end end end addEventHandler("onClientResourceStart", rootElement, addHelpTabFromXML) function clientToggleHelp(state) if state ~= true and state ~= false then state = not guiGetVisible(wndHelp) end guiSetVisible(wndHelp, state) guiSetVisible(wndBlock, state) if state == true then triggerEvent("onHelpShown", localPlayer) guiBringToFront(wndBlock) guiBringToFront(wndHelp) showCursor(true) else triggerEvent("onHelpHidden", localPlayer) showCursor(false) end return true end local function fadeIn(wnd) local function raiseAlpha() local newAlpha = guiGetAlpha(wnd) + FADE_DELTA if newAlpha <= MAX_ALPHA then guiSetAlpha(wnd, newAlpha) else removeEventHandler("onClientRender", rootElement, raiseAlpha) end end addEventHandler("onClientRender", rootElement, raiseAlpha) end local function fadeOut(wnd) local function lowerAlpha() local newAlpha = guiGetAlpha(wnd) - FADE_DELTA if newAlpha >= 0 then guiSetAlpha(wnd, newAlpha) else removeEventHandler("onClientRender", rootElement, lowerAlpha) destroyElement(wnd) table.remove(popupQueue, 1) if #popupQueue > 0 then showHelpPopup(popupQueue[1]) end end end addEventHandler("onClientRender", rootElement, lowerAlpha) end function addHelpPopup(resource) local xmlContents = xmlNodeGetValue(pagesXml) local seenPages = split(xmlContents, string.byte(',')) local resourceName = getResourceName(resource) for i, page in ipairs(seenPages) do if page == resourceName then return end end xmlNodeSetValue(pagesXml, xmlContents..resourceName..",") xmlSaveFile(pagesXml) table.insert(popupQueue, resource) if #popupQueue == 1 then showHelpPopup(resource) end end function showHelpPopup(resource) local screenX, screenY = guiGetScreenSize() local wndPopup = guiCreateWindow(0, screenY - 20, screenX, 0, '', false) --350 local restitle = getResourceName(resource) local helpnode = getResourceConfig(":" .. getResourceName(resource) .. "/help.xml") if helpnode then local nameattribute = xmlNodeGetAttribute(helpnode, "title"); if nameattribute then restitle = nameattribute; end end local text = "Help page available for ".. restitle .."! ".. "Press "..HELP_KEY.." or type /"..HELP_COMMAND.." to read it." guiSetText(wndPopup, text) guiSetAlpha(wndPopup, 0) guiWindowSetMovable(wndPopup, false) guiWindowSetSizable(wndPopup, false) fadeIn(wndPopup) setTimer(fadeOut, POPUP_TIMEOUT, 1, wndPopup) end You forgot to set the gridlist as a child of the main window. I haven't tested this - but try it. Also, before I get hate mail - I don't care.
  6. I gotta say, I have at least 30 scripts in my current gamemode, and re-compiling them is a pain. I really think a MTA dev should make a simple tool that can encode files properly and compile lua file automatically. It would make the transition in 1.1 a lot smoother for scripters.
  7. Your trying to do a 3D radio, right? And playSound3D isn't working out? Regular playSound seems to work with more audio formats/streams than playSound3D - so by making your own system youll be working around that. It's pretty simple.
  8. I suggest that you write your own 3D sounds script that uses normal playSound and adjusts the volume on every render.
  9. I have mirrored the LUA compiler orginially at http://mta.dzek.eu/compiler/ at my downloads page: http://www.johnlillis.site40.net/downloads.
  10. BugFix 1.0.1 Fixed a bug were players were not un-gluing from vehicles on death. Also of note - all of my community resources are hosted on both the MTA community center and my personal downloads page.
  11. You know, as far as favoring "VIP" players goes, it's sometimes the best thing to do. Since most VIP members are going to be experienced, and not tolerate as much crap from other players, they are typically a good source for reliable information on rule breakers. That said - it's wrong to not listen to non-VIP players, but apparently most admins there don't know what status a player has. In my experience as admin on FTA, sometimes I have to rely on the more experienced players in the server to tell me what's going on, and in some cases translate for me (as we don't have an english-only rule (not saying its wrong to have one)).
  12. To iterate over all the accounts on the server, and to create a table that holds all the account data, do: local accountData = {} for index, account in ipairs(getAccounts()) do accountData[account] = getAccountData(account) end
  13. Hey, even though this works: if (createdVehicle == false) then it could shortened to if not createdVehicle then Just a little tip
  14. Maybe you all should try to get a hold of the player's serials and IPs and post them here, so they can be banned (sort of like a big blacklist).
  15. It's not a good idea to literally set the vehicle's ID via setElementID - rather, you should use setElementData(theVehicle, "vehicleID", INSERT_ID_HERE). In this case, you could probably use setElementData(theVehicle, "vehicleID", INSERT_ID_HERE, false) as you probably don't need to sync the vehicle's ID to the client. I'm not sure what your plans for using these IDs are, though.
  16. Why did you remove if not dimensionMatch then return end? That just checks to make sure the hitElement and the colshape/marker are in the same dimension... Anyway, try: function warpPlayerIntoAndro(hitElement, dimensionMatch) outputDebugString("Warp function triggered") if not dimensionMatch then return end outputDebugString("dimensionMatch") if getElementType == "player" and not isPedInVehicle(hitElement) then outputDebugString("hitElement is player and player is not in vehicle, warping...") setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end end
  17. SQL is a built-in feature - you can use the SQL functions to save/retrieve data efficiently. MySQL is only neccesary if you plan on using data across multiple server applications, i.e an external website or another MTA server. The SQL function work with the SQL file named internal.db, in the server/mods/deathmatch directory. It can be viewed with the SQLite browser: http://sqlitebrowser.sourceforge.net/
  18. Hey all, I'm trying to script a character system that can save clothing, but im having issues trying to figure out how to save the clothing ID's in a mysql DB. Should I use a JSON string for each type, one JSON string for all types, or what? Also, how would I go about getting all of the clothing a ped is wearing? I'm pretty confused. Any advice would be great.
  19. AGENT_STEELMEAT

    how ?

    Add this to the warpPlayerIntoAndro function, first thing: outputDebugString("Warp function triggered") Try it, and if you dont see "Warp function triggered", then the error is in addEventHandler. Which I think is just another MTA bug.
  20. AGENT_STEELMEAT

    how ?

    ..errors? tried adding some outputDebugStrings in there?
  21. AGENT_STEELMEAT

    how ?

    Ohh shit sorry, wasn't looking closely. Try this: function createAndroMarker(thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) local marker = createMarker(0, 0, 0, "arrow", 1, 255, 0, 0, 170) local colTube = createColTube(0, 0, 0, 1, 1) attachElements(marker, vehicle, 0, 0, 5) attachElements(colTube, marker, 0, 0, 5) addEventHandler("onColShapeHit", colTube, warpPlayerIntoAndro, false) end addCommandHandler("attatch", createAndroMarker) function warpPlayerIntoAndro(hitElement, dimensionMatch) if getElementType(hitElement) ~= "player" then return end if not dimensionMatch then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end
  22. AGENT_STEELMEAT

    how ?

    can you post the movehim function here as well?
  23. RESOURCE_ROOT is defined in my main server script. It's global. Using local in this case works just fine. My main concern is if I left a typo or something in the mysql stuff.
×
×
  • Create New...