Jump to content

Mittell Buurman

Members
  • Posts

    56
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Mittell Buurman

  1. I do get results though, test this for yourself: local vehicles = { {2588.5, 1830.59998, 11.1, 0, 0, 270 }, {2606.3999, 1837, 11.1, 0, 0, 90 }, {2606.30005, 1843.30005, 11.1, 0, 0, 90 }, {2606.30005, 1849.69995, 11.1, 0, 0, 90 }, {2606.3999, 1856.09998, 11.1, 0, 0, 90 }, {2606.30005, 1862.69995, 11.1, 0, 0, 90 }, {2606.3999, 1830.69995, 11.1, 0, 0, 90 }, {2588.3999, 1856.09998, 11.1, 0, 0, 270 }, {2588.30005, 1849.80005, 11.1, 0, 0, 270 }, {2588.3999, 1843.40002, 11.1, 0, 0, 270 }, {2588.30005, 1862.80005, 11.1, 0, 0, 270 }, {2588.3999, 1837, 11.1, 0, 0, 270 }, {2606.3999, 1815.09998, 11.1, 0, 0, 90 }, {2606.3999, 1808.59998, 11.1, 0, 0, 90 }, {2588.19995, 1808.69995, 11.1, 0, 0, 270 }, {2606.30005, 1802.19995, 11.1, 0, 0, 90 }, {2606.3999, 1795.90002, 11.1, 0, 0, 90 }, {2606.5, 1789.59998, 11.1, 0, 0, 90 }, {2588.19995, 1802.40002, 11.1, 0, 0, 270 }, {2588.19995, 1815.09998, 11.1, 0, 0, 270 }, {2588.3999, 1795.90002, 11.1, 0, 0, 270 }, {2606.5, 1783.40002, 11.1, 0, 0, 90 }, {2588.3999, 1789.90002, 11.1, 0, 0, 270 }, {2588.3999, 1783, 11.1, 0, 0, 270 } }; for index, item in ipairs (vehicles) do outputChatBox(tostring(item[1])) v = createVehicle(431, item[1], item[2], item[3]); local vehicle = getElementsByType("vehicle") for i, v in ipairs (vehicle) do outputDebugString(tostring(i).." "..tostring(v)) end setElementData(v, "fuel", 100); setElementData(v, "type", "work"); end
  2. local vehicles = { {2588.5, 1830.59998, 11.1, 0, 0, 270 }, {2606.3999, 1837, 11.1, 0, 0, 90 }, {2606.30005, 1843.30005, 11.1, 0, 0, 90 }, {2606.30005, 1849.69995, 11.1, 0, 0, 90 }, {2606.3999, 1856.09998, 11.1, 0, 0, 90 }, {2606.30005, 1862.69995, 11.1, 0, 0, 90 }, {2606.3999, 1830.69995, 11.1, 0, 0, 90 }, {2588.3999, 1856.09998, 11.1, 0, 0, 270 }, {2588.30005, 1849.80005, 11.1, 0, 0, 270 }, {2588.3999, 1843.40002, 11.1, 0, 0, 270 }, {2588.30005, 1862.80005, 11.1, 0, 0, 270 }, {2588.3999, 1837, 11.1, 0, 0, 270 }, {2606.3999, 1815.09998, 11.1, 0, 0, 90 }, {2606.3999, 1808.59998, 11.1, 0, 0, 90 }, {2588.19995, 1808.69995, 11.1, 0, 0, 270 }, {2606.30005, 1802.19995, 11.1, 0, 0, 90 }, {2606.3999, 1795.90002, 11.1, 0, 0, 90 }, {2606.5, 1789.59998, 11.1, 0, 0, 90 }, {2588.19995, 1802.40002, 11.1, 0, 0, 270 }, {2588.19995, 1815.09998, 11.1, 0, 0, 270 }, {2588.3999, 1795.90002, 11.1, 0, 0, 270 }, {2606.5, 1783.40002, 11.1, 0, 0, 90 }, {2588.3999, 1789.90002, 11.1, 0, 0, 270 }, {2588.3999, 1783, 11.1, 0, 0, 270 } }; for index, item in ipairs (vehicles) do v = createVehicle(431, item[1], item[2], item[3]); setElementData(v, "fuel", 100); setElementData(v, "type", "work"); end Try this
  3. The first table is already called, the value of the classes is a table, now I want to get THAT table(which in that case defined in classes, so in my eyes it must return the table value), but instead of returning the table, it returns nil.
  4. So here's what I have: A table(client & server) class = { { police={ guard = {STR=3, DEF=3, INT=3, STA=3, HAN=3, INV=3, WEP=3, RES=3, PER=1}, supervisor = {STR=5, DEF=5, INT=5, STA=5, HAN=5, INV=5, WEP=5, RES=5, PER=1} }, Prisoner={ fresh = {STR=3, DEF=3, INT=3, STA=3, HAN=3, INV=3, WEP=3, RES=3, SLT=1}, hardened = {STR=5, DEF=5, INT=5, STA=5, HAN=5, INV=5, WEP=5, RES=5, SLT=1} } } } A clientside for loop in a seperate file (for testing purposes i only output strings) for pIndex, classes in ipairs(class) do --Loop the classes outputDebugString(tostring(pIndex).." "..tostring(classes)) for index, classPackage in ipairs(classes['police']) do outputChatBox(tostring(index).." "..tostring(classPackage)) end end And this error in merely EVERY attempt As you can see I'm trying to retreive a table value in the 2nd for loop, But even if I remove the ['police'] part out of the table, I get no error, but also no string. Why isn't this working? I've been editing this for nearly 2 hours!
  5. I tested it and it does support : tags. I use the trigger for a purpose, I discovered that the addEvent does work in the script itself, but for some reason it doesnt work when I put it in the global file.
  6. The issue is as followed: I have a serverside event calling a clientside event, but it doesnt trigger at all. I have tried several attempts, but I get nothing. Not even a debugmessage both on the console, nor the debugscript. Client addEventHandler("account:login:attempt", getRootElement(), function() outputChatBox("Hello") fadeCamera(true) setCameraTarget(client, client) setCameraMatrix(0, 0, 5, 100, 100, 10) end ); Server addEventHandler("onPlayerJoin", getRootElement(), function() -- I tried to remove the source on the first argument aswell, no results whatsoever, I tried getRootElement(), same results triggerClientEvent(source, "account:login:attempt", source) end ); Global(client & server) addEvent("account:login:attempt", true)
  7. I'm using ElementData, not AccountData, everything is being exported to the MySQL
  8. When a player disconnects, I'd like to save all their statistics, but so far the database isn't getting updated at all, what is incorrect in my coding? Nothing shows up in the debug either: I let you know that I had a for loop on the player element, but that caused other issues. local mysql=exports.mysql function savePlayer(reason) outputChatBox( tostring(source) ) local vehicle = getPedOccupiedVehicle(source) if (vehicle) then local seat = getPedOccupiedVehicleSeat(source) triggerEvent("onVehicleExit", vehicle, source, seat) end local x, y, z, rot, health, armour, interior, dimension local x, y, z = getElementPosition(source) local rot = getPedRotation(source) local health = getElementHealth(source) local armor = getPedArmor(source) local interior = getElementInterior(source) local dimension = getElementDimension(source) --money = getElementData(source, "money") local skin = getElementModel(source) mysql:query_free("UPDATE characters SET x='" .. mysql:escape_string(x) .. "', y='" .. mysql:escape_string(y) .. "', z='" .. mysql:escape_string(z) .. "', rotation='" .. mysql:escape_string(rot) .. "', health='" .. mysql:escape_string(health) .. "', armor='" .. mysql:escape_string(armor) .. "', dimension_id='" .. mysql:escape_string(dimension) .. "', interior_id='" .. mysql:escape_string(interior) .. "' WHERE id="..(mysql:escape_string(tonumber(getElementData(source, "character:id"))))) end end addEventHandler("onPlayerQuit", getRootElement(), savePlayer) addEvent("savePlayer", false) addEventHandler("savePlayer", getRootElement(), savePlayer) addCommandHandler("saveall", savePlayer)
  9. I used this to test if the cursor was showing: function isTheCursorShowing() if (isCursorShowing(true)) then outputDebugString("cursor is showing") else outputDebugString("cursor is not showing") end end addCommandHandler("cursor", isTheCursorShowing) The result was that the cursor wasn't showing according to the script, but I had the guiSetInputEnabled(true) in my login GUI, after adding guiSetInputEnabled(false) in the function, the cursor disappeared.
  10. I have tested it, but the Cursor is still showing. UPDATE: I forgot I had a guiSetInputEnabled() in the function, it's now resolved: addEvent("closeLoginWindow", true) addEventHandler("closeLoginWindow", getLocalPlayer(), function() if (isElement(wdwMain)) then showCursor(false) guiSetInputEnabled(false) destroyElement(wdwMain) wdwMain, mainLogo, edtUsername, edtPassword, btnlogin, btnRegister = nil end end );
  11. Might do that, but if that fixes the showCursor issue. I'll try that.
  12. Alright, I made a closeLoginWindow event, it does work, but when it comes down to disabling the cursor, nothing happens, I made the debugstring to check if it passes through and it does, giving me the debugstring. Client: addEvent("closeLoginWindow", true) addEventHandler("closeLoginWindow", getLocalPlayer(), function() if (isElement(wdwMain)) then destroyElement(wdwMain) wdwMain, mainLogo, edtUsername, edtPassword, btnlogin, btnRegister = nil end if (isCursorShowing()) then outputDebugString("Well, showcursor is being a complete bitch!") showCursor(false) end end );
  13. I have found bugs and spelling mistakes in the Dutch language. Translators included code commands, but the commands display as strings.
  14. Nevermind.. It's fixed . Thanks for the reply though. I had a timer set before I destroyed the element, that's why it showed the code, just the wrong line lol
  15. Bad Argument @ 'destroyElement'[expected element at argument 1] Well...it DOES remove the object, but why do I get this message?
  16. Where is your colshape? and like tete said. What is your purpose of getting the player's skin function openGates(thePlayer) moveObject(lsAirportGate1, 1000, -2864.300488281, 455.10000610352, 5.5999999046326) end addEventHandler("onColshapeHit", LSAirportCol, openGates) function closeGates(thePlayer) moveObject(lsAitportGate1, 1000, -2863.300488281, 463.79998779297, 5.5999999046326, 5.5999999046326 end addEventHandler("onColshapeLeave", LSAirportCol, closeGates) Try that.
  17. What I want to do is as followed. In the script I made an object, the object moves and after all those objects have been touched, I want them to be deleted, but... As far as Ive seen there's no such thing as destroyObject or anything except for destroyElement, but that clearly doesnt work out for objects since they expect an element, not an object. How can I get rid of those objects without duplicating them?
  18. Well, It's going to take a long time since I'm not that experienced in coding. Right now i'm tweaking around a bit. When I get the hand of it and everything works and it does fix those timer issues. i'd put it in.
  19. We're using MySQL to connect to our UCP. the xml files are mainly used to log a lot of chats. A lot of timers are used for things like paydays. reviewing all the script requires a lot of work, figuring out a good alternative might be harder.
  20. There are over 8000 items in the resources (images, xml files, lua files, etc) it takes up to 189Mb. On my development server I don't get any lag for good reasons. but if that's turned to a public server, overtime I will get the same results.
  21. From what i've heard from the developers of the script, there's a lot of them in some resources like payday, also with the use of world-items trying to render everything to the player. That's what is causing the lag. So I might need to figure out a way to reduce the amount of timers, it'll require some tiem & research I guess.
  22. We got xml files for things such as manuals, help commands and a few items use them to store data like notes. biggest files are less then 200 kb and we have a total of 588 files, the majority are under 66 kb
  23. Hello, Ever since I joined MTA from the veryu beginning, my main interest were Roleplay servers. I joined a few in the past, but they all got the exact same problems. The longer the server is up, the more data it stores. The more data the server get's , the longer it takes for it to load. Everyone knows that. But what really pisses people off is that it affects the overall gameplay. For example: I've been in MTA:RP for almost a year. And I see the performance of the server going backwards even though we have upgraded our server. With a new CPU you'd think the lag would reduce. Now I know that my laptop isn't the greatest to play GTA in the first place, but when I joined the common Race, RPG, zombie, freeroam server. My Framerate got up to 45 - 60 while in my own server I get nothing more then 9-10 on average. Other then the server has been DDoSsed and is still a target of the attackers (and I know we are not the only one being DDoSsed, I've seen a lot of servers going down by DDoSSers). Even without those stupid attacks, the server lags. Recently I have checked the items the server has. It's over 230,000 items. A lot of them are gone, but our MySQL still reads through all those lists. As I fear, there are a lot of scripts in various resources who have endless loops in them. Yes I want to get rid of them, but I need to select it carefully. But what I am looking for is the following: - A way to end the lag caused by the scripts - A solution to the unnessesary data checking. - A way to get rid of memory occupied useless scripts. We use MySQL How can I resolve & figure out what scripts are pretty much useless yet the players do not suffer from it? For the ones interested, here I monitored the timer.log for approx 20-30 minutes. I couldn't upload it to pastebin since it's over 500 kb. http://puu.sh/29SA5
  24. They load from the start don't they? Im quite new to scripting / xml functions so I'm having some trouble with it.
×
×
  • Create New...