Jump to content

Search the Community

Showing results for tags 'pm'.

  • 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
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 4 results

  1. Recentemente abaixei um mod da internet cujo a funçao dele e interação policial na hora de algemar prender esses trem porem nao e possivel ver a CNH pelo painel ja mudei o SetElementData O GetElementData Modifiquei acl coloquei na acl adm mas sem sucesso ja tentei contatar o dono do mod peço facebook porem sem exito --[[ =========================================================== # Minha página: https://www.facebook.com/TioSteinScripter/# # ╔════╗╔══╗╔═══╗ ╔═══╗╔════╗╔═══╗╔══╗╔═╗─╔╗ # # ║╔╗╔╗║╚╣─╝║╔═╗║ ║╔═╗║║╔╗╔╗║║╔══╝╚╣─╝║║╚╗║║ # # ╚╝║║╚╝─║║─║║─║║ ║╚══╗╚╝║║╚╝║╚══╗─║║─║╔╗╚╝║ # # ──║║───║║─║║─║║ ╚══╗║──║║──║╔══╝─║║─║║╚╗║║ # # ──║║──╔╣─╗║╚═╝║ ║╚═╝║──║║──║╚══╗╔╣─╗║║─║║║ # # ──╚╝──╚══╝╚═══╝ ╚═══╝──╚╝──╚═══╝╚══╝╚╝─╚═╝ # =========================================================== --]] Comando = "policial" ACL = "Policial" CorPainel = tocolor(225, 0, 0, 252) NomeDoServidor = "Brasil Mundo Avançado" ------------- Nome que você quer que apareça no painel ElementDataBanco = "TS:Banco" -------------- Element Data Do Banco, o mesmo da HUD ElementDataPorteDeArmas = "TS:PorteDeArmas" -------------- Element Data Do Porte de armas ElementHab1 = "DNL:Categoria(B)" ------------------- Element Data Habilitação Carro CaractereHab1 = "Sim" -------------- Se é "Sim" ou true ElementHab1 = "DNL:TestePratico" ------------------- Element Data Habilitação Carreta CaractereHab1 = "Sim" -------------- Se é "Sim" ou true ElementHab2 = "DNL:Categoria(A" ------------------- Element Data Habilitação Moto CaractereHab2 = "Sim" -------------- Se é "Sim" ou true ElementHab3 = "DNL:Categoria(C)" ------------------- Element Data Habilitação Caminhao CaractereHab3 = "Sim" -------------- Se é "Sim" ou true ElementHab3 = "DNL:Categoria(D)" ------------------- Element Data Habilitação Caminhao CaractereHab3 = "Sim" -------------- Se é "Sim" ou true ElementHab4 = "DNL:Categoria(E)" ------------------- Element Data Habilitação Caminhao CaractereHab4 = "Sim" -------------- Se é "Sim" ou true ElementHab5 = "DNL:TestePratico" ------------------- Element Data Habilitação Carreta CaractereHab5 = "Sim" -------------- Se é "Sim" ou true ElementRG = "ID" ------------------- Element Data RG ElementDataNascimento = "TS:DataDeNascimento" ------------------- Element Data de nascimento TiposDeMulta = { {"Infração Gravíssima", 5000}, ------------- Motivo da multa, Valor da multa {"Infração Grave", 4000}, ------------- Motivo da multa, Valor da multa {"Infração Média", 3000}, ------------- Motivo da multa, Valor da multa {"Infração Leve", 2000}, ------------- Motivo da multa, Valor da multa } e aki A CNH Entrar = createMarker(1111.70715, -1796.76624, 16.59375 -1, "cylinder", 1.2, 0, 255, 0, 90) Blip = createBlipAttachedTo ( Entrar, 36 ) setBlipVisibleDistance(Blip, 150) Sair = createMarker(-2026.97485, -104.28124, 1035.17188 -1, "cylinder", 1.2, 0, 255, 0, 90) setElementInterior(Sair, 3) Marker_Categoria = createMarker(-2033.13196, -117.45327, 1035.17188 -1, "cylinder", 1.2, 0, 255, 0, 90) setElementInterior(Marker_Categoria, 3) Marker_Multas = createMarker(-2031.19666, -115.17245, 1035.17188 -1, "cylinder", 1.2, 0, 255, 0, 90) setElementInterior(Marker_Multas, 3) function Entrar_Detran (source) setElementInterior(source, 3) setElementPosition(source, -2029.55017, -105.98931, 1035.17188) setElementDimension(source, 0) end addEventHandler("onMarkerHit", Entrar, Entrar_Detran) function Sair_Detran (source) setElementInterior(source, 0) setElementPosition(source, 1109.35291, -1796.64258, 16.59375) setElementDimension(source, 0) end addEventHandler("onMarkerHit", Sair, Sair_Detran) function Abrir_Prova(source) local account = getPlayerAccount (source) if isGuestAccount (account) then outputChatBox ( "#ff0000✘ #ffffffDetran #ff0000✘➺ #FFFFFFVocê não pode Fazer Prova Deslogado!", source, 255,255,255,true) return end if isElementWithinMarker(source, Marker_Categoria) then triggerClientEvent(source,"DNL:AbrirCategorias",source) end end addEventHandler( "onMarkerHit", Marker_Categoria, Abrir_Prova ) function PagarMultas(source) local account = getPlayerAccount (source) if isGuestAccount (account) then outputChatBox ( "#ff0000✘ #ffffffDetran #ff0000✘➺ #FFFFFFVocê não pode Pagar Multas Deslogado!", source, 255,255,255,true) return end if isElementWithinMarker(source, Marker_Multas) then triggerClientEvent(source,"DNL:Abrir_Multas",source) end end addEventHandler( "onMarkerHit", Marker_Multas, PagarMultas ) -------- Carregar_Dados -------- function Carregar_Dados () local Account = getPlayerAccount(source) local HabilitacaoA = getAccountData (Account, "DNL:Categoria(A)") local HabilitacaoB = getAccountData (Account, "DNL:Categoria(B)") local HabilitacaoC = getAccountData (Account, "DNL:Categoria(C)") local HabilitacaoD = getAccountData (Account, "DNL:Categoria(D)") local HabilitacaoE = getAccountData (Account, "DNL:Categoria(E)") setElementData(source, "DNL:Categoria(A)", HabilitacaoA) setElementData(source, "DNL:Categoria(B)", HabilitacaoB) setElementData(source, "DNL:Categoria(C)", HabilitacaoC) setElementData(source, "DNL:Categoria(D)", HabilitacaoD) setElementData(source, "DNL:Categoria(E)", HabilitacaoE) end addEventHandler("onPlayerLogin", root, Carregar_Dados) function carteira (source, cmd, pname) local accountname = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accountname, aclGetGroup("Everyone")) then -- Grupo permitido a usar o comando local Player_2 = getPlayerFromPartialName(pname) if isElement(Player_2) then local Account = getPlayerAccount(Player_2) setElementData(Player_2, "DNL:Categoria(A)", true) setAccountData ( Account, "DNL:Categoria(A)", true) setElementData(Player_2, "DNL:Categoria(B)", true) setAccountData ( Account, "DNL:Categoria(B)", true) setElementData(Player_2, "DNL:Categoria(C)", true) setAccountData ( Account, "DNL:Categoria(C)", true) setElementData(Player_2, "DNL:Categoria(D)", true) setAccountData ( Account, "DNL:Categoria(D)", true) setElementData(Player_2, "DNL:Categoria(E)", true) setAccountData ( Account, "DNL:Categoria(E)", true) else outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #ffffff O Jogador(a) Não Foi Encontrado!", source, 255,255,255,true) end else outputChatBox ( "#ff0000✘ #ffffffERRO #ff0000✘➺ #FFFFFFVocê não tem permissão para utilizar este comando!", source, 255,255,255,true) end end addCommandHandler("carteira", carteira) -------------------------------------------------------------------- function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end -------------------------------------------------------------------- Outra parte do Script --[[ ===================================== --]] -- = CATEGORIA A = -- --[[ ===================================== --]] function CNHMoto (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(A)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 581) or (getElementModel (temp) == 462) or (getElementModel (temp) == 521) or (getElementModel (temp) == 463) or (getElementModel (temp) == 522) or (getElementModel (temp) == 461) or (getElementModel (temp) == 448) or (getElementModel (temp) == 468) or (getElementModel (temp) == 586) or (getElementModel (temp) == 523) then -- if getVehicleOccupant(temp,0) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaMoto",source) end end end addEventHandler ( "onVehicleEnter", root, CNHMoto ) --[[ ===================================== --]] -- = CATEGORIA B = -- --[[ ===================================== --]] function CNHCarro (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(B)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 602) or (getElementModel (temp) == 496) or (getElementModel (temp) == 525) or (getElementModel (temp) == 401) or (getElementModel (temp) == 518) or (getElementModel (temp) == 527) or (getElementModel (temp) == 589) or (getElementModel (temp) == 419) or (getElementModel (temp) == 587) or (getElementModel (temp) == 533) or (getElementModel (temp) == 526) or (getElementModel (temp) == 474) or (getElementModel (temp) == 545) or (getElementModel (temp) == 517) or (getElementModel (temp) == 410) or (getElementModel (temp) == 600) or (getElementModel (temp) == 436) or (getElementModel (temp) == 439) or (getElementModel (temp) == 549) or (getElementModel (temp) == 491) or (getElementModel (temp) == 445) or (getElementModel (temp) == 604) or (getElementModel (temp) == 507) or (getElementModel (temp) == 585) or (getElementModel (temp) == 466) or (getElementModel (temp) == 492) or (getElementModel (temp) == 546) or (getElementModel (temp) == 551) or (getElementModel (temp) == 516) or (getElementModel (temp) == 467) or (getElementModel (temp) == 426) or (getElementModel (temp) == 547) or (getElementModel (temp) == 405) or (getElementModel (temp) == 580) or (getElementModel (temp) == 409) or (getElementModel (temp) == 550) or (getElementModel (temp) == 566) or (getElementModel (temp) == 540) or (getElementModel (temp) == 421) or (getElementModel (temp) == 529) or (getElementModel (temp) == 485) or (getElementModel (temp) == 438) or (getElementModel (temp) == 574) or (getElementModel (temp) == 420) or (getElementModel (temp) == 490) or (getElementModel (temp) == 470) or (getElementModel (temp) == 596) or (getElementModel (temp) == 598) or (getElementModel (temp) == 599) or (getElementModel (temp) == 597) or (getElementModel (temp) == 531) or (getElementModel (temp) == 536) or (getElementModel (temp) == 575) or (getElementModel (temp) == 534) or (getElementModel (temp) == 567) or (getElementModel (temp) == 535) or (getElementModel (temp) == 576) or (getElementModel (temp) == 429) or (getElementModel (temp) == 541) or (getElementModel (temp) == 415) or (getElementModel (temp) == 480) or (getElementModel (temp) == 562) or (getElementModel (temp) == 565) or (getElementModel (temp) == 434) or (getElementModel (temp) == 494) or (getElementModel (temp) == 502) or (getElementModel (temp) == 503) or (getElementModel (temp) == 411) or (getElementModel (temp) == 559) or (getElementModel (temp) == 561) or (getElementModel (temp) == 560) or (getElementModel (temp) == 506) or (getElementModel (temp) == 451) or (getElementModel (temp) == 558) or (getElementModel (temp) == 555) or (getElementModel (temp) == 477) or (getElementModel (temp) == 568) or (getElementModel (temp) == 424) or (getElementModel (temp) == 504) or (getElementModel (temp) == 457) or (getElementModel (temp) == 483) or (getElementModel (temp) == 571) or (getElementModel (temp) == 500) or (getElementModel (temp) == 444) or (getElementModel (temp) == 556) or (getElementModel (temp) == 557) or (getElementModel (temp) == 471) or (getElementModel (temp) == 495) or (getElementModel (temp) == 539) or (getElementModel (temp) == 459) or (getElementModel (temp) == 422) or (getElementModel (temp) == 482) or (getElementModel (temp) == 605) or (getElementModel (temp) == 530) or (getElementModel (temp) == 418) or (getElementModel (temp) == 572) or (getElementModel (temp) == 582) or (getElementModel (temp) == 413) or (getElementModel (temp) == 440) or (getElementModel (temp) == 543) or (getElementModel (temp) == 583) or (getElementModel (temp) == 554) or (getElementModel (temp) == 579) or (getElementModel (temp) == 400) or (getElementModel (temp) == 404) or (getElementModel (temp) == 489) or (getElementModel (temp) == 505) or (getElementModel (temp) == 479) or (getElementModel (temp) == 422) or (getElementModel (temp) == 458) or (getElementModel (temp) == 402) then --if getVehicleOccupant(temp,0) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaCar",source) end end end addEventHandler ( "onVehicleEnter", root, CNHCarro ) --[[ ===================================== --]] -- = CATEGORIA C = -- --[[ ===================================== --]] function CNHCaminhao (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(C)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 408) or (getElementModel (temp) == 552) or (getElementModel (temp) == 416) or (getElementModel (temp) == 433) or (getElementModel (temp) == 427) or (getElementModel (temp) == 528) or (getElementModel (temp) == 407) or (getElementModel (temp) == 544) or (getElementModel (temp) == 601) or (getElementModel (temp) == 428) or (getElementModel (temp) == 499) or (getElementModel (temp) == 609) or (getElementModel (temp) == 498) or (getElementModel (temp) == 524) or (getElementModel (temp) == 532) or (getElementModel (temp) == 578) or (getElementModel (temp) == 486) or (getElementModel (temp) == 406) or (getElementModel (temp) == 573) or (getElementModel (temp) == 455) or (getElementModel (temp) == 588) or (getElementModel (temp) == 423) or (getElementModel (temp) == 414) or (getElementModel (temp) == 443) or (getElementModel (temp) == 456) or (getElementModel (temp) == 478) or (getElementModel (temp) == 508) or (getElementModel (temp) == 431) or (getElementModel (temp) == 437) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaCAM",source) end end end addEventHandler ( "onVehicleEnter", root, CNHCaminhao ) --[[ ===================================== --]] -- = CATEGORIA D = -- --[[ ===================================== --]] function CNHCarreta (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(D)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 403) or (getElementModel (temp) == 515) or (getElementModel (temp) == 514) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaCARRETA",source) end end end addEventHandler ( "onVehicleEnter", root, CNHCarreta ) --[[ ===================================== --]] -- = CATEGORIA E = -- --[[ ===================================== --]] function CNHHeli (source, seat) if getElementData( source, "DNL:TestePratico", true ) then return end if getElementData(source, "DNL:Categoria(E)", true) then return end local temp = getPedOccupiedVehicle(source) if (getElementModel (temp) == 548) or (getElementModel (temp) == 425) or (getElementModel (temp) == 417) or (getElementModel (temp) == 487) or (getElementModel (temp) == 488) or (getElementModel (temp) == 497) or (getElementModel (temp) == 563) or (getElementModel (temp) == 447) or (getElementModel (temp) == 469) then if seat == 0 then triggerClientEvent(source,"CNH:AlertaHeli",source) end end end addEventHandler ( "onVehicleEnter", root, CNHHeli ) --[[ ===================================== --]] -- = REMOVER CNH = -- --[[ ===================================== --]] function RemCNH (source, seat) if seat == 0 then triggerClientEvent(source,"CNH:AlertaMoto_Off",source) triggerClientEvent(source,"CNH:AlertaCar_Off",source) triggerClientEvent(source,"CNH:AlertaCAM_Off",source) triggerClientEvent(source,"CNH:AlertaCARRETA_Off",source) triggerClientEvent(source,"CNH:AlertaHeli_Off",source) end end addEventHandler ( "onVehicleExit", root, RemCNH )
  2. here's a video about the bug..: How to fix this bug? I tried many things, but unsuccessfully.. :s Here the code: Client.lua: local sX, sY = guiGetScreenSize() setElementData(localPlayer,"name",nil) GUIEditor = { button = {}, edit = {} } GUIEditor.button[1] = guiCreateButton(0.72, 0.74, 0.03, 0.04, ">", true) kuldottpmek = {} fogadottpmek = {} GUIEditor.edit[1] = guiCreateEdit(0.38, 0.74, 0.34, 0.04, ".", true) guiEditSetMaxLength(GUIEditor.edit[1], 150) local dxfont0_gothic = dxCreateFont(":mta_wintertime/gothic.ttf", 14) local screenW, screenH = guiGetScreenSize() local players = getElementsByType ( "player" ) addEventHandler("onClientRender", root, function() local players = getElementsByType ( "player" ) local elem = 0 local fpm = 0 local kpm = 0 local uzenet = guiGetText(GUIEditor.edit[1]) dxDrawRectangle(screenW * 0.3722, screenH * 0.2722, screenW * 0.3833, screenH * 0.5100, tocolor(0, 0, 0, 162), false) dxDrawRectangle(screenW * 0.1757, screenH * 0.2722, screenW * 0.1896, screenH * 0.5100, tocolor(0, 0, 0, 162), false) dxDrawText("Játékoslista", screenW * 0.1764, screenH * 0.2722, screenW * 0.3653, screenH * 0.3167, tocolor(255, 255, 255, 255), 1.00, dxfont0_gothic, "center", "center", false, false, false, false, false) for id,player in ipairs(players) do local plname = getPlayerName(player) elem = elem + 1 dxDrawText(plname, screenW * 0.1764, screenH * 0.2500+(elem*70), screenW * 0.3653, screenH * 0.3578, tocolor(255, 255, 255, 255), 0.65, dxfont0_gothic, "left", "center", false, false, true, true, false) dxDrawRectangle(screenW * 0.1764, screenH * 0.2850+(elem*35), screenW * 0.1889, screenH * 0.0367, tocolor(0, 0, 0, 162), false) end dxDrawText(getElementData(localPlayer,"name") or "Válassz játékost", screenW * 0.3722, screenH * 0.2722, screenW * 0.7556, screenH * 0.3167, tocolor(255, 255, 255, 255), 1.00, dxfont0_gothic, "center", "center", false, false, false, true, false) dxDrawText(getElementData(localPlayer,"name") and "Elérhető most" or "", screenW * 0.5278, screenH * 0.3056, screenW * 0.6014, screenH * 0.3411, tocolor(255, 255, 255, 255), 0.65, dxfont0_gothic, "center", "center", false, false, false, true, false) dxDrawRectangle(screenW * 0.3722, screenH * 0.3467, screenW * 0.3833, screenH * 0.3844, tocolor(0, 0, 0, 162), false) for k,v in ipairs(kuldottpmek) do kpm = kpm + 1 dxDrawRectangle(screenW * 0.3722, screenH * 0.2775+(kpm*62), screenW * 0.3833, screenH * 0.0633, tocolor(94, 192, 254, 162), false) dxDrawText("Te:", screenW * 0.3729, screenH * 0.1430+(kpm*124), screenW * 0.7556, screenH * 0.4367, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "center", false, false, false, true, false) dxDrawText(v, screenW * 0.3729, screenH * 0.3050+(kpm*62), screenW * 0.7556, screenH * 0.4733, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, true, true, false, false) for k,v in ipairs(fogadottpmek) do kpm = kpm + 1 dxDrawRectangle(screenW * 0.3722, screenH * 0.2775+(kpm*62), screenW * 0.3833, screenH * 0.0633, tocolor(255, 255, 254, 162), false) dxDrawText(getElementData(localPlayer,"name")..":", screenW * 0.3729, screenH * 0.1430+(kpm*124), screenW * 0.7556, screenH * 0.4367, tocolor(110, 110,111, 200), 1.00, "default-bold", "left", "center", false, false, false, true, false) dxDrawText(v, screenW * 0.3729, screenH * 0.3050+(kpm*62), screenW * 0.7556, screenH * 0.4733, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, true, true, false, false) end end end ) function onClientClick(button, state) local elem = 0 if button == "left" and state == "down" then for k, v in ipairs(players) do local plname = getPlayerName(v) elem = elem+1 if isInBox(screenW * 0.1764, screenH * 0.2850+(elem*35), screenW * 0.1889, screenH * 0.0367) then if plname == getPlayerName(localPlayer) then return end setElementData(localPlayer,"name",plname) kuldottpmek = {} fogadottpmek = {} end end end end addEventHandler("onClientClick", root, onClientClick) function isInBox(xS,yS,wS,hS) if(isCursorShowing()) then local cursorX, cursorY = getCursorPosition() cursorX, cursorY = cursorX*sX, cursorY*sY if(cursorX >= xS and cursorX <= xS+wS and cursorY >= yS and cursorY <= yS+hS) then return true else return false end end end function trig1() if getElementData(localPlayer,"name") == nil then return end local nev =getElementData(localPlayer,"name") or "" local targetPlayer = getPlayerFromName ( nev ) if targetPlayer then local uzenet = guiGetText(GUIEditor.edit[1]) table.insert(kuldottpmek,uzenet) end end addEvent("uzenet",true) addEventHandler("uzenet",root,trig1) function trig2() if getElementData(localPlayer,"name") == nil then return end local nev =getElementData(localPlayer,"name") or "" local targetPlayer = getPlayerFromName ( nev ) if targetPlayer then local uzenet = guiGetText(GUIEditor.edit[1]) table.insert(fogadottpmek,uzenet) end end addEvent("uzenet2",true) addEventHandler("uzenet2",root,trig2) function test() if getElementData(localPlayer,"name") == nil then return end local uzenet = guiGetText(GUIEditor.edit[1]) triggerServerEvent("pmuzenet",localPlayer,getLocalPlayer(),uzenet) end addEventHandler("onClientGUIClick",GUIEditor.button[1],test,false) Server.lua: function privateMessage(thePlayer) local sendToName = getElementData(thePlayer,"name") local toPlayer = getPlayerFromParticalName (sendToName) triggerClientEvent(thePlayer,"uzenet",toPlayer) triggerClientEvent(toPlayer,"uzenet2",thePlayer) setElementData(toPlayer,"fogadott",true) setElementData(thePlayer,"fogadott",false) end addEvent("pmuzenet",true) addEventHandler("pmuzenet",root,privateMessage) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end
  3. I want create a dx private message system, like the fb messenger.. But how to make it possible? Or where can i download a script like this? sorry for my bad english..
  4. --client local beszelget = { } local localPlayer = getLocalPlayer () local root = getRootElement () local w,h = guiGetScreenSize() local y = h-35-340 local gomb = guiCreateButton ( w*0.275,h-35, 100, 35, "Privát üzenetek", false ) guiSetAlpha ( gomb, 1 ) local options = { colorCode=false, chatbox=true, noti=true, bind=false, bindbutton="" } local players local img_default = { w=30, h=75, x=w*0.275 + 120, y=h} local img local speed_default = 0.09 local speed local hideTimer local refreshTimer local lastSearch = "" local backTimer local wrongTable = { "mouse1", "mouse2", "mouse3", "mouse4", "mouse5", "mouse_wheel_up", "mouse_wheel_down", "arrow_l", "arrow_u", "arrow_r", "arrow_d", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "num_0", "num_1", "num_2", "num_3", "num_4", "num_5", "num_6", "num_7", "num_8", "num_9", "num_mul", "num_add", "num_sep", "num_sub", "num_div", "num_dec", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "backspace", "tab", "lalt", "ralt", "enter", "space", "pgup", "pgdn", "end", "home", "insert", "delete", "lshift", "rshift", "lctrl", "rctrl", "[", "]", "pause", "capslock", "scroll", ";", ",", "-", ".", "/", "#", "\\", "=" } local keyTable = {} function togglePM ( ) if isElement ( ablak ) then if guiGetVisible ( ablak ) then guiSetVisible ( ablak, false ) guiSetInputEnabled(false) else guiSetVisible ( ablak, true ) end end end function loadSettings () for i, v in ipairs ( wrongTable ) do keyTable[ v ] = true end if fileExists ( "settings.xml" ) then local file = xmlLoadFile ( "settings.xml" ) for i, v in ipairs ( xmlNodeGetChildren ( file ) ) do if xmlNodeGetValue ( v ) == "true" or xmlNodeGetValue ( v ) == "false" then options [ xmlNodeGetName ( v ) ] = loadstring ( "return " .. xmlNodeGetValue ( v ) )() else options [ xmlNodeGetName ( v ) ] = xmlNodeGetValue ( v ) end end if options.bind then bindWindowTo ( options.bindbutton ) end xmlUnloadFile ( file ) end end function saveSettings () local file = xmlLoadFile ( "settings.xml" ) or xmlCreateFile ( "settings.xml", "settings" ) for k, v in pairs ( options ) do local child = xmlFindChild ( file, k, 0 ) or xmlCreateChild ( file, k ) xmlNodeSetValue ( child, tostring(v) ) end xmlSaveFile ( file ) xmlUnloadFile ( file ) end function bindWindowTo ( button ) if keyTable[ button ] then guiSetText ( bindedit, button ) if options.bindbutton and options.bindbutton ~= "" then unbindKey ( options.bindbutton, "down", togglePM ) end bindKey ( button, "down", togglePM ) options.bindbutton = button else guiSetText ( bindedit, options.bindbutton ) end end function refreshList ( ) local name = guiGetText ( keres ) if name ~= lastSearch then lastSearch = name for i, v in pairs(players) do if string.find(v.name:lower(), tostring(name):lower(), 1, true) then v.hide = false else v.hide = true end end reCreateNameList ( true ) end end addEventHandler ( "onClientResourceStop", resourceRoot, saveSettings ) function onClick ( ) --outputChatBox ( "a: " .. tostring(guiGetInputEnabled()) ) if source ~= keres and isTimer ( refreshTimer ) then killTimer ( refreshTimer ) lastSearch = "" end if source == keres then if guiGetText ( keres ) == "Keresés" then guiSetText(keres,"") end guiSetInputEnabled ( true ) if not isTimer ( refreshTimer ) then refreshTimer = setTimer ( refreshList, 1000, 0 ) end elseif source == grid then local r, c = guiGridListGetSelectedItem(grid) if r and r ~= -1 then kezoOldal ( false ) local player = guiGridListGetItemData(grid,r,1) if beszelget[player] then guiSetText(memo,beszelget[player]) guiMemoSetCaretIndex(memo,string.len(guiGetText(memo))-1) end end elseif source == kuld then --outputChatBox ( "b: " .. tostring(guiGetInputEnabled()) ) local text = guiGetText(msg) if text == "" then guiSetInputEnabled(false) end local r, c = guiGridListGetSelectedItem(grid) if text and r and text ~= "" and r ~= -1 then local player = guiGridListGetItemData(grid,r,1) if not beszelget[player] then beszelget[player] = players [ localPlayer ].name .. ": "..text kijelol(player) else beszelget[player] = beszelget[player] .."\n".. players [ localPlayer ].name .. ": "..text end local leng = string.len(beszelget[player]) if leng > 3000 then beszelget[player] = string.sub(beszelget[player], leng-3000) end guiSetText(msg,"") if string.len(guiGetText ( memo ) ) <= 1 then guiSetText(memo,players [ localPlayer ].name .. ": "..text) else guiSetText(memo,guiGetText(memo)..players [ localPlayer ].name .. ": "..text) end if options.chatbox then outputChatBox ( "-> " .. players [ player ].name .. ": "..text, 255, 170, 0 ) end guiMemoSetCaretIndex(memo,string.len(guiGetText(memo))-1) guiBringToFront(msg) guiSetInputEnabled(true) triggerServerEvent("uzenet",getLocalPlayer(),player,text) --outputChatBox ( "c: " .. tostring(guiGetInputEnabled()) ) end elseif source == msg then guiSetInputEnabled(true) elseif source == color then options.colorCode = not guiCheckBoxGetSelected ( color ) reCreateNameList () elseif source == chatbox then options.chatbox = guiCheckBoxGetSelected ( chatbox ) elseif source == noti then options.noti = guiCheckBoxGetSelected ( noti ) elseif source == bind then if guiCheckBoxGetSelected ( bind ) then guiSetEnabled ( bindedit, true ) else guiSetText ( bindedit, options.bindbutton or "" ) guiSetEnabled ( bindedit, false ) end options.bind = guiCheckBoxGetSelected ( bind ) if options.bind then bindWindowTo ( options.bindbutton ) elseif options.bindbutton and options.bindbutton ~= "" then unbindKey ( options.bindbutton, "down", togglePM ) end elseif source == bindedit then guiSetInputEnabled ( true ) elseif source ~= memo then kezoOldal ( true ) end end function draw ( time ) if img.y >= h - img.h then img.y = img.y - (time * speed ) end dxDrawImage ( img.x, img.y, img.w, img.h, "fl.png" ) end function startAnim ( state ) if state == nil then state = true end if state == true then img = img_default speed = speed_default if isTimer ( hideTimer ) then killTimer ( hideTimer ) elseif isTimer ( backTimer ) then killTimer ( backTimer ) end if not drawing then addEventHandler ( "onClientPreRender", root, draw ) drawing = true end backTimer = setTimer ( startAnim, 5000, 1, "back" ) elseif state == "back" and drawing then speed = -1 * speed img.y = img.y + ( h - img.h - img.y ) hideTimer = setTimer ( startAnim, 2100, 1, false ) elseif drawing then removeEventHandler ( "onClientPreRender", root, draw ) drawing = false end end addEvent("uzenet_jott",true) addEventHandler("uzenet_jott",getRootElement(), function(text) local r, c = guiGridListGetSelectedItem(grid) local player if text and r and text ~= "" and r ~= -1 then player = guiGridListGetItemData(grid,r,1) end if player ~= source or not guiGetVisible(ablak) then guiSetText(gomb,"Privát üenetek\n ( Új üzenet! )") end if options.chatbox then outputChatBox ( "* PM from " .. players [ source ].name .. ": ".. text, 255, 100, 100 ) end if options.noti and not guiGetVisible ( ablak ) then startAnim () end text = "> ".. players [ source ].name .. ": "..text if not beszelget[source] then beszelget[source] = text kivesz(source) local row = guiGridListInsertRowAfter(grid,-1) guiGridListSetItemText(grid,row,column,players [ source ].name,false,false) guiGridListSetItemColor(grid,0,1,10,200,255) guiGridListSetItemData ( grid, row, 1, source ) else beszelget[source] = beszelget[source] .."\n".. text end if player == source then guiSetText(memo,guiGetText(memo)..text) guiMemoSetCaretIndex(memo,string.len(guiGetText(memo))-1) end if guiGetVisible ( msg ) then guiSetInputEnabled(true) end end) function onClick_gomb ( ) guiSetText(gomb,"Privát üzenetek") startAnim ( false ) togglePM ( ) end addEventHandler ( "onClientGUIClick", gomb, onClick_gomb) addEventHandler("onClientPlayerJoin",getRootElement(), function(arg) if grid and isElement(grid) then local row = guiGridListInsertRowAfter ( grid, guiGridListGetRowCount ( grid ) ) guiGridListSetItemData ( grid, row, 1, source ) players[ source ] = { name=options.colorCode and getPlayerName(source) or string.gsub(getPlayerName ( source ), '#%x%x%x%x%x%x', ''), blue=false } guiGridListSetItemText(grid,row,column,players [ source ].name, false,false) end end) addEventHandler( "onClientPlayerQuit", getRootElement(), function() kivesz(source) players[ source ] = nil end) addEventHandler ( "onClientPlayerChangeNick", getRootElement(), function ( regi, uj) if grid and isElement(grid) then -- outputChatBox("nev") for i = 0, guiGridListGetRowCount(grid) do if guiGridListGetItemData(grid,i,1) == source then players[ source ].name = options.colorCode and getPlayerName(source) or string.gsub(getPlayerName ( source ), '#%x%x%x%x%x%x', '') guiGridListSetItemText(grid,i,1, players[ source ].name,false,false) end end end end ) function kivesz(player) if grid and isElement(grid) then for i = 0, guiGridListGetRowCount(grid) do if guiGridListGetItemData(grid,i,1) == player then guiGridListRemoveRow(grid,i,1) break end end end end function kijelol(player) if grid and isElement(grid) then players[ player ].blue = true kivesz ( player ) local row = guiGridListInsertRowAfter ( grid, -1, 1 ) guiGridListSetItemText(grid,row,1,players[ player ].name,false,false) guiGridListSetItemColor(grid,row,1,10,200,255) guiGridListSetItemData ( grid, row, 1, player ) guiGridListSetSelectedItem ( grid, row, 1 ) --triggerEvent("onClientGUIClick",grid) end end function reCreateNameList ( noRescan ) guiGridListClear ( grid ) if not noRescan or not players then players = {} lastSearch = "" for i, v in ipairs(getElementsByType("player")) do --if v ~= localPlayer then players[ v ] = { name=options.colorCode and getPlayerName ( v ) or string.gsub(getPlayerName ( v ), '#%x%x%x%x%x%x', ''), blue=beszelget[v] and true or false } --end end end for k, v in pairs ( players ) do if not v.hide then if not v.blue then local row = guiGridListAddRow(grid) guiGridListSetItemText ( grid, row, column, v.name, false, false) guiGridListSetItemData ( grid, row, column, k ) else local row = guiGridListInsertRowAfter(grid, 0) guiGridListSetItemText ( grid, row, column, v.name, false, false) guiGridListSetItemColor(grid,row,column,10,200,255) guiGridListSetItemData ( grid, row, column, k ) end end end end function kezoOldal ( state ) if state then guiSetText ( memo, "Légy üdvözölve kedves Játékos!\n\nVálassz egy nevet oldalról a listából akivel beszélgetni szeretnél, és írj neki!\nHa úgy szeretnél a rendes chat-be írni, hogy közben ez az ablak is nyitva van, nyomj úgy entert vagy kattints a Küldés gombra, hogy nincs beí­rva üzenet. Ezután írhatsz (t-vel általában...) a chatbox-ba, majd ide visszakattintva újra ide." ) guiSetSize ( memo, 0.75, 0.40, true ) guiSetInputEnabled ( false ) else guiSetSize ( memo, 0.75, 0.7324, true ) guiSetText ( memo, "" ) end guiSetVisible ( color, state ) guiSetVisible ( chatbox, state ) guiSetVisible ( noti, state ) guiSetVisible ( bind, state ) guiSetVisible ( bindedit, state ) guiSetVisible ( kuld, not state ) guiSetVisible ( msg, not state ) guiSetVisible ( help, state) end function init() ablak = guiCreateWindow ( w*0.275, y, 550, 340, "PM ablak", false ) guiSetVisible(ablak,false) guiWindowSetMovable( ablak, false ) guiWindowSetSizable( ablak, false ) grid = guiCreateGridList ( 0.017, 0.0706, 0.1989, 0.8265, true, ablak ) guiGridListSetSortingEnabled(grid,false) guiGridListSetSelectionMode ( grid, 2 ) bindedit = guiCreateEdit(128, 296, 130, 23, options.bindbutton, false, ablak) guiEditSetMaxLength ( bindedit, 16 ) loadSettings () column = guiGridListAddColumn ( grid, "Játékosok", 1.2 ) reCreateNameList ( ) keres = guiCreateEdit ( 0.017, 0.9176, 0.1989, 0.0559, "Keresés", true, ablak ) --guiSetEnabled(keres, false) help = guiCreateLabel ( 0.2348, 0.0765, 0.7311, 0.0706, "Válassz egy játékost, akivel beszélgetni szeretnél. Akivel már van megkezdett beszélgetésed, azt a lista elején, kék szí­nnel kiemelve találod.", true, ablak ) guiLabelSetHorizontalAlign ( help, "left", true ) guiSetFont ( help, "default-small" ) memo = guiCreateMemo(0.23, 0.16, 0.75, 0.40, "Légy üdvözölve kedves Játékos!\n\nVálassz egy nevet oldalról a listából akivel beszélgetni szeretnél, és írj neki!\nHa úgy szeretnél a rendes chat-be írni, hogy közben ez az ablak is nyitva van, nyomj úgy entert vagy kattints a Küldés gombra, hogy nincs beí­rva üzenet. Ezután írhatsz (t-vel általában...) a chatbox-ba, majd ide visszakattintva újra ide.", true, ablak) guiMemoSetReadOnly ( memo, true ) color = guiCreateCheckBox(0.23, 0.59, 0.69, 0.04, "Színkodok elrejtése a nevekben (Hide color codes in names)", true, true, ablak) guiCheckBoxSetSelected ( color, not options.colorCode ) chatbox = guiCreateCheckBox(0.23, 0.66, 0.69, 0.04, "Üzenet kiírása a chatboxba (Output messages to the chatbox)", true, true, ablak) guiCheckBoxSetSelected ( chatbox,options.chatbox ) noti = guiCreateCheckBox(0.23, 0.74, 0.68, 0.04, "Feltűnőbb üzenetjelző használata (More visible notification)", true, true, ablak) guiCheckBoxSetSelected ( noti, options.noti ) bind = guiCreateCheckBox(0.23, 0.81, 0.71, 0.04, "Ablak megnyitása a következő gombbal (Bind opening this window)", true, true, ablak) guiCheckBoxSetSelected ( bind, options.bind ) help = guiCreateLabel ( 260, 300, 270, 25, "Nyomj entert a mentéshez (Press enter to save)", false, ablak ) guiSetEnabled ( bindedit, options.bind ) msg = guiCreateEdit ( 0.2292, 0.9147, 0.6364, 0.0588, "", true, ablak ) guiEditSetMaxLength ( msg, 128 ) kuld = guiCreateButton ( 0.8693, 0.9059, 0.1136, 0.0676, "Küldés", true, ablak ) kezoOldal ( true ) addEventHandler( "onClientGUIAccepted", root, function( theElement ) if theElement == msg then --guiSetInputEnabled ( false ) guiBringToFront ( msg ) triggerEvent("onClientGUIClick",kuld) elseif theElement == bindedit then local text = guiGetText ( bindedit ) if text then guiSetInputEnabled ( false ) guiMoveToBack ( bindedit ) bindWindowTo ( text ) end end end ) addEventHandler ( "onClientGUIClick", ablak, onClick, true) end addEventHandler("onClientResourceStart",getResourceRootElement(),init) addCommandHandler ( "pm", togglePM ) --server addEvent("uzenet", true) addEventHandler("uzenet", getRootElement(), function(toplayer, text) triggerClientEvent(toplayer, "uzenet_jott", source, source, text) end ) What wrong? client.lua:228: attempt to concatenate local 'text' a userdata value
×
×
  • Create New...