Jump to content

AGENT_STEELMEAT

Members
  • Posts

    551
  • Joined

  • Last visited

Everything posted by AGENT_STEELMEAT

  1. I might be interested in helping with a few small things. I have plans for a pretty big MTA project soon, but probably won't get to it for awhile. Just let me know.
  2. You are using different file paths in your scripts than your meta.xml.
  3. 1 - it should be in tags when posted on these forums 2 - it should not be double-posted 3 - it should be the SAME path as in meta.xml
  4. Oh my god, this topic is still active? Why are you using "skins/SynysterGatess.txd" when the path is only "SynysterGatess.txd"? That's why nothing is working. You need to post any errors that occur in the debug console (/debugscript 3) for us to help you quickly.
  5. Regardless of whether or not someone will listen, I always give proper advice.
  6. --This table holds all skins IDs and their corresponding filepaths. local skinReplacements = { -- skinID = "pathToFile" 80 = "skins/80.txd", 81 = "skins/81.txd" } --This function is executed when the resource starts - it replaces all the skin models. function replaceSkinModels() for skinID, filePath in pairs(skinReplacments) do local skinTXD = engineLoadTXD(filePath) engineImportTXD(skinTXD, skinID) end end addEventHandler("onClientResourceStart", resourceRoot, replaceSkinModels) Untested. Also, make sure the files are properly added in the meta. Report any errors in the debug console (/debugscript 3) here.
  7. You don't need a version check, use tags. Also, no need for onClientResourceStart in this example, as you do not depend on other functions from other scripts in the resource.
  8. 13 lines - 5 minute script. Read the comments. --This function is executed when the health pickup is used - it destroys the pickup. --NOTE: there is no need to call setElementHealth as pickups handle this automatically. local function onHealthPickupUse(thePlayer) destroyElement(source) end --This function is executed when a player dies - it creates a health pickup where they died. local function playerDeath() local posX, posY, posZ = getElementPosition(source) local healthPickup = createPickup(posX, posY, posZ, 0, 40) addEventHandler("onPickupUse", healthPickup, onHealthPickupUse) end addEventHandler("onPlayerWasted", root, playerDeath)
  9. There is no 'createDeathPickup' function defined. The function 'Health' is defined twice.
  10. Have you even tried debugging the script? I tested it myself and it works fine.
  11. I'm saying, maybe it's time for people to re-evaluate their stance on quality vs quantity. Perhaps a 32-player slot server with a full-featured multiplayer gameplay experience, just like one R* would create, is better than the 100-450 player servers people are used to now. The only way a NPC system like this could exist and be playable is with a lower playercount. And towncivillian - high-latency players that sync peds are the biggest, if not the only reason serverside peds lag.
  12. The reason zombies lag is that if a player is laggy, then any peds they are the element syncer for will also lag. The solution is to detect and kick high-latency players.
  13. mrvicio, there is a missing ')' in that piece of code. Also, you might not have the correct name of the resource down.
  14. What, that's right, I posted an infinite loop. Now that I step back and think about it, why are you restarting the resource? Just re-add the columns... local function resourceStart() exports.scoreboard:scoreboardAddColumn(name) end addEventHandler("onResourceStart", getResourceRootElement(getResourceFromName("scoreboard")), resourceStart)
  15. I think it's just going to take someone with a lot of determination and experience. I might give it a go, if I feel like harvesting all the path node data for something like that.
  16. So, when the scoreboard resource starts, you want to restart the resource? No problem: local function resourceStart() restartResource(resource) end addEventHandler("onResourceStart", getResourceRootElement(getResourceFromName("scoreboard")), resourceStart) Best of all, no if statements.
  17. What resource to restart itself? And not having if statements is dumb.
  18. I'm not mad, i'm just trying to emphasize that you need to be clear about what you want. You still have not told us.
  19. You need to explain the error. To be honest, sometimes I leave errors in just to teach people to learn how to debug scripts.
  20. Sorry for the doublepost, I forgot this: --Remove all data stored by the resource. local function resourceStop() removeElementData(root, "serverName") removeElementData(root, "serverPort") removeElementData(root, "FPSLimit") removeElementData(root, "mapName") for _, player in ipairs(getElementsByType("player")) do removeElementData(player, "IP") end end addEventHandler("onResourceStop", root, resourceStop) That will remove any data stored by the resource when it stops, since it wont be used.
  21. What you really want to do is set up clientside versions of the getServerName, getServerPort, getPlayerIP, and getFPSLimit functions. Then, just call these new functions on every render. Also, for getPlayerVersion, just use getVersion clientside. --serverside --Store server-based data to root. Also, store the map, if it's a map that just started. local function resourceStart(startedResource) if startedResource == resource then --If its this resource, set data that is unlikely to change. setElementData(root, "serverName", getServerName()) setElementData(root, "serverPort", getServerPort()) setElementData(root, "FPSLimit", getFPSLimit()) setElementData(root, "mapName", getMapName()) else --Set data the could have changed, i.e if a map is started. if getElementData(root, "mapName") ~= getMapName() then setElementData(root, "mapName", getMapName()) end end end addEventHandler("onResourceStart", root, resourceStart) --When a player joins, store their IP local function playerJoin() setElementData(source, "IP", getPlayerIP(source)) end addEventHandler("onPlayerJoin", root, playerJoin) --clientside --Returns the server name function getServerName() return getElementData(root, "serverName") end --Returns the server port function getServerPort() return getElementData(root, "serverPort") end --Returns the FPS limit function getFPSLimit() return getElementData(root, "FPSLimit") end --Returns the map name function getMapName() return getElementData(root, "mapName") end More code could be added to update the data when setFPSLimit, setMapName, etc. are used, but I will leave that to you.
  22. That exactly the same as what I posted, but incorrect. The OP needs to post what he wants to do, not "is this correct" or "i want no if statements".
  23. Maybe reduce the resolutions of a few textures, and remove any vehicle mods (provide them seperate).
×
×
  • Create New...