Jump to content

Help =/


Death

Recommended Posts

------------------------------------------------------------------------------------------- 
-- Resource:GUI Info -- 
------------------------------------------------------------------------------------------- 
  
local localPlayer = getLocalPlayer() 
  
local GUIInfo =  
{ 
  Habilitado = {}, 
  DeGUIMode = {}, 
  GUI_Window = {{}}, 
  GUI_Image = {{}}, 
  GUI_Label = {{}, {}, {}, {}, {}, {}}, 
  GUI_Button = {{}} 
} 
  
local Path_ImgInfo = "resources/GUIInfo/Info.png" 
  
------------------------------------------------------------------------------------------- 
-- Resource Start -- 
------------------------------------------------------------------------------------------- 
  
function ClientResourceStart_RESGUIInfo() 
  return true 
end 
  
------------------------------------------------------------------------------------------- 
-- Resource Stop -- 
------------------------------------------------------------------------------------------- 
  
function ClientResourceStop_RESGUIInfo() 
  if GUIInfo.Habilitado[localPlayer] then 
    Desabilitar_RESGUIInfo() 
  end 
  return true 
end 
  
------------------------------------------------------------------------------------------- 
-- Habilitar GUI Info -- 
------------------------------------------------------------------------------------------- 
  
function Habilitar_RESGUIInfo(titulo, texto1, texto2, texto3, texto4, deguimode) 
  if GUIInfo.Habilitado[localPlayer] then 
    Desabilitar_RESGUIInfo() 
  end 
  GUIInfo.Habilitado[localPlayer] = true 
  Habilitar_RESGUIMode() 
  Habilitar_GUI_RESGUIInfo(titulo, texto1, texto2, texto3, texto4, deguimode) 
  return true 
end 
  
------------------------------------------------------------------------------------------- 
-- Desabilitar GUI Info -- 
------------------------------------------------------------------------------------------- 
  
function Desabilitar_RESGUIInfo() 
  if GUIInfo.DeGUIMode[localPlayer] then 
    Desabilitar_RESGUIMode() 
  end 
  Desabilitar_GUI_RESGUIInfo() 
  GUIInfo.Habilitado[localPlayer] = false 
  GUIInfo.DeGUIMode[localPlayer] = false 
  return true 
end 
  
------------------------------------------------------------------------------------------- 
-- Habilitar GUI -- 
------------------------------------------------------------------------------------------- 
  
