Jump to content

XetaQuake

Members
  • Posts

    561
  • Joined

  • Last visited

Everything posted by XetaQuake

  1. Hey all We have a little Problem, and i have a question about some possibles/work-arounds: On our Server, there a over 4000 Objects, and the game runs extremly SLOW for around 85% on our Members - including me. Now, i searching for a method to let MTA run faster. And i already have a idea: I need a script, to let the many Objects disable on Clients - only when they want it - using a command. I get this to work with dimensions: When i are in another dimension as the objects, i get some fps more - but it still runs with around 10FPS. The trick with the dimension works only relative good, for example when i stand in a User-Map/City: There alot objects stops to display (because its a City with many Objects) when i enter another dimension, and i get around 15FPS. But when i deactivate the whole resource with the Objects, i have around 35~70FPS - So it runs very smooth. Now my question: Is there any other way to deactivate the Objects on single Clients? I think the Objects just stop displayed, but not stop rendered, synced, loaded - or so. Interiors will effect the same result i think, so i need any other function, to prevent the Objects for rendering, or to stop the resource or so - the problem: The Objects are serverside (for sync.)! Somebody knows how i can get the same smoothly experience as if the Object-Resource are not launched - Just with using a command to prevent the Objects/Resource to render (or what ever) on a single client - the own PC? I would be very glad when somebody can help me...with 8FPS when the Objects are loaded its no longer playable...but also many Mappers want to continue they work
  2. I thought about this last week too I opened the database, and there was a table with phonenumbers, i thinks about this resource and says me "oohh....its so nice...how I wish this resource were true". But we're to few persons, that's a fact. So, i can it just say again: Do it and help us!
  3. I for my part prefer Notepad++...Notepad2 looks a little bit to unclearly and crammed for my liking.
  4. Or just math.random(10,99) thats the same... ^^ Only your example is more flexible possible
  5. Its easy: math.random(1, 99) Should output a random number between 1 and 99
  6. You should not add a message when anybody pulls out any illegal weapon, because now cheater are able to spam extremely - just roll your mouswheel up and down My tip: The Message should be visible only one time in 5minutes about the same cheater.
  7. All that may be so, but on the IRC peaple says that there was able to tab in the DP3 "semi-public" test. I think the users have told just crap...
  8. If I remember rightly, it worked in the closed beta
  9. Or you wait for DP3 - there alt-tabbing should work
  10. So, i´am in another way right now. I created a script that allows users to get Model ID and coordinates from the object the user stand on. Now users can report them, and its relatively easy now to find and delete crap objects. When someone want to continue my idea, that's fine for me. I for my part are finish with this, to many time i spend for this, and i´am create gang scripts etc. at this time too... Special thanks to 50p and Gamesnert, thanks for helping me.
  11. The problem is, a nickname and username are not really numbers. I already tried some other stuff (and try to learn), one of the easiest ways are: --File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! objectid[0] = createObject(5000, 2058.7827148438, 1535.3381347656, 9.671875, 0, 0, 0) -- ["User: XetaQuake"] ["Nick: XetaQuake"] objectid[1] = createObject(2000, 2057.8776855469, 1536.1126708984, 9.671875, 0, 319, 0) -- ["User: XetaQuake"] ["Nick: XetaQuake"] objectid[2] = createObject(9001, 2067.9504394531, 1535.2299804688, 15.57187461853, 0, 0, 0) -- ["User: XetaQuake"] ["Nick: dude"] And that works good, i am able to load the map without problems. But then, i get the problem i describe already when i save the map after loading: ------------- 50p, i realy try to get this working, i also searching my problems on google, i read table tutorials and so on. The problem is, most of them not help me on this situation.
  12. We use a offedit .xml group...and we want that our users are able to build worlds. But we can not sure taht around 20 users builds no crap, do you understanding? So, when one or two or three users build crap, its often "too late" to delete this user from this group. Also, and thats the most problem, we can not sure wich player builds this object! So i want to get the creator username...
  13. Because some guys build crap (blocking streets or just flooding with objects). And then its like impossible to delete the object, because whe gets around 4000+ objects in the map file. So when one or two peaple build crap - there must stay for ever...or i spend 45 minutes to delete one object - including shutting down the editor or the map Since two weeks, the editor is offline now...because of the crap. And with saving the creator, whe can filtering the person who build crap and delete any object from that user over username
  14. Hi... oh man, assuming i fix the /loadmap problem, there is another problem i think: adopted i save a existing map with already existing objects - who will be the creator of the old objects, there was loaded? Unfortunately, the script doesn´t add just the new objects on a existing map file, the script creates a complete new map on the same name. So there will be no ElementData on all the already existing objects. i am at my wits' end, there a so many problems every and every time i get a step forward. I hope somebody gets a clever idea to prevent all problems, or hopefully OffRoader23 or any other person creates a update to save username and nickname on the objects ;( XetaQuake
  15. Hi Gamesnert, as i written already, i tested it with numbers too: So it would look like this: --File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! objectid = {} maxobjects = 2500 for i=0,maxobjects do objectid[i] = { } for j=0,maxobjects do objectid[i][j] = { } for k=0,maxobjects do objectid[i][j][k] = { } if objectid[i][j][k] then objectid[0][99][99] = createObject(2000, 2082.5437011719, 1567.2075195313, 9.8203125, 0, 0, 0) objectid[1][99][99] = createObject(2000, 2083.306640625, 1567.3236083984, 9.8203125, 0, 0, 0) break end end end end But, yea, as i said already: it doesn´t work I get this ERROR when using numbers: I am wondering, why the first objects loads when i use objectid[0] ["User: XetaQuake"] ["Nick: [GP_A]XetaQuake"], but not the second object. And when i use objectid[1] [99] [99], no objects loads. lol Any ideas pleas?
  16. Possible anybody knows whats the problem, when i post the /loadmap function that loads the map: function loadMapLua ( player, cmd, mapname ) if mapname then local mFile = fileOpen(""..mapname..".o23") if mFile then clearObjects (player) objectid = nil objectid = {} outputChatBox ( "Map loaded: " ..mapname.. "", player ) --output success local buffer -- temporary the whola lua file local filessize = fileGetSize (mFile) --get file size buffer = fileRead(mFile, filessize) -- read the file length loadstring(buffer)() --load lua to string fileClose(mFile) -- close the file once we're done with it else --if no such map outputChatBox ( "Map " ..mapname.. " failed to load. Perhaps it doesn't exist?", player ) --output fail end else outputChatBox ( "No map name specified. Please use /loadmap <name>", player ) end end addCommandHandler( "loadmap", loadMapLua ) I already tried some things with the mapfile, like set the object only objectid[0] [99] [99] instead of objectid[0] ["User: XetaQuake"] ["Nick: [GP_A]XetaQuake"]. Just to prevent possible reasons. But thats not work. Can anybody help me pleas?
  17. Hi all. First, i want to thanks 50p for all the great help. Second, a question about a new ERROR i get. I think its not so heavy to solve for peaple there know whats wrong /savemap works already perfect, but i have trouble with /loadmap, but it works also quite okay for the first successes. So my Problem: When i load a saved map, only the first object on the mapfile gets loaded and are visible in the world! I get this ERROR when i load a map: And the map file looks like this (generated by script): --File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! objectid = {} maxobjects = 2500 for i=0,maxobjects do objectid[i] = { } for j=0,maxobjects do objectid[i][j] = { } for k=0,maxobjects do objectid[i][j][k] = { } if objectid[i][j][k] then objectid[0] ["User: XetaQuake"] ["Nick: [GP_A]XetaQuake"] = createObject(2000, 2082.5437011719, 1567.2075195313, 9.8203125, 0, 0, 0) objectid[1] ["User: XetaQuake"] ["Nick: [GP_A]XetaQuake"] = createObject(5000, 2083.306640625, 1567.3236083984, 9.8203125, 0, 0, 0) break end end end end anybody ideas why only the first object loads, and not all the objects after the first object too?
  18. Oh thanks 50p! Now i am able to load the map it looks like this (writes with hands): --File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! objectid = {} maxobjects = 2500 for i=0,maxobjects do objectid[i] = { } for j=0,maxobjects do objectid[i][j] = { } for k=0,maxobjects do objectid[i][j][k] = { } if objectid[i][j][k] then objectid[0] ["User: XetaQuake"] ["Nick: [GP_A]XetaQuake"] = createObject(2000, 2160.7631835938, 2198.2272949219, 11.245628356934, 0, 0, 0) break end end end end ------------------- Now, i tries to generate maps like the one above automaticaly when saving map. Currently it (/savemap) looks like this: function saveThisMap ( player, cmd, mapname ) if mapname then local madeFile = fileCreate("" ..mapname.. ".o23") -- attempt to create a new file fileWrite(madeFile, "--File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! \r\n \r\n objectid = {} \r\n maxobjects = 2500 \r\n \r\n for i=0,maxobjects do \r\n objectid[i] = { } \r\n for j=0,maxobjects do \r\n objectid[i][j] = { } \r\n for k=0,maxobjects do \r\n objectid[i][j][k] = { }\r\n if objectid[i][j][k] then \r\n") for i=0,maxobjects do if objectid[i] then local model = getObjectModel (objectid[i]) local x, y, z = getElementPosition(objectid[i]) local rx, ry, rz = getObjectRotation(objectid[i]) --local creator = getClientName ( player ) --local creatorUser = getAccountName ( getClientAccount ( player ) ) local creatorUserLoad = getElementData ( objectid[i], "creatorUserSave" ) local creatorNickLoad = getElementData ( objectid[i], "creatorNickSave" ) fileWrite (madeFile, "objectid[" ..i.. "] [\"User: "..creatorUserLoad.."\"] [\"Nick: "..creatorNickLoad.."\"] = createObject(" .. model .. ", " .. x .. ", " .. y .. ", " .. z .. ", " .. rx .. ", " .. ry .. ", " .. rz .. ") \r\n") fileWrite(madeFile, " break \r\n end \r\n end \r\n end \r\n end \r\n") end end outputChatBox ( "Map saved as: " ..mapname.. "", player ) fileClose ( madeFile ) else outputChatBox ( "No map name specified. Please use /savemap <name>", player ) end end addCommandHandler( "savemap", saveThisMap ) But then, my map looks crap: --File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! objectid = {} maxobjects = 2500 for i=0,maxobjects do objectid[i] = { } for j=0,maxobjects do objectid[i][j] = { } for k=0,maxobjects do objectid[i][j][k] = { } if objectid[i][j][k] then objectid[0] ["User: XetaQuake"] ["Nick: [GP_A]XetaQuake"] = createObject(2000, 2046.2290039063, 1414.0323486328, 9.671875, 0, 0, 0) break end end end end objectid[1] ["User: XetaQuake"] ["Nick: [GP_A]XetaQuake"] = createObject(5000, 2048.4353027344, 1413.0714111328, 11.671875, 0, 0, 0) break end end end end As you can see, the ends and the breaks gets writen after every object. How can i create it only after the last object?
  19. Hi, i tried it now again...and modifies the map file: --File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! objectid = {} maxobjects = 2500 function() for i=0,maxobjects do objectid[i] = { } for j=0,maxobjects do objectid[i][j] = { } for k=0,maxobjects do objectid[i][j][k] = { } if objectid[i][j][k] then objectid[0] ["User: XetaQuake"] ["Nick: [GP_A]XetaQuake"] = createObject(2000, 2160.7631835938, 2198.2272949219, 11.245628356934, 0, 0, 0) end end end end end (I modifies it with my hands, because i doesn´t need to script it for automatic generation when it doesn´t work - So i can test it first) But i get this error (EDIT:) when i load the map using /loadmap: Line 336: loadstring(buffer)() --load lua to string Let me guess: I made anything wrong Man, its realy not easy that´s true...i scripted already some scripts, but that´s...not funny. The problem is, i absolutely need it Help pleas
  20. Ohhh okay, but its not realy easy to pratice with loadstring(), i tried now some basic ideas on the loadmap function (which include loadstring). So i added a 3d table on loadmap: for i=0,maxobjects do objectid[i] = { } for j=0,maxobjects do objectid[i][j] = { } for k=0,maxobjects do objectid[i][j][k] = { } if objectid[i][j][k] then and i tried to rewrite the loadmap function a little bit. At the end, it looks like this: function loadMapLua ( player, cmd, mapname ) if mapname then local mFile = fileOpen(""..mapname..".o23") if mFile then for i=0,maxobjects do objectid[i] = { } for j=0,maxobjects do objectid[i][j] = { } for k=0,maxobjects do objectid[i][j][k] = { } if objectid[i][j][k] then clearObjects (player) objectid[i][j][k] = nil objectid[i][j][k] = {} outputChatBox ( "Map loaded: " ..mapname.. "", player ) --output success local buffer -- temporary the whola lua file local filessize = fileGetSize (mFile) --get file size buffer = fileRead(mFile, filessize) -- read the file length loadstring(buffer)() --load lua to string fileClose(mFile) -- close the file once we're done with it else --if no such map outputChatBox ( "Map " ..mapname.. " failed to load. Perhaps it doesn't exist?", player ) --output fail end end end end end else outputChatBox ( "No map name specified. Please use /loadmap <name>", player ) end end addCommandHandler( "loadmap", loadMapLua ) But well, it doesn´t work. I am sure, you mean that i should change loadstring(buffer)() and not the complete function, i read now some information pages in english and german, unfortunately it doesn´t help me much, there just talking about stuff you already says me (thanks for this). But i can´t find documents there write about my problem/questions i have. But now, i understand the problem on this, but i doesn´t can solve it Do you mean realy the map file? (for example mymap.o23) I should write lua code in this file?
  21. Hi 50p and others I defined objectid now as 3d table. Unfortunately, i get lots of warnings about nil values/bad arguments: I think its because of the 3d table, is there anything wrong?: function saveThisMap ( player, cmd, mapname ) if mapname then local madeFile = fileCreate("" ..mapname.. ".o23") -- attempt to create a new file fileWrite(madeFile, "--File Generated with OffRoader23's In-Game MTA DatchMatch Map Editor! \r\n \r\n") for i=0,maxobjects do objectid[i] = { } for j=0,maxobjects do objectid[i][j] = { } for k=0,maxobjects do objectid[i][j][k] = { } if objectid[i][j][k] then local model = getObjectModel (objectid[i]) local x, y, z = getElementPosition(objectid[i]) local rx, ry, rz = getObjectRotation(objectid[i]) local creatorUserLoad = getElementData ( objectid[i], "creatorUserSave" ) local creatorNickLoad = getElementData ( objectid[i], "creatorNickSave" ) fileWrite (madeFile, "objectid[" ..i.. "] [\"User: "..creatorUserLoad.."\"] [\"Nick: "..creatorNickLoad.."\"] = createObject(" .. model .. ", " .. x .. ", " .. y .. ", " .. z .. ", " .. rx .. ", " .. ry .. ", " .. rz .. ") \r\n") end end end end outputChatBox ( "Map saved as: " ..mapname.. "", player ) fileClose ( madeFile ) else outputChatBox ( "No map name specified. Please use /savemap <name>", player ) end end addCommandHandler( "savemap", saveThisMap ) I looks on this problem now some time, and put getObjectModel, getElementPosition, getObjectRotation etc. element to objectid[j][k] instead of objectid (because of my 3d table) - but its still the same. Possible everything works with my /savemap function, but another snippet from offedit.lua gets in trouble. But i looked up and down the complete script three times.
  22. Uhm, i know that "" is wrong! I just tried to answer on LordAzamth tip, to create ["User: XetaQuake"] Also i says that ""User: " looks realy stupid for my eyes! ... *looking upwards* I thank you, LordAzamth, \" was the key , now it looks like this (ORIGINAL SNIPPET FROM MAP FILE!) objectid[0] ["User: XetaQuake"] ["Nick: [GP_A]XetaQuake"] = createObject(2000, 2160.7631835938, 2198.2272949219, 11.245628356934, 0, 0, 0) The script looks like this: fileWrite (madeFile, "objectid[" ..i.. "] [\"User: "..creatorUserLoad.."\"] [\"Nick: "..creatorNickLoad.."\"] = createObject(" .. model .. ", " .. x .. ", " .. y .. ", " .. z .. ", " .. rx .. ", " .. ry .. ", " .. rz .. ") \r\n") Thanks Now back to 50p, now i get your mentioned error message: You sayed that "objectid is not created in that script", but my question is now, which script do you mean? Do you mean the map file? And what do you mean exacly with "not created"
  23. Hmm, now i tried this: fileWrite (madeFile, "objectid[" ..i.. "] [""User: ".. creatorUserLoad .."] [""Nick: ".. creatorNickLoad .."] = createObject(" .. model .. ", " .. x .. ", " .. y .. ", " .. z .. ", " .. rx .. ", " .. ry .. ", " .. rz .. ") \r\n") But then i get "loading script failed": Also i´am not sure that this will export a ["User: XetaQuake"] And that means? Sorry ^^ Yea, but stuff like this are already used in the script, i think: [..] loadstring(buffer)() [..] -> [..] buffer = fileRead(mFile, filessize) [..] -> [..] local mFile = fileOpen(""..mapname..".o23") [..] local filessize = fileGetSize (mFile) [..] I think the method to load the map file are already good, but anything is wrong. I doesn´t understand why the script not just ignore the letters? Other ideas, or explanations pleas?
  24. Any help pleas? I get a error when i try to load the map: But why? should the script not just ignore the nickname and username letters? Pleas help me! its my last problem i think
  25. Oh yea, it WORKS! I thank you 50p and Gamesnert (you says it also) Now, my map file looks like this (original copy): Now, i have a last problem, /loadmap doesn´t work. When i write /loadmap, i get this two warnings and one error: Note: I think the two warnings are not so serious, because there are at the original offedit release too! But the ERROR are the problem. And here´s the function /loadmap: function loadMapLua ( player, cmd, mapname ) if mapname then local mFile = fileOpen(""..mapname..".o23") if mFile then clearObjects (player) objectid = nil objectid = {} outputChatBox ( "Map loaded: " ..mapname.. "", player ) --output success local buffer -- temporary the whola lua file local filessize = fileGetSize (mFile) --get file size buffer = fileRead(mFile, filessize) -- read the file length loadstring(buffer)() --load lua to string fileClose(mFile) -- close the file once we're done with it else --if no such map outputChatBox ( "Map " ..mapname.. " failed to load. Perhaps it doesn't exist?", player ) --output fail end else outputChatBox ( "No map name specified. Please use /loadmap <name>", player ) end end addCommandHandler( "loadmap", loadMapLua ) The ERROR line (336) are: loadstring(buffer)() --load lua to string To be honest, i doesn´t know whats wrong with loadstring(buffer) Pleas help me
×
×
  • Create New...