developa
Members-
Posts
57 -
Joined
-
Last visited
Everything posted by developa
-
Download?
-
hello, I have a problem with the fetchRemote function, exactly this condition does not work for me: fetchRemote: fetchRemote(..., callback, "", false, client) function callback(response, errno, player) if errno == 0 then -- worked outputConsole(response) -- when 'success' is shown, the condition below is not executed, 'else' is fulfilled if response == "success" then -- error :( outputConsole("worked") -- never shows, even if 'response' is written 'success' below else outputConsole(response) -- here the second message 'success' will be shown :( end end end help! sorry for my english
-
hello, can you use the object attribute in html in cef in mta? code html: <html> <head> <title>test object</title> </head> <body> <object data="object.swf" type="application/x-shockwave-flash" width="1000" height="500"></object> </body> </html> code lua: local x,y=guiGetScreenSize() local ui=guiCreateBrowser(0,0,x,y,true,true,false) addEventHandler("onClientBrowserCreated",ui,function() loadBrowserURL(source,"http://mta/local/index.html") end) this code not worked, does mta include the swf format?
-
Hello. I'm building up an MTA-PHP-SDK and trying to send a call to a resource, I can not - it pops up this error: [2017-10-05 15:06:31] Authorized serial account protection is enabled for the ACL group(s): `Admin` See https://mtasa.com/authserial I've tried many things, including turning it off in mtaserver.conf, but it still appears, any suggestions? Code from mtaserver.conf: <!-- This parameter lists the ACL groups that are protected by serial authorization. Login attempts to a protected account from a second serial are blocked until the serial is manually authorized via the authserial command. For more info see: https://mtasa.com/authserial Note: This is security critical feature and disabling auth_serial_groups can affect visibility in the master server list. Values: Comma separated list of ACL groups. Default - Admin --> <auth_serial_groups></auth_serial_groups> <!-- This parameter specifies if the authorized serial login checks should also apply to the http interface. Protected account login attempts to the http interface will only succeed if the IP address matches one recently used by the account holder in-game For more info see: https://mtasa.com/authserialhttp Note: This is security critical feature and disabling auth_serial_http can affect visibility in the master server list. Values: 0 - Off, 1 - Enabled. Default - 1 --> <auth_serial_http>0</auth_serial_http>
-
How to optimize this code? local imagePosX,imagePosY,imagePosZ = -21.38184, 5.24524, 3.10965 addEventHandler("onClientPreRender", root, function() local position = {getScreenFromWorldPosition(imagePosX, imagePosY, imagePosZ)} if position[1] and position[2] then local ceiling = math.ceil local distance = (Vector3(localPlayer.position)-Vector3(imagePosX, imagePosY, imagePosZ)).length dxDrawRectangle((position[1]+10/2)-5, position[2]+10/2, dxGetTextWidth(ceiling(distance), 0.6, "default-bold")+10, 20, tocolor(255, 0, 0), false) dxDrawText(ceiling(distance), position[1]+10/2, position[2]+10/2, 10, 10, tocolor(0, 255, 0), 1, "default-bold") end end)
-
@Mr.Loki How to create 3d image with get screen from world position, but with the same image size, even if i am away from that position. 100 dist from image = size=200 I want to do it so: 200 dist from image = The same sizes of image as on 100 dist Image is always as big as i want even if i am much distance from that position How to do??? My code, Here the picture increases with respect to distance, and I want to do as I described above. local element = createVehicle(411, 0, 0, 0) addEventHandler("onClientRender", root, function() local playerPosition = {getElementPosition(localPlayer)} local elementPosition = {getElementPosition(element)} local distance = math.floor(getDistanceBetweenPoints3D(elementPosition[1], elementPosition[2], elementPosition[3], playerPosition[1], playerPosition[2], playerPosition[3])) local coords = {getScreenFromWorldPosition(elementPosition[1], elementPosition[2], elementPosition[3]+0.3)} local clear = isLineOfSightClear(elementPosition[1], elementPosition[2], elementPosition[3], playerPosition[1], playerPosition[2], playerPosition[3], false, false, false, false, true, false, false, nil) if coords[1] and clear then dxDrawText(distance.."m", coords[1], coords[2], coords[1], coords[2], tocolor(255, 255, 255, 255), 2, "default-bold", "center", "center", false, false) dxDrawImage(coords[1], coords[2], 64, 64, "asd.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end end) Help, please
-
If I send it to the client side, it will update for the specified players in the marker or change it triggerClientEvent(v, "refresh", resourceRoot) on triggerClientEvent(tostring(v), "refresh", resourceRoot) ? Both versions do not work! The trigger does not send at all. What to do?
-
Hello, how to download players using this feature? I need this to refresh the data for the players in the marker. function getElementsWithinMarker(marker) if (not isElement(marker) or getElementType(marker) ~= "marker") then return false end local markerColShape = getElementColShape(marker) local elements = getElementsWithinColShape(markerColShape) return elements end I tried this way: addEvent("buy" true) addEventHandler("buy", resourceRoot, function() local players = getElementsWithinMarker(marker) for i,v in ipairs(players) do outputChatBox(v) triggerClientEvent(v, "refresh", resourceRoot) end end) outputChatBox(v) - here is the warning - bad argument @ 'outputChatBox' [expected string at argument 1, got text] Help!
-
Hi, can I turn this into a more optimal way? addEventHandler("onPlayerConnect", root, function(nick) if string.find(nick, "#") or string.find(nick, "?") or string.find(nick, "!") then cancelEvent(true, "Change nickname!") end end) For example nick:find("#")?
-
Hello, which name in this function (SetWorldSoundEnabled) belongs to car sounds ie braking, gas addition and the like?
-
Hello, I would like to make a script for a fire hose. I already have half, but now I have one problem - I do not know how to get around the fire hose. Can anyone help me? Below I upload a part of the movie (there is what I want to get in my code moment in the movie: 0:26) Code: local firehose = {} local texture = dxCreateTexture("line.png") addCommandHandler("hose", function() firehose[1] = {x=2495.24, y=-1653.7, z=12.5} end) addEventHandler("onClientRender", root, function() local bx, by, bz = getPedBonePosition(localPlayer, 35) local position = firehose[#firehose] local x,y,z = position.x, position.y, position.z if getDistanceBetweenPoints3D(bx, by, bz, x, y, z) > 1 then table.insert(firehose, {x=bx, y=by, z=getGroundPosition(bx, by, bz)}) end for i=1,#firehose do if not firehose[i+1] then local p = firehose[i] dxDrawMaterialLine3D(p.x, p.y, p.z+0.2, bx, by, bz+0.2, texture, 0.13) end if firehose[i] and firehose[i+1] then local p = firehose[i] local b = firehose[i+1] dxDrawMaterialLine3D(p.x, p.y, p.z+0.2, b.x, b.y, b.z+0.2, texture, 0.13) end end end)