Jump to content

MaddDogg

Members
  • Posts

    189
  • Joined

  • Last visited

Everything posted by MaddDogg

  1. A stack overflow happens, when data within the stack behind a memory location is overwritten, because the boundaries of your variable were not observed. This can happen, when pointers are not used correctly or an array index is exceeded. Or it could be an infinite loop. Your problem seems to be that you set your element model to a string. get- and setAccountData works with strings and does not support several types of data like get- and setElementData. Or your problem is the actual setting of the accountdata, although I don't know, how the function handles with unwanted data types. EDIT: I just saw that you recall the function over and over again, if an if clause is not fulfilled. That's your problem.
  2. 1. and 3. What exactly did not work for you? Why did this not work? Where did you get stuck? You must be doing something wrong, those scripts are there for free usage, so writing your own would be a waste of time, if these scripts fulfill your wishes. 2. You just need to get all the data you want to save, when the player leaves, and then store it in a respective place. This could for example be a MySQL database. For this you would probably also need an account system. But you should give us more information about how your system of saving data should look like. For example, does it get saved permanently and it is bound to an account? But you should learn to script, otherwise you'll run into thousand problems. Just stomping together some scripts won't make a good server..
  3. This is also not a place to arrange private chats with each other. You should give us a rough outline of what the script, you would like to make, should look like. Then we can tell you how to start, what functions/events you need and what you need to know.
  4. And robhol's second way would look like this: -- your function + command handler ... addCommandHandler("new", function (player) executeCommandHandler("changemap", player) end ) Untested and I'm tired..
  5. "character" or "CHARACTER" is a predefined keyword in MySQL. You need to use a different column/field name. I've also had this problem once, with the keyword "read", so I just needed to change it to "hasRead", but until I found this out, it already drove me crazy Here is a list of the keywords/reserved words: http://dev.mysql.com/doc/refman/4.1/en/ ... words.html
  6. That's really a great thing! The creating of the txd really impresses me, seems to be really cool to be able to generate those files. Where did you learn this from? Now you made me curious A clientside file management would be very useful indeed. I would love to be able to manipulate client files and load them without having to use meta.xml. This would also be great to create a signature system. By this I mean that every player is able to sign his driver license or whatever you want to be signed and this signature could then be saved as an image file.
  7. Thank you! That actually was my problem. I didn't consider this and tried a lot of things, but not changing the original width and height, because I thought, they represent the actual image size of the source image. Thank you again.
  8. Although it is solved, I want to emphasize the following again: If you don't fix that, you'll soon have 10 cars standing at one point.
  9. https://wiki.multitheftauto.com/wiki/Main_Page https://wiki.multitheftauto.com/wiki/OnClientMarkerHit https://wiki.multitheftauto.com/wiki/SetElementHealth https://wiki.multitheftauto.com/wiki/TakePlayerMoney That should be everything, you'll need.
  10. Thanks for the reply. Thanks for the explanation regarding the source code. This is my actual source code: addEventHandler("onClientRender", getRootElement(), function () if f_showHealthBar then dxDrawImage(430,980,256,64,"images/health_bar_body.png") -- full at 239, empty at 18, length is 221 local health = getElementHealth(getLocalPlayer()) dxDrawImageSection(430,980,256,64,0,0,18 + math.round(221 / 100 * health),64, "images/health_bar_status.png", 0, 0, 0) outputChatBox(18 + math.round(221 / 100 * health)) end end ) This is supposed to draw a health bar. The actual image has the size 256x64px. The image used by dxDrawImageSection is the red status indicator within the bar, which is drawn longer, the higher the player's health is. As you can see in the following pics, the section of the image is not correct. The numbers in the chatbox are the output of the one outputChatBox line. These numbers define the actual width of the section. http://img35.imageshack.us/img35/4703/fullhealth.jpg http://img824.imageshack.us/img824/9862/injured.jpg
  11. First of all you should use English identifiers and function names, otherwise people, who don't speak your language, won't be able to understand your script properly (although I am lucky right now). Actually I don't really get your script, but still some questions: 1. Do you get any server- or clientside errors? 2. When exactly do you get infinite money? When unloading the truck or at emptying a trash can? It seems like you don't re-randomize randommuell. So it seems like you just recreate the same checkpoint over and over again. This results in an infinite loop of calling this function, as long as you stay at this point. You could definitely improve your script, because all those if and else blocks do almost the same thing, just some output or some value is different. Rewriting it to an improved script would be very helpful, since it would be way more readable.
  12. https://forum.multitheftauto.com/viewtop ... 91&t=26541 And like this, you will find nobody. (Perhaps, a warning system for the forum should be introduced)
  13. Why is your problem located at onResourceStart? I think you mean onPlayerJoin.. Does the function get called? Test this first. Is the script serverside? Do you get errors in the log file? Apart from that, you should attach the onResourceStart event to the resource's root element, it is in, otherwise the car will be created with every script file, you load onto the server.
  14. MaddDogg

    MySQL

    https://forum.multitheftauto.com/downloa ... php?id=217 Or here, I just uploaded it: http://rapidshare.com/files/404312955/MTA-MySQL-0.41.rar.html
  15. MaddDogg

    MySQL

    You should rather start searching for yourself instead of asking every little question: https://wiki.multitheftauto.com/wiki/Mysql Could have been found with a simple 10 sec. search.
  16. Omg, how about indentation? Several mistakes or unneeded lines: 1. The "relative" coords at guiCreateLabel do not have a relative value. 2. A "guiSetVisible(mainGui, true)" is not needed after the creation, because any gui element created is visible by default. 3. The returns are not necessary, because first you don't return any value, second you don't need to end the function at this point, because there won't be anything executed within the function after this point anyways. 4. If your var0 holds 1, you just hide the gui window. At the next call of the function, it is still existing, but you create a new one. You should either check at showing, whether it is already created or not, or destroy the gui elements at hiding. 5. Your function arguments are incorrect. When you are working clientside, addCommandHandler won't pass on the player argument, because it is always the local player, who will trigger this command. Also, you don't even use both of them, so you can just get rid of them (by just writing "function helpfunc()"). This may fix it, but perhaps it won't. If not, also publish your serverside script.
  17. @loler: You should know that you're actually not helping him in the long run. It is very kindful of you to write that for him (although you should have used loops), but he will just come back with more questions like "i want this thing, here is my 3 lines code, finish it". @Metalhero: You should DEFINITELY read more tutorials about scripting (in Lua/MTA), because you didn't even have any idea to start. That won't get you far, even with someone, who writes you a code snippet. You didn't even define your rank system. What do you want it to do? Where do you need help? You can't just ask here for a complete rank system script.. You should've started out with thinking about what you need for the system. That could be a function, which raises the points, a function, which returns the rank...
  18. Hi! Perhaps this was already asked for, but I think that it would be a great addition to MTA, if the interface would be multilingual. This does NOT have to include things regarding scripting, but rather the interface, a normal MTA player uses. I don't think that it would be too hard to achieve this and it would add a lot of value to MTA. Translators should be easily found, since this forum seems to be full of different nationalities. Just an idea, which I had in mind several weeks now. Madd
  19. Oh sorry, got confused by your Tux avatar
  20. Just a wild guess, but do the server files have the appropriate rights to be opened? Namely CHMOD rights.
  21. Did you actually buy it? Because otherwise it's your own fault and I hope you won't get support for a pirated version. If not so, what do you mean by "not working"? Be more descriptively.
  22. How about searching for yourself? This topic is discussed a lot of times on the internet.. http://www.convertffs.com/objects/ http://gtamap.delux-host.com/converter/ Although I think that the rotation may get corrupted by these converters. You probably have to reset them in the MTA map editor.
  23. I hope I understood the code correctly, but I think the problem is that the part, where you initialize the element data is at spawn, but you already work with it at login, which is before spawn. Therefore you should add the following snippet: addEventHandler("onPlayerJoin", getRootElement(), function () setElementData(source, "wwacc.timesSpawned", 0) end ) This will initialize the element data at join and should solve your problem.
  24. I justed tested every hud component and no, the wanted stars can't be deactivated. But, as 50p said, they are not shown, as long as you don't set the wanted level > 0. So you should just write your own wanted function, which does not rely on the setPlayerWantedLevel function.
  25. What you are searching for is getElementPosition.
×
×
  • Create New...