Search the Community

Showing results for tags 'id'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 9 results

  1. Editei um script de Prender o jogador que baixei da internet, ele obtém o jogador através do getPlayerFromPartialName. Gostaria de obter o jogador pelo script de ID, assim como no FiveM, aquele ID que aparece na cabeça do Player. Segue o código do script do ID e a função onde gostaria de obter o player pelo ID: function Start_Id ( _, acc ) if eventName == "onPlayerLogin" then setElementData ( source, "ID", getAccountID(acc) or "N/A" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffID: #00ff00( "..(getAccountID(acc) or "N/A") .." )", root, 255,255,255,true) elseif eventName == "onPlayerLogout" then removeElementData( source, "ID" ) outputChatBox ( "#00ff00✘ #ffffffLOGIN #00ff00✘➺ #ffffffNick: #00ff00 ( ".. getPlayerName(source) .." #00ff00) #ffffffDeslogou.", root, 255,255,255,true) elseif eventName == "onResourceStart" then for _, player in pairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) then setElementData( source, "ID", getAccountID(acc) or "N/A" ) end end end end addEventHandler("onResourceStart", resourceRoot, Start_Id) addEventHandler("onPlayerLogout", root, Start_Id) addEventHandler("onPlayerLogin", root, Start_Id) function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end --============================================================================================================================-- --=============================-- ----------- ID PLAYER ------------ --=============================-- function getnick(player, command, id, ...) if(id) then local playerID = tonumber(id) if(playerID) then local Player2 = getPlayerID(playerID) if(Player2) then outputChatBox ( "#00ff00✘ #ffffffINFO #00ff00✘➺ #ffffff Nome do Jogador #00ff00" .. getPlayerName(Player2) .."", player, 255,255,255,true) else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff O Jogador(a) de ID: #00ff00( " .. id .. " ) #ffffffNão Foi Encontrado!", player, 255,255,255,true) end else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffff ID: #00ff00( " .. id .. " ) #ffffffInválido!", player, 255,255,255,true) end else outputChatBox ( "#00ff00✘ #ffffffERRO #00ff00✘➺ #ffffffUse /id #00ff00[#ffffffID#00ff00]", player, 255,255,255,true) end end addCommandHandler("id", getnick) Função onde gostaria de obter o nome do player por ID: function colocanavtr (police, _, name) if hasObjectPermissionTo(police, "function.Prender") then local preso = getPlayerFromPartialName(name) -- Penso que tenha que alterar neste local. local px, py, pz = getElementPosition (police) local bx, by, bz = getElementPosition (preso) local dist = getDistanceBetweenPoints3D (px, py, pz, bx, by, bz) if not preso then return outputChatBox('#bebebe Jogador invalido.', police, 255, 255, 255, true) end if preso == police then return outputChatBox('#bebebe Você não pode prender a si mesmo.', police, 255, 255, 255, true) end if getPlayerWantedLevel(preso) == 0 then return outputChatBox('#bebebe Este jogador não está sendo procurado.', police, 255, 255, 255, true) end if getPedOccupiedVehicle(police) then return outputChatBox('#bebebe Você não pode prender de dentro da viatura.', police, 255, 255, 255, true) end if getPedOccupiedVehicle(preso) then return outputChatBox('#bebebe Você não pode prender um bandido enquanto ele estiver dentro de um veículo.', police, 255, 255, 255, true) end if dist >= 2 then return outputChatBox('#bebebe Você precisa chegar mais perto para prender.', police, 255, 255, 255, true) end setElementData (preso, 'navtr', true) addEventHandler('onPlayerCommand', preso, onCommand) local vtr = carros[police] setElementData (vtr, 'compreso', true) attachElements (preso, vtr, 0.2, -1.5, 0, 0,0,90) setElementFrozen (preso, true) toggleAllControls (preso, false) takeAllWeapons (preso) setPedAnimation (preso, 'ped','CAR_dead_LHS') vrx, vry, vrz = getElementRotation(vtr) setElementRotation(preso, vrx, vry, vrz+83) warpPedIntoVehicle (police, vtr) outputChatBox('#bebebeLeve o preso para a delegacia mais próxima #00ffff(sirenes azuis).', police, 255, 255, 255,true) end end addCommandHandler ('prender', colocanavtr) Se puderem me ajudar, agradeço!
  2. EU QUERIA SABER COMO COLOCO ID NO CHAT QUE TAVA EDITANDO POIS EU EDITEI E O CHAT NAO TA FUNCIONANDO
  3. У меня вопрос, как правильно пользоваться системой ID? У меня она есть, работает, но как взаимодействовать с другими скриптами через elementData? Заранее спасибо.
  4. local drawDistance = 15 g_StreamedInPlayers = {} function onClientRender() local cx, cy, cz, lx, ly, lz = getCameraMatrix() for k, player in pairs(g_StreamedInPlayers) do if isElement(player) and isElementStreamedIn(player) then do local vx, vy, vz = getPedBonePosition(player, 4) local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) if dist < drawDistance and isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false) then local x, y = getScreenFromWorldPosition(vx, vy, vz + 0.3) if x and y then local ID = getPlayerID(player) local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText("#ffffff"..ID.."", x - 1 - w / 1, y - 1 - h - 12, w, h, tocolor(0, 0, 0), 1.20, "default-bold", "left", "top", false, false, false, true, false) end end end else table.remove(g_StreamedInPlayers, k) end end end addEventHandler("onClientRender", root, onClientRender) function onClientElementStreamIn() if getElementType(source) == "player" and source ~= getLocalPlayer() then setPlayerNametagShowing(source, false) table.insert(g_StreamedInPlayers, source) end end addEventHandler("onClientElementStreamIn", root, onClientElementStreamIn) function onClientResourceStart(startedResource) visibleTick = getTickCount() counter = 0 local players = getElementsByType("player") for k, v in pairs(players) do if isElementStreamedIn(v) and v ~= getLocalPlayer() then setPlayerNametagShowing(v, false) table.insert(g_StreamedInPlayers, v) end end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) function getPlayerFromID(ID) return call(getResourceFromName("ID_System"), "getPlayerFromID", tonumber(ID)) end function getPlayerID(player) return getElementData(player,"ID") end Preciso muito de ajuda, irei abrir um servidor de Role-Play e fiz esse script de id, mas gostaria de saber se alguem poderia me ajudar, a duvida seria como deixar o id fixo, tipo quando alguem sair do servidor com exemplo ID 1, quando ela voltar esteja com o mesmo id. Alguem me ajuda?
  5. English Hello. Hello, I'm sorry for my English. Well I made this script to change the nick of the player to an ID, and it was not duplicated, it's not working as it should. Could you help with this or see something similar? OBS: I've started to script. Português (Brazil) Olá já venho desculpar meu inglês, Bom eu fiz este script para que trocasse o nick do player para um ID, E não fosse Duplicado, ele não está funcionando como deveria, Poderia ajudar com este ou ver algo semelhante ? OBS: Começei ontém a fazer script local ids = {} function assignID() for i=1,getMaxPlayers() do if not ids[i] then ids[i] = source setElementData(source,"id",i) break end end end addEventHandler("onPlayerJoin",root,assignID) function startup() ids = {} for k, v in ipairs(getElementsByType("player")) do local id = setElementData(v,"id",k) ids[k] = v end end addEventHandler("onResourceStart",resourceRoot,startup) function freeID() local id = getElementData(source,"id") if not id then return end ids[id] = nil end addEventHandler("onPlayerQuit",root,freeID) function getPlayerID ( player ) return getElementData( player, "id") end function getPlayerFromId ( theID ) if theID then local theID = tonumber(theID) local theplayer for index,player in ipairs(getElementsByType("player")) do if getElementData(player ,"id") == theID then theplayer = player end end return theplayer else return false end end
  6. https://imgur.com/a/ZbuQTmR What is the road object ID? I need this object for my map.. :s
  7. Boton8 = guiCreateLabel(137, 142, 111, 25, "LEGAJO2", false, Ventana);guiSetProperty(Boton8, "NormalTextColour", "FF27F512") addCommandHandler("p", function() local team = getPlayerTeam(localPlayer) if team then local teamName = getTeamName(team) if teamName == "MOBSA" then local getGui = guiGetVisible(Ventana) if not getGui then guiSetVisible(Ventana, true) guiSetText(Boton10, getPlayerMoney(localplayer)) guiSetText(Boton2, teamName) guiSetText(Boton4, getPlayerName(localPlayer)) guiSetText(Boton8, ID ) --<<Aca necesitaria poner la id del jugador, digamos que aparesca su id showCursor(true) else guiSetVisible(Ventana, false) showCursor(false) print ("Tu trabajas de chofer actualmente") end else print ("Tu trabajas de chofer actualmente") end end end ) Buenas, mi duda es como sacar la id de los jugadores? Veo cual son porque quedan guardadas pero como hago para volcar esos datos en estos textos? Gracias!
  8. http://imgur.com/SbpALvs /sorry for my bad english, and paint draw/ this is a "road object" from car school in singleplayer. not find it anywhere the id
  9. Hi! I have a faction panel, and I want to do that I have a list of faction vehicles with label, and when I click one of these, give me informations of the clicked vehicle. With the members(players) I can do it, because there is a getPlayerFromName. But with vehicles how can I do this?