function Habilitar_GUI_RESGUIInfo(titulo, texto1, texto2, texto3, texto4, deguimode) 
  local Tamanho_Texto1 = 1 
  local Tamanho_Texto2 = 1 
  local Tamanho_Texto3 = 1 
  local Tamanho_Texto4 = 1 
  local Width_GUI_Window1 = {} 
  local X_GUI_Image1 = {} 
  local X_GUI_Label1 = {} 
  local X_GUI_Button1 = {} 
  if texto1 then 
    Tamanho_Texto1 = string.len(texto1)  
  end 
  if texto2 then 
    Tamanho_Texto2 = string.len(texto2)  
  end 
  if texto3 then 
    Tamanho_Texto3 = string.len(texto3)  
  end 
  if texto4 then 
    Tamanho_Texto4 = string.len(texto4)  
  end 
  if string.len(Tamanho_Texto1) > 120 or string.len(Tamanho_Texto2) > 120 or string.len(Tamanho_Texto3) > 120 or string.len(Tamanho_Texto4) > 120 then 
    Width_GUI_Window1 = 622 
    X_GUI_Image1 = 0 
    X_GUI_Label1 = 42 
    X_GUI_Button1 = 452 
  elseif string.len(Tamanho_Texto1) > 90 or string.len(Tamanho_Texto2) > 90 or string.len(Tamanho_Texto3) > 90 or string.len(Tamanho_Texto4) > 90 then 
    Width_GUI_Window1 = 572 
    X_GUI_Image1 = 5 
    X_GUI_Label1 = 47 
    X_GUI_Button1 = 502 
  elseif string.len(Tamanho_Texto1) > 60 or string.len(Tamanho_Texto2) > 60 or string.len(Tamanho_Texto3) > 60 or string.len(Tamanho_Texto4) > 60 then 
    Width_GUI_Window1 = 522 
    X_GUI_Image1 = 10 
    X_GUI_Label1 = 52 
    X_GUI_Button1 = 452 
  else 
    Width_GUI_Window1 = 472 
    X_GUI_Image1 = 15 
    X_GUI_Label1 = 57  
    X_GUI_Button1 = 402 
  end 
  GUIInfo.GUI_Window[1][localPlayer] = guiCreateWindow(456, 248, Width_GUI_Window1, 149, "", false) 
  guiWindowSetSizable(GUIInfo.GUI_Window[1][localPlayer], false) 
  GUIInfo.GUI_Image[1][localPlayer] = guiCreateStaticImage(X_GUI_Image1, 27, 32, 32, ':', false, GUIInfo.GUI_Window[1][localPlayer])---- is line 141-- 
  GUIInfo.GUI_Label[1][localPlayer] = guiCreateLabel(X_GUI_Label1, 34, 405, 15, titulo, false, GUIInfo.GUI_Window[1][localPlayer]) 
  guiSetFont(GUIInfo.GUI_Label[1][localPlayer], "default-bold-small") 
  GUIInfo.GUI_Label[2][localPlayer] = guiCreateLabel(10, 73, 552, 15, texto1, false, GUIInfo.GUI_Window[1][localPlayer]) 
  guiSetFont(GUIInfo.GUI_Label[2][localPlayer], "clear-normal") 
  guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[2][localPlayer], "center", false) 
  if texto4 then 
    GUIInfo.GUI_Label[3][localPlayer] = guiCreateLabel(10, 92, 552, 15, texto2, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetFont(GUIInfo.GUI_Label[3][localPlayer], "clear-normal") 
    guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[3][localPlayer], "center", false) 
    GUIInfo.GUI_Label[4][localPlayer] = guiCreateLabel(10, 107, 552, 15, texto3, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetFont(GUIInfo.GUI_Label[4][localPlayer], "clear-normal") 
    guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[4][localPlayer], "center", false)       
    GUIInfo.GUI_Label[5][localPlayer] = guiCreateLabel(10, 118, 552, 15, texto4, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetFont(GUIInfo.GUI_Label[5][localPlayer], "clear-normal") 
    guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[5][localPlayer], "center", false)       
    GUIInfo.GUI_Label[6][localPlayer] = guiCreateLabel(5, 154, 377, 15, Msg_GUI_Creditos, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetAlpha(GUIInfo.GUI_Label[6][localPlayer], 0.20) 
    guiSetFont(GUIInfo.GUI_Label[6][localPlayer], "default-small")      
  elseif texto3 then 
    GUIInfo.GUI_Label[3][localPlayer] = guiCreateLabel(10, 92, 552, 15, texto2, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetFont(GUIInfo.GUI_Label[3][localPlayer], "clear-normal") 
    guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[3][localPlayer], "center", false) 
    GUIInfo.GUI_Label[4][localPlayer] = guiCreateLabel(10, 107, 552, 15, texto3, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetFont(GUIInfo.GUI_Label[4][localPlayer], "clear-normal") 
    guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[4][localPlayer], "center", false)       
    GUIInfo.GUI_Label[5][localPlayer] = guiCreateLabel(5, 154, 377, 15, Msg_GUI_Creditos, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetAlpha(GUIInfo.GUI_Label[5][localPlayer], 0.20) 
    guiSetFont(GUIInfo.GUI_Label[5][localPlayer], "default-small")      
  elseif texto2 then 
    GUIInfo.GUI_Label[3][localPlayer] = guiCreateLabel(10, 92, 552, 15, texto2, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetFont(GUIInfo.GUI_Label[3][localPlayer], "clear-normal") 
    guiLabelSetHorizontalAlign(GUIInfo.GUI_Label[3][localPlayer], "center", false) 
    GUIInfo.GUI_Label[4][localPlayer] = guiCreateLabel(5, 139, 377, 15, Msg_GUI_Creditos, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetAlpha(GUIInfo.GUI_Label[4][localPlayer], 0.20) 
    guiSetFont(GUIInfo.GUI_Label[4][localPlayer], "default-small")      
  else 
    GUIInfo.GUI_Label[3][localPlayer] = guiCreateLabel(5, 124, 377, 15, Msg_GUI_Creditos, false, GUIInfo.GUI_Window[1][localPlayer]) 
    guiSetAlpha(GUIInfo.GUI_Label[3][localPlayer], 0.20) 
    guiSetFont(GUIInfo.GUI_Label[3][localPlayer], "default-small")      
  end 
  GUIInfo.GUI_Button[1][localPlayer] = guiCreateButton(X_GUI_Button1, 133, 60, 21, "Fechar", false, GUIInfo.GUI_Window[1][localPlayer]) 
  GUIInfo.DeGUIMode[localPlayer] = deguimode   
  addEventHandler("onClientGUIClick", GUIInfo.GUI_Button[1][localPlayer], Desabilitar_RESGUIInfo, false) 
  return true         
end 
  
------------------------------------------------------------------------------------------- 
-- Desabilitar GUI -- 
------------------------------------------------------------------------------------------- 
  
function Desabilitar_GUI_RESGUIInfo() 
  if isElement(GUIInfo.GUI_Window[1][localPlayer]) then 
    destroyElement(GUIInfo.GUI_Window[1][localPlayer]) 
  end 
  if isElement(GUIInfo.GUI_Image[1][localPlayer]) then 
    destroyElement(GUIInfo.GUI_Image[1][localPlayer]) 
  end 
  if isElement(GUIInfo.GUI_Label[1][localPlayer]) then 
    destroyElement(GUIInfo.GUI_Label[1][localPlayer]) 
  end 
  if isElement(GUIInfo.GUI_Label[2][localPlayer]) then 
  destroyElement(GUIInfo.GUI_Label[2][localPlayer]) 
  end 
  if isElement(GUIInfo.GUI_Label[3][localPlayer]) then 
    destroyElement(GUIInfo.GUI_Label[3][localPlayer]) 
  end 
  if isElement(GUIInfo.GUI_Label[4][localPlayer]) then 
    destroyElement(GUIInfo.GUI_Label[4][localPlayer]) 
  end 
  if isElement(GUIInfo.GUI_Label[5][localPlayer]) then 
    destroyElement(GUIInfo.GUI_Label[5][localPlayer]) 
  end 
  if isElement(GUIInfo.GUI_Button[1][localPlayer]) then 
    destroyElement(GUIInfo.GUI_Button[1][localPlayer]) 
  end 
  return true 
end 
  
------------------------------------------------------------------------------------------- 
-- Eventos para chamada exterior -- 
------------------------------------------------------------------------------------------- 
addEvent("Habilitar_RESGUIInfo", true) 
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), ClientResourceStart_RESGUIInfo) 
addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), ClientResourceStop_RESGUIInfo) 
addEventHandler("Habilitar_RESGUIInfo", getRootElement(), Habilitar_RESGUIInfo) 
------------------------------------------------------------------------------------------- 

my script is error

15z4n6q.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...