Odonton

Members
  • Content count

    15
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Odonton

  • Rank
    Square
  1. Help with function "countPlayersInRange"

    Wow, thanks, You are amazing, really thank you very much for everything, but I would feel badly demanding that you make me your codes. What if, now I have another problem, it results that we mapped a beautiful lobby, with landing strip, a crashed plane and so, but it works once, then disappears and I have to restart the resource "map" so that it is functional again, there some command to not restart, something like to fix the GM? :c
  2. Help with function "countPlayersInRange"

    I really do not quite understand what I should do, when you refer to "Output the elements of the player with a for loop", apologize, I feel like an idiot asking things like this: /. By the way, we are doing a server type pubg c: if you want to tell us that such is sending you the ip by Internal? (there is an internal chat here, right?)
  3. Help with function "countPlayersInRange"

    The last help I ask: c, it turns out that when using the same code for the players counter in the area, trying to show it as text in my HUD always shows the number 0 even though I am inside the area, with the code above if I showed all the players on the server. If you are too busy to respond, you will understand, apologize for the inconvenience. The dxDrawText is in the line 29 function countPlayersInRange(x,y,z, range) local tempCol = createColSphere(x,y,z,range) players = getElementsWithinColShape(tempCol, "player") destroyElement(tempCol) return #players end function debugMonitor() if (showDebug or false) == true and (getElementData(localPlayer, "logedin") or false) == true then local debugmonitor = getElementData(getLocalPlayer(), "confdebug") local espera = getElementData(getLocalPlayer(), "aguardando") local perdeu = getElementData(getLocalPlayer(), "perdeucombate") local combate = getElementData(getLocalPlayer(), "combate") local ganhou = getElementData(getLocalPlayer(), "venceu") local vida = getElementData(getLocalPlayer(), "blood") local HpLine = 0.1960* (vida / 5000) local count = countPlayersInRange(4754.6508789063, -2038.6687011719, 2.3671875, 40) tostring(getPedTotalAmmo(localPlayer) - getPedAmmoInClip(localPlayer)) local screenW, screenH = guiGetScreenSize() dxDrawRectangle(screenW * 0.4007, screenH * 0.9635, screenW * 0.1960, screenH * 0.0264, tocolor(0,0,0, 155), false) dxDrawRectangle(screenW * 0.4007, screenH * 0.9635, screenW * HpLine, screenH * 0.0264, tocolor(255,255,255, 255), false) dxDrawRectangle(screenW * 0.9199, screenH * 0.0130, screenW * 0.0257, screenH * 0.0456, tocolor(0,0,0, 190), false) dxDrawRectangle(screenW * 0.9456, screenH * 0.0130, screenW * 0.0457, screenH * 0.0456, tocolor(255,255,255, 190), false) dxDrawText("ALIVE", screenW * 1.93, screenH * 0.02, screenW * 0.007, screenH * 0.05, tocolor(9,9,9, 150), 1.8, "default_bold", "center", "center") dxDrawText(""..count, screenW * 1.858, screenH * 0.015, screenW * 0.007, screenH * 0.05, tocolor(255,255,255, 255), 2, "default_bold", "center", "top") end end
  4. Project: MTA:Battlegrounds [MTA:BG]

    Thank you for your intervention! in fact, I try to create my own resources but to understand English I find it moderately difficult in these cases. I want to create an PUBG Server and then share my work (scripts) since it is very difficult to achieve it: /, I think we all benefit. Good night (in my country)
  5. Help with function "countPlayersInRange"

    WOW! Really thank you very much! are you the maximum, is there any way to give points or reputation in this forum? because you really deserve it
  6. Help with function "countPlayersInRange"

    I think it solved it by adding a content of an earlier window called "Function source", now it gives me the error that I can not compare it with a number because it is a boolean,: c, sorry for disturbing you
  7. Help with function "countPlayersInRange"

    Wow, I found it on the MTA Wiki, I thought it was true, I apologize for the inconvenience. Do you know of a similar function?
  8. Hoping that they are well, it turns out that I have a problem with my script, I want to make it work counting the players in an area and not the server to start the game. It gives me the global attempt to call countPlayersInRange (a nil value). function chekin( player )--CHECK INICIO local alive = countPlayersInRange(4754.6508789063, -2038.6687011719, 2.3671875, 40) if alive >= 8 and royale == false then -- mudar para 3 outputChatBox ( "#FFFFFF[ROYALE]:#FF0000INICIANDO PARTIDA BATTLE ROYALE", root, 0, 255, 0, true ) counter() elseif alive == 1 and royale == false then outputChatBox ("#FFFFFF[ROYALE]:#FF0000FALTA 7 JUGADORES", root, 255, 0, 0, true) elseif alive == 2 and royale == false then outputChatBox ("#FFFFFF[ROYALE]:#FF0000FALTA 6 JUGADORES", root, 255, 0, 0, true) elseif alive == 3 and royale == false then outputChatBox ("#FFFFFF[ROYALE]:#FF0000FALTA 5 JUGADOR", root, 255, 0, 0, true) elseif alive == 4 and royale == false then outputChatBox ("#FFFFFF[ROYALE]:#FF0000FALTA 4 JUGADORES", root, 255, 0, 0, true) elseif alive == 5 and royale == false then outputChatBox ("#FFFFFF[ROYALE]:#FF0000FALTA 3 JUGADOR", root, 255, 0, 0, true) elseif alive == 6 and royale == false then outputChatBox ("#FFFFFF[ROYALE]:#FF0000FALTA 2 JUGADORES", root, 255, 0, 0, true) elseif alive == 7 and royale == false then outputChatBox ("#FFFFFF[ROYALE]:#FF0000FALTA 1 JUGADOR", root, 255, 0, 0, true) end end If you could explain why this error occurs and how to solve it would be very helpful, thanks!
  9. Hola! necesito un poco de ayuda

    Saludos! Resulta que estoy intentando programar junto a un grupo de amigos un servidor de PUBG, la situacion es la siguiente, tenemos dos situaciones a solucionar: 1) Nos hemos basado en algun trabajo hecho a media que para terminar el juego cuenta que solo haya un jugador en el servidor, esto causa problemas ya que hay jugadores en el lobby, existe una funcion que cuente jugadores en cierta area? 2) Quisiese poner a todos los jugadores en un bus cuando inicie el juego, existe algun lugar donde pueda obtener informaciĆ³n sobre como enviar a todos los jugadores (sin importar el numero) a un bus?
  10. Project: MTA:Battlegrounds [MTA:BG]

    Well, that's enough to say, right? I think it was totally unnecessary to attack my failure in English
  11. Project: MTA:Battlegrounds [MTA:BG]

    Sorry for speaking another language and not knowing yours to perfection, MR. Trump Jr. It was a only question...
  12. Project: MTA:Battlegrounds [MTA:BG]

    U can share te inventory script?
  13. Hello! sorry for the inconvenience again, could anyone guide me or give me a code to be able to "project" or "show" the local player model in a GUI? I try to get an inventory like PUBG, but I still can not figure out how to link a specific weapon number. I also have the problem that when the ammunition of a weapon is just automatically reloaded, and when the ammunition reserve is finished it also "erases" the player's weapon.
  14. Hi, I'm trying to make an inventory, but I do not know how to hide it and display it with a key assigned. Try the following: Loading Script failed: Inventario\inv.lua:3: '(' expected near 'inventarioV' My code is the following: addEventHandler("onClientRender", root, function inventarioV() local ammo = tostring(getPedTotalAmmo(localPlayer) - getPedAmmoInClip(localPlayer)) local ammoinclip = tostring(getPedAmmoInClip(localPlayer)) local id = tostring(getPedWeapon( localPlayer )) local id2 = getPedWeapon( localPlayer ) local im = getWeaponNameFromID(getPedWeapon(localPlayer)) -- Imagenes dxDrawImage(screenW * 0.8779, screenH * 0.1380, screenW * 0.0029, screenH * 0.0169, ":Inventario/images/bullet.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.4081, screenH * 0.1094, screenW * 0.1838, screenH * 0.7813, ":Inventario/images/character.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.6963, screenH * 0.1719, screenW * 0.2110, screenH * 0.1055, ":Inventario/Inventory/"..id..".png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, tocolor(0, 0, 0, 165), false) dxDrawText(":Onacio", screenW * 0.4015, screenH * 0.0260, screenW * 0.5985, screenH * 0.0612, tocolor(255, 255, 255, 255), 1.50, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine(932 - 1, 102 - 1, 932 - 1, 122, tocolor(238, 237, 237, 111), 1, false) dxDrawLine(952, 102 - 1, 932 - 1, 102 - 1, tocolor(238, 237, 237, 111), 1, false) dxDrawLine(932 - 1, 122, 952, 122, tocolor(238, 237, 237, 111), 1, false) dxDrawLine(952, 122, 952, 102 - 1, tocolor(238, 237, 237, 111), 1, false) dxDrawRectangle(932, 102, 20, 20, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.1250) - 1, (screenW * 0.6096) - 1, screenH * 0.1771, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.1250) - 1, (screenW * 0.6096) - 1, (screenH * 0.1250) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.1771, screenW * 0.6390, screenH * 0.1771, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.1771, screenW * 0.6390, (screenH * 0.1250) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.1250, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.1901) - 1, (screenW * 0.6096) - 1, screenH * 0.2422, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.1901) - 1, (screenW * 0.6096) - 1, (screenH * 0.1901) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.2422, screenW * 0.6390, screenH * 0.2422, tocolor(251, 251, 251, 117), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.2422, screenW * 0.6390, (screenH * 0.1901) - 1, tocolor(251, 251, 251, 117), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.1901, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawText(""..im, screenW * 0.7037, screenH * 0.1328, screenW * 0.8279, screenH * 0.1589, tocolor(255, 255, 255, 255), 1.20, "default-bold", "left", "bottom", false, false, false, false, false) dxDrawText(""..ammoinclip, screenW * 0.8529, screenH * 0.1328, screenW * 0.8765, screenH * 0.1589, tocolor(255, 255, 255, 255), 1.20, "clear", "right", "bottom", false, false, false, false, false) dxDrawText(""..ammo, screenW * 0.8824, screenH * 0.1315, screenW * 0.9044, screenH * 0.1576, tocolor(255, 255, 255, 255), 1.00, "clear", "left", "bottom", false, false, false, false, false) dxDrawLine(screenW * 0.6831, screenH * 0.3073, screenW * 0.9316, screenH * 0.3073, tocolor(255, 255, 255, 255), 1, false) dxDrawText("1", 932, 102, 952, 122, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.3451) - 1, (screenW * 0.6096) - 1, screenH * 0.3971, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.3451) - 1, (screenW * 0.6096) - 1, (screenH * 0.3451) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.3971, screenW * 0.6390, screenH * 0.3971, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.3971, screenW * 0.6390, (screenH * 0.3451) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.3451, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.4102) - 1, (screenW * 0.6096) - 1, screenH * 0.4622, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.4102) - 1, (screenW * 0.6096) - 1, (screenH * 0.4102) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.4622, screenW * 0.6390, screenH * 0.4622, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.4622, screenW * 0.6390, (screenH * 0.4102) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.4102, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.4753) - 1, (screenW * 0.6096) - 1, screenH * 0.5273, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.4753) - 1, (screenW * 0.6096) - 1, (screenH * 0.4753) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.5273, screenW * 0.6390, screenH * 0.5273, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.5273, screenW * 0.6390, (screenH * 0.4753) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.4753, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.6302) - 1, (screenW * 0.6096) - 1, screenH * 0.6823, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.6302) - 1, (screenW * 0.6096) - 1, (screenH * 0.6302) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.6823, screenW * 0.6390, screenH * 0.6823, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.6823, screenW * 0.6390, (screenH * 0.6302) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.6302, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 117), false) dxDrawLine((screenW * 0.6096) - 1, (screenH * 0.6953) - 1, (screenW * 0.6096) - 1, screenH * 0.7474, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, (screenH * 0.6953) - 1, (screenW * 0.6096) - 1, (screenH * 0.6953) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawLine((screenW * 0.6096) - 1, screenH * 0.7474, screenW * 0.6390, screenH * 0.7474, tocolor(254, 254, 254, 140), 1, false) dxDrawLine(screenW * 0.6390, screenH * 0.7474, screenW * 0.6390, (screenH * 0.6953) - 1, tocolor(254, 254, 254, 140), 1, false) dxDrawRectangle(screenW * 0.6096, screenH * 0.6953, screenW * 0.0294, screenH * 0.0521, tocolor(0, 0, 0, 140), false) end ) bindKey ("TAB", "down", inventarioV) And I really do not know how to fix it, my English is mid-level, I can not understand the whole wiki or tutorials on the web. I apologize for the inconvenience, if I knew how to read English, I'd better learn for myself, could someone tell me where I'm failing and why do I have to replace him? or the method that I use to make the design section in my Inventory is not correct?