Search the Community
Showing results for tags 'solved'.
-
Hello! I want to create a building that has a LOD model. How can I achieve this? You can see in the images that I can make it have a LOD model with object, but not with building. Building: local lod = createBuilding(4187, 0, 0, 3, 0, 0, 0) local building = createBuilding(4014, 0, 0, 3, 0, 0, 0) engineSetModelLODDistance(4014, 300) setLowLODElement(building, lod) Object: local lod = createObject(4187, 0, 0, 3, 0, 0, 0, true) local object = createObject(4014, 0, 0, 3, 0, 0, 0) engineSetModelLODDistance(4014, 300) setLowLODElement(object, lod)
-
Now I have 2 servers. I want to send the current player count every time there is onPlayerJoin and onPlayerQuit from server 1 to server 2. However, I could send the data from the 1st server to the 2nd server, but the 2nd server could not send the data to the 1st server, now none of them can send it and it gives a TIMED OUT error. Port 22005 is open on both servers, I gave HTTP authorization from ACL and meta.xml, but it still does not work. I searched a lot and couldn't find a solution, please help. server.lua file of the 1st server. function getPlayerCount() return #getElementsByType("player") end function joinQuit() callRemote("http://185.136.206.116:22005/cdm_connection/call/getPlayerCount", function(responseData, errorID) responseData = tostring(responseData) if responseData == "ERROR" then outputDebugString("callRemote: ERROR #" .. errorID) elseif not tonumber(responseData) then outputDebugString("callRemote: Unexpected reply: " .. responseData) else print(tonumber(responseData)) setElementData(root, "cdm", tonumber(responseData)) end end) end addEventHandler("onPlayerJoin", root, joinQuit) addEventHandler("onPlayerQuit", root, joinQuit) addEventHandler("onResourceStart", resourceRoot, joinQuit) server.lua file of the 2nd server. function getPlayerCount() return #getElementsByType("player") end function joinQuit() callRemote("http://193.223.107.111:22005/cr_connection/call/getPlayerCount", function(responseData, errorID) responseData = tostring(responseData) if responseData == "ERROR" then outputDebugString("callRemote: ERROR #" .. errorID) elseif not tonumber(responseData) then outputDebugString("callRemote: Unexpected reply: " .. responseData) else print(tonumber(responseData)) setElementData(root, "cdp", tonumber(responseData)) end end) end addEventHandler("onPlayerJoin", root, joinQuit) addEventHandler("onPlayerQuit", root, joinQuit) addEventHandler("onResourceStart", resourceRoot, joinQuit) And this is the TIMED OUT error: https://imgur.com/6wIOIEe Please help.
-
Hello, I am adding texture to the models using engineImportTXD, but when I enter the 8th id, no texture is assigned to this model. What is the reason for this? local txd = engineLoadTXD ("burlova_city.txd") engineImportTXD(txd, 1879,1947,1881,1902,1930,1880,1905,1938) --not working local txd = engineLoadTXD ("burlova_city.txd") engineImportTXD(txd, 1938) --working bug image https://ibb.co/2gJRrJm
-
Hello everyone! How do I disable horizontal gridlist scroll? I want to have it only scrolling vetically. GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 544) / 2, (screenH - 401) / 2, 544, 401, "Vehicle & Tend Finder", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.77) GUIEditor.button[1] = guiCreateButton(176, 350, 77, 37, "Locate", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(263, 350, 77, 37, "Close", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") GUIEditor.gridlist[1] = guiCreateGridList(538, 274, 524, 309, false) guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.2) guiGridListAddColumn(GUIEditor.gridlist[1], "X", 0.2) guiGridListAddColumn(GUIEditor.gridlist[1], "Y", 0.2) guiGridListAddColumn(GUIEditor.gridlist[1], "Z", 0.2)
-
Hi everyone, I would like to ask how do I add a blip with this GPS? I would like to use this one. createBlip( x, y, z, 18, 0, 0, 0, 255, ) And implement it to this code, here it is. local sW,sH = guiGetScreenSize(); local worldW,worldH = 3072/2,3072/2; local blip = 25; local rt = dxCreateRenderTarget(180,130); local frameW,frameH = 210,200; local gpsW,gpsH = 168,120; local xOffset = 3; function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)); if (t < 0) then t = t+360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90-angle); local dx = math.cos(a)*dist; local dy = math.sin(a)*dist; return x+dx, y+dy; end addEventHandler("onClientRender",root,function() if (getElementData(localPlayer,"logedin") and getElementData(localPlayer,"GPSRadar") >= 1) then if exports.e_map:isPlayerMapVisible() then return; end local mW,mH = dxGetMaterialSize(rt); local camX,camY,camZ = getElementRotation(getCamera()); local playerX,playerY,playerZ = getElementRotation(localPlayer); local x,y = getElementPosition(localPlayer); local xx,yy = mW/2-(x/(6000/worldW)), mH/2+(y/(6000/worldH)); local xFactor,yFactor = 15,sH-frameH+23; local cX, cY = gpsW/2+xFactor, gpsH/2+yFactor; dxSetRenderTarget(rt,true); dxDrawRectangle(0, 0, mW, mH, 0xFF7CA7D1); dxDrawImage(xx-worldW/2,yy-worldH/2+20,worldW,worldH,"images/world.jpg",camZ,(x/(6000/worldW)),-(y/(6000/worldH))); --outputChatBox("x: "..(mW/2-(x/3072)).." y: "..(mH/2-(y/3072))) dxDrawImage(mW/2-(x/3072)-(blip/2),mH/2-(y/3072)-(blip/2)+20,blip,blip, "images/player.png", camZ-playerZ, 0, 0, tocolor(255, 0, 0, 255)); dxSetRenderTarget(); dxDrawImage(xOffset+6+xFactor,yFactor,gpsW,gpsH,rt); local toLeft, toTop, toRight, toBottom = cX-gpsW, cY-gpsH, cX+gpsW, cY+gpsH; for _,v in ipairs(getElementsByType("player")) do local gang = getElementData(localPlayer,"gang") or "None"; if (gang ~= "None") then if (getElementData(v, "gang") == gang and v ~= localPlayer and not getElementData(v, "isDead")) then local bx, by = getElementPosition(v); local _,_,ppZ = getElementRotation(v); local actualDist = getDistanceBetweenPoints2D(x, y, bx, by); local maxDist = 600; if (actualDist <= maxDist) then local dist = actualDist/(6000/((worldW+worldH)/2)); local rot = findRotation(bx, by, x, y)-camZ; local bpx, bpy = getPointFromDistanceRotation(cX, cY, math.min(dist, math.sqrt(toTop^2 + toRight^2)), rot); local bpx = math.max(xFactor+3, math.min(xFactor+gpsW, bpx)); local bpy = math.max(yFactor-17, math.min(yFactor-20+gpsH, bpy)); dxDrawImage(bpx-(blip/2)+xOffset+6, bpy+5, blip, blip, "images/player.png", camZ-ppZ, 0, 0, tocolor(0, 0, 255, 255)); end end end end end end);
-
As shown on the image, im having cd16 error when im entering to the server. Before the first attempt to fix the issue, which was re-downloading the game, i was able to getting to the login screen without being kicked but i was being stuck in that screen after attempting to login to my already existing account, it kept staying on the loading screen with that one loading symbol on the login button but it didnt do anything more. https://media.discordapp.net/attachments/849577065607200818/1214315856994115625/image_2024-03-04_183411380.png? 5 minutes ago i was able to join to "server name #7" and have mb loaded and see the login screen, logged in as well. saw the loading screen with s15 but then it kicked me saying "close the enb" even tho i didnt had enb on or anything similar to it, i restarted the game while hoping for it to be fixed. after restarting i opened the game and joined to "server name #7" and it kicked me with error cd16 message again. Just to state, i dont have any enb or any modification to game files, my files are totaly original from the steam source of gta sa. https://cdn.discordapp.com/attachments/849577065607200818/1214316369353641994/4lKC-M4e05M.png Also just to state, the server is a russian server and im living in turkey. I was able to join to the server months ago without any issue, just had to use vpn because of my internet provider blocking certain russian ip's but now even using vpn doesnt fix
-
Good Evening ! i've just installed today MTA San Andreas after alot of years, trying to play in a older server i knew and after 4 minutes ,"kinda", it kickes me with the related code i admit my pc was used for gaming / mining (old times) and i dont know anymore what the AC likes or not here my pastebin : https://pastebin.mtasa.com/1502014594
-
Hi, I would like to ask how can I check the player's serial on the server side and send it to the client? -- Server side function isPlayerAllowed(player) return allowedPlayers[getPlayerSerial(player)] ~= nil end -- Client side function handleKey(button, press) if not imagesEnabled and press and getKeyState("mouse2") then return false for i, allowedImage in ipairs(allowedImages) do if button == allowedImage.key then if isPlayerAllowed(localPlayer) then ... end end end end addEventHandler("onClientKey", root, handleKey)
-
solved Need help guys! Client & Server: External HTTP file mismatch
J4cobLIVEmain posted a question in Server
Hello there guys! I think I might have a pesky bug involving admin. It all started today when I tried to login to my server as an admin, it shows this: HTTP server file mismatch! (admin) admin_gui.lua [CRC could not open file: Permission denied] Also when I join other servers, same message appears as if i would have admin on that particular server i wouldn't be able to access it: External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\admin_client.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\admin_gui.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\admin_ACL.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_main.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_performance.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_maps.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_messages.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_message.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_moddetails.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_spectator.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_messagebox.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_inputbox.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_team.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_skin.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_stats.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_vehicle.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_interior.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_ban.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_warp.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_report.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_acl.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_settings.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\gui\admin_screenshot.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\client\colorpicker\colorpicker.lua] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\conf\interiors.xml] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\conf\weathers.xml] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\conf\upgrades.xml] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\conf\skins.xml] External HTTP file mismatch (Retrying this file with internal HTTP) [admin\conf\stats.xml] When i try to access admin panel i see this: A broken admin panel without any function there working. Is there a problem on MTA end or is it temporary my net / server provider or generally game bug? Reply would be appreciated! -
Hello writers, good morning. I would like to know more about getElementMatrix, how does it work? What does it mean the data is what is returned to me? According to what I read on the wiki, it returns 4 'tables', with coordinates, but what does each of them mean? Might be interesting for more of an explanation on how matrices work in this game. We can take as an example, a vehicle. local vehicle = createVehicle(411, 1892, -2418, 13.5) setElementFrozen(vehicle, true) for k, v in pairs(getElementMatrix(vehicle)) do outputChatBox("index "..k.." = "..v[1]..", "..v[2]..", "..v[3]..", "..v[4]) end --[[ Return: index 1 = 1, -1.7484555314695e-07, 1.7484555314695e-07, 1 index 2 = 1.7484558156866e-07, 1, -1.7484555314695e-07, 1 index 3 = -1.7484552472524e-07, 1.7484558156866e-07, 1, 1 index 4 = 1892, -2418, 13.5, 1 ]] index 4 by deduction gives me the proper position of the vehicle, and what are the rest of the values? For more information, what I'm trying to do, is to always get the underbody of a vehicle. They told me that I could get it with this function, but without saying anything else. I'm doing math with getElementBoundingBox and getGroundPosition, but I can't get much of it right now, since my coords are getting out of phase when the vehicle is rotating. Perhaps with an explanation of what those values are, I can get closer to the result I'm looking for. Sorry for the bad grammar, I'm using google translate.
-
every time i teleport through map function on coordinates i get stuck in a black screen, until i kill myself. is that i am doing something wrong or is there some other issue. thanks
-
So, after i built the project using the Build -> Build Solution i tried to run MTA, but a msgbox appeared saying that it cannot find netc_d.dll. Could someone help me? Thanks in advance.