Jump to content

MaddDogg

Members
  • Posts

    189
  • Joined

  • Last visited

Everything posted by MaddDogg

  1. MaddDogg

    char ids

    local characterNodes = xmlNodeGetChildren(accountRoot) for _,node in pairs(characterNodes) do local atributes = xmlNodeGetAttributes(node) local name = atributes.name triggerClientEvent ( source, "addcharacter", getRootElement(), name) end That's how it should look like.
  2. MaddDogg

    char ids

    As I said, you can't loop through the value returned by your function. You still have to get all children from this value (which is a node) and THEN you can loop through the table holding the children of your player node.
  3. MaddDogg

    char ids

    xmlNodeGetChildren(root) returns a table with all nodes in it. But then you use this table again in the same function, which is your problem. The function expects a node, not a table full of nodes. So, this... ipairs (xmlNodeGetChildren (db)) should just be... ipairs (db) Also, your function "findAccountChildInDB" will just return the node of the player's values, so you can't loop within it. If you want to loop through all the characters, which are listed under the player's node, you have to again make use of xmlNodeGetChildren at this point and then loop through the returned table (if it is one, anyway) and get the attributes for every loop step.
  4. The creation of a meta.xml is very simple, did you read this? The basic thing, you'll need for your feature, is the following: https://wiki.multitheftauto.com/wiki/OnC ... ayerDamage If a player is "damaged" (hurt), this event is triggered. If you cancel it, the respective player won't lose health. To use this to your advantage, you do two things at this point: Check, if the player, on which the injury is inflicted, is in "sandbox mode". The second thing is to check, if the attacker is in this mode. Both will have a cancelEvent outcome, so that players in sandbox mode are invincible, and so are people, which are attacked by such players. This is only the core of the whole thing, but the rest should be easily figured out. Oh yeah, and also read this: https://wiki.multitheftauto.com/wiki/CancelEvent
  5. Output the rank and see, if it is 2, when you're second ranked. If not, then most likely the getAliveCount function has a mistake in it. Also, you should make use of elseif at this point: if(rank == 2) then
  6. There is no function that does this. But a tip.. read the reference: http://www.lua.org/manual/5.1/
  7. Yes, here are again the functions: https://wiki.multitheftauto.com/wiki/Ser ... _functions
  8. To exchange data between the server and client, I advise you'd use getElementData and setElementData. triggerServerEvent or triggerClientEvent don't return a value from "the other end", because there is no direct connection to a function returning a value, the event, to which the function was bound and the triggering from the other side. Also, you added the events twice. I guess you forgot the "-Handler" for example at this point: addEvent("a_fileOpen",getRootElement(),fileOpenFunc)
  9. MaddDogg

    char ids

    You could do something like this: setAccountData(getPlayerAccount(source), charid .. ".charname",nombre)
  10. Never heard of something like a "search function", hm? https://forum.multitheftauto.com/viewtop ... ql#p314679
  11. If you had just paid attention to what I told you, it would have been fixed. You're missing 2 arguments in dxDrawText. It's unbelievably easy to fix, I won't fix it for you.
  12. And again I have to say: You seem to have no idea of scripting. Your script is a total mess. The syntax is completely wrong at several points and it doesn't even make sense. You trigger events, which don't exist, same goes for functions. There is no client event "onkillTimer" and no "onMapStarting". Also there is no function "clientAction". "blowVehicle(player)" makes absolutely no sense, the player is no vehicle. It just looks like you just copied together several script parts. Just START learning Lua and scripting in MTA. You can't just go on snipping together sample scripts. Either you consider that or nobody will help you.
  13. Sorry, but you seem to have no idea whatsoever, what you're doing there. "if health > 1 then" makes no sense. Do you even understand the meaning of this line? And setPlayerHealth does not exist. Would you have read the errors, it would have been clear to you. Please start learning scripting, especially control structures. Another thing: "if money > 100 then" also has a flaw. It should be ">=", because otherwise, people with exactly 100$ won't be able to use your pickup. A hint to fix this: https://wiki.multitheftauto.com/wiki/SetElementHealth
  14. Do you even understand your script? Your getPlayerRank function seems to set the element data. Then you can get this data. Although this system is kinda weird and inconvenient, it should work. Again, you have to use your getPlayerRank function FIRST and then you can get the element data for the rank.
  15. It looks like, you didn't use the getPlayerRank function to set the element data "Rank". Then, of course, getElementData will return false. The code is still very messy, but okay, that's your problem.
  16. You omitted the right and bottom arguments of dxDrawText. Errors should have told you that. You could have easily fixed that by yourself. https://wiki.multitheftauto.com/wiki/DxDrawText
  17. MaddDogg

    [help]Gate

    OMG, you can't just patch together some script lines without even knowing, what the script, you're making there, does and then think, you will get a decent result. Learn the scripting basics first: https://wiki.multitheftauto.com/wiki/Main_Page
  18. As long as their both on the same side (server or client) and the table is not local, it'll work. But still: Give us your code, or nobody will be able to help you.
  19. No, why would you? You don't want to change the skin for the server, you want to change it for the client. The replace function gets called for every player, when the resource is started for him.
  20. Mostly animations and mathematics, I guess. You need to check the positions, states, and so on. But this is a quite difficult topic, if you're not too experienced in scripting in MTA, you should first learn the basics and general stuff.
  21. So he is talking about flags, which trigger certain functions within the A.I. of the peds? I don't think that it is possible to use anything from the A.I., but you can always script your own A.I. which checks for certain flags. When a flag "attack" is set to true, a ped just attacks other players/peds..
  22. MaddDogg

    Top times

    This is still a "help board", not a "request board, because you're too lazy". And why did you even had to open a new thread? You just quoted this one: https://forum.multitheftauto.com/viewtop ... 97#p311397
  23. Yea, it is by ryden, which is an MTA developer, but it's not directly made by "the MTA team". Are you sure that you just want to "copy" valhalla? Because I fear that then your server won't have success.. You should bring more of your own ideas into this. I noticed that valhalla's script, although a great script, has some weak points, where new servers could score with innovative ideas At least that's what I try to do with my team with our project
  24. Nice stuff.. never actually bothered learning this stuff, although I'm quite experienced in modeling. Sorry, if this may sound like a nooby question, but.. do the textures have a format like png? I just know that when creating a txd, it seems to become a bmp, but as I said, I never learned this I hope that the MTA team will actually react to this (besides favoring your video).
  25. You could use a repeat-until loop. function setPlayerRandomSkin(player) repeat randskin = math.random(288) until isValidSkin(randskin) and not isRegimentSkin(randskin) local account = getPlayerAccount(player) setAccountData(account, "wwacc.skin", randskin) setElementModel(player, getAccountData(account, "wwacc.skin")) return getAccountData(account, "wwacc.skin") end Untested, but should work. But it seems like one of your functions has a problem, because it seems to always return the wrong value, so it will never pass and call the function again. Maybe post the code for isValidSkin and isRegimentSkin, there could be a problem in them, too.
×
×
  • Create New...