Jump to content

opnaiC

Members
  • Posts

    156
  • Joined

  • Last visited

Everything posted by opnaiC

  1. I tried to reinstall it 3 times. But it is always the same problem. The file is not missing. It is in the MTA path.
  2. Hi, I am using a little server with windows server 2008. I have this problem when I try to start the mta server:
  3. https://wiki.multitheftauto.com/wiki/Database https://www.w3schools.com/sql/sql_intro.asp
  4. Hello guys, on this forum you can find a resource where you can convert GTA maps to a MTA resource. My question is now how can I edit this map. When you are converting this map you can chouse between 3 "streaming" methods: streaming, distance, static. I tried to load the map on the server and remove all default map objects to edit the map. But the problem is that the models are not replacing on the server when I start the editor. But other way it is working when I am not using the map editor. I tried all 3 methods.
  5. So look: Now the spawning cmd is working and also all vehicles disappear when the player leaves the game. When I use the /dveh cmd, the last vehicle that I spawned got delete. But when I use the cmd again the next last spawned vehicle doesnt disappear. This is the error (line 300 is the line with destroyElement in the /dveh cmd) (Why we are not removing the vehicle from the table that got deleted ?)
  6. After using ur script my chatbox start buging, the script is also not working complety. The /dveh command is not working.
  7. addEventHandler("cmdHandler",getRootElement(), function(thePlayer, command, model) local serverTime = getRealTime() local time = string.format("[%02d:%02d:%02d]", serverTime.hour, serverTime.minute, serverTime.second) if(command == "/cveh") then if tonumber(model) then local x, y, z = getElementPosition (thePlayer) local veh = createVehicle (tonumber(model), x, y, z, 0, 0, 0, "ADMIN") table.insert (vehicles, 1, {thePlayer, veh}) setElementPosition (thePlayer, x, y, z +2) return else sendMessageToPlayer ("#ce3737"..time.." Формат команды: '/cveh [model]'", thePlayer) return end end local time = nil end ) Fully working command. If I want now to delete the las spawned vehicle I use this and it works: addEventHandler("cmdHandler",getRootElement(), function(thePlayer, command) if(command == "/dveh") then for i, v in ipairs (vehicles) do local player, veh = unpack(v) if (player == thePlayer) then destroyElement (veh) table.remove (vehicles, i) return end end end end ) But now I want a function where all vehicles that a certain player spawned get deleted when he leave the game.
  8. Sorry I posted the wrong command. I have my own chat so I dont need the commandHandler. So basically I want all cars to disappear that the player spawned that left. addEventHandler ("onPlayerQuit", getRootElement(), function () for i=1,#vehicles do local player, veh = unpack(vehicles[i]) if (source == player) then destroyElement(veh) table.remove(vehicles, i) end end end )
  9. local vehicles = {} addEventHandler("cmdHandler",getRootElement(), function(thePlayer, command) if(command == "/dveh") then for i, v in ipairs (vehicles) do local player, veh = unpack(v) if (player == thePlayer) then destroyElement (veh) table.remove (vehicles, i) return end end end end ) Hi, I want the script to delete all vehicles and rows, but it only deletes the last one, why ?
  10. They are replaced. But when I start the map editor they change to the default one.
  11. opnaiC

    set skin

    What is the event handler and what do you want to do?
  12. Hi guys, I converted a map to mta and its working. But now I want to edit it. When I start the map on the map editor, the new textures and models doenst apply on the old gta sa models. So its impossible to edit the map, because I only see the old gta sa models and not the new replaced models.
  13. I know I did it now, when you posted this message . Thank you. Its working. So, I have to save the message that got deleted in another table if I want to do a scroll function and return them to the table, right ? Like that: elseif (i > 13) then table.insert (chatboxBuffer, v[1]) table.remove (chatbox, 1) end
  14. It is also not working correctly. I show you a picture maybe you can help me. In the output you can see the text and then the index number. So I want the text with the index 1 to disappear (it should be in the table but not visible). Now I want the new message to output where you can see the text with the 13th index number. The other outputs should move up. BUT the old output should save, so I have it easier to do a scroll function later.
  15. local offset = 14 function drawChat() for i, v in ipairs (chatbox) do if (i < offset) then exports.login:dxDrawBorderedText(v..", "..i, 36, (210 - ((offset-i)*15)), 411, 210, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) elseif (i > 13) then table.insert(chatbox, 1, chatbox[i]) end end end addEventHandler ("onClientRender", root, drawChat) Tried this but the game starts freezing. ... Maybe because auf the eventHandler.... I can´t find a solution.
  16. Hello, I am scripting a new chat and the stuff I scripted is working. But now I have a problem. In my chat I am printing the first 13 messages in dxDraw. But now I want all indexes to +1, so if there come a 14th message it gets visible. local offset = 14 function drawChat() for i, v in ipairs (chatbox) do if (i < offset) then exports.login:dxDrawBorderedText(v, 36, (210 - ((offset-i)*15)), 411, 210, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) elseif (i == 14) then --what to add ? I want all index to +1, so the new message will get the first index end end end addEventHandler ("onClientRender", root, drawChat)
  17. I already fixed it myself, there was a problem with the index. But thank you for your answer
  18. Hi guys, I made a chatbox script myself and all is working perfectly with no errors or warnings in /debugscript 3. I am using a table to save the messages that will be displayed in the chatbox. This is how a part of it looks like: local chatBox = {} function drawChat() for i,v in ipairs (chatBox) do if i < 15 then dxDrawBorderedText(v, 27, 229 - 15*i, 582, 230, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, false, false, false) end end end addEventHandler("onClientRender", root, drawChat) I have no problems to display the first 14 messages, but now I want the last ( first message) to disappear when there comes a new 15th message. But I have no idea how to script it. So it could be nice if someone could help me.
  19. Hello guys, I tried to bind escape to my function in 2 ways. (the function is working tried with other buttons) The first was bindKey but when I use it its not binding escape but all other buttons. When I use the event onClientKey escape is working but not correctly. When I press it the first time its working but when I press it the second time its not working. (so its not working when the player is in the menu) (btw its a AFK system I made) this way is not working: bindKey ( "escape", "down", function ) this was isnt working correctly (this is what I found on wiki: Note: the escape key can only be cancelled once. If a user presses the escape key twice in a row the main menu will still open. ): function pressDown (button, press) if button == "escape" then if press then -- when the button is pressed down (true) function() end end end addEventHandler ("onClientKey", root, pressDown) Guys I hope you can help me with that
  20. addEventHandler('onClientResourceStart', resourceRoot, function() texture = dxCreateTexture("img/radar_map.jpg") if (texture) then dxSetTextureEdge(rt, "border", tocolor(0, 255, 0)) end end ) ... if (not isPlayerMapVisible()) then local mW, mH = dxGetMaterialSize(rt) if ( alwaysRenderMap or getElementInterior(localPlayer) == 0 ) then dxSetRenderTarget(rt, true) local x, y = getElementPosition(localPlayer) local X, Y = mW/2 -(x/(6000/worldW)), mH/2 +(y/(6000/worldH)) local camX,camY,camZ = getElementRotation(getCamera()) dxDrawImage(X - worldW/2, mH/5 + (Y - worldH/2), worldW, worldH, texture, camZ, (x/(6000/worldW)), -(y/(6000/worldH)), tocolor(255, 255, 255, 255)) dxSetRenderTarget() Something is wrong, because only the left border is green ..
×
×
  • Create New...