Jump to content

Master_MTA

Members
  • Posts

    3,389
  • Joined

  • Last visited

  • Days Won

    55

Master_MTA last won the day on June 30 2020

Master_MTA had the most liked content!

About Master_MTA

  • Birthday 13/05/1999

Details

  • Gang
    N/A
  • Location
    Egypt
  • Occupation
    -
  • Interests
    Programming

Recent Profile Visitors

11,477 profile views

Master_MTA's Achievements

Hoo-Rider

Hoo-Rider (42/54)

1.1k

Reputation

Single Status Update

See all updates by Master_MTA

  1. tengo una duda he creado este panel para cambiar de team es decir que yo le cambie el team a un jugador pero cuando le doy "CONTRATAR" me cambia el team a mi que hago?

     

    client

    function empre()
    local screenW, screenH = guiGetScreenSize()
            contrataciones = guiCreateWindow((screenW - 628) / 2, (screenH - 430) / 2, 628, 430, "NOMBRE DE LA EMPRESA", false)
            guiSetProperty(contrataciones, "CaptionColour", "FF0036FE")
    
            jugador = guiCreateGridList(44, 43, 233, 338, false, contrataciones)
            guiGridListAddColumn(jugador, "Jugadores", 0.9)
    		for _, player in ipairs(getElementsByType("player")) do
    		guiGridListAddRow(jugador, getPlayerName(player))
    		end
            contrar = guiCreateButton(368, 107, 176, 43, "CONTRATAR", false, contrataciones)
            guiSetProperty(contrar, "NormalTextColour", "FF2FFD00")
            x = guiCreateButton(574, 33, 44, 42, "X", false, contrataciones)
            guiSetProperty(x, "NormalTextColour", "FFFC0000")
            despe = guiCreateButton(368, 251, 176, 43, "DESPEDIR", false, contrataciones)
            guiSetProperty(despe, "NormalTextColour", "FFFC0000")    
    		
    		showCursor (true)
    
    end	
    addEvent( "onEmpresa", true )
    addEventHandler( "onEmpresa", localPlayer, empre )
    
    addEventHandler('onClientGUIClick',root,
    function()
    if source == contrar then
    triggerServerEvent('setEmpresa',localPlayer)
    guiSetVisible(contrataciones,false)
    showCursor(false)
    end
    end)	
    
    addEventHandler('onClientGUIClick',root,
    function()
    if source == despe then
    triggerServerEvent('setEmpresaNo',localPlayer)
    guiSetVisible(contrataciones,false)
    showCursor(false)
    end
    end)
    
    addEventHandler('onClientGUIClick',root,
    function()
    if source == x then
    guiSetVisible(contrataciones,false)
    showCursor(false)
    end
    end)

     

    server

    empresa = createTeam("TEAM", 0, 255, 0) --team
      
    addEvent('setEmpresa',true)  --contratar,
    addEventHandler('setEmpresa',root,
    function()
    	local teamPlayer = getPlayerTeam ( source )
    	if teamPlayer then
    	setPlayerTeam ( source, nil )
    	setPlayerTeam ( source, empresa )
    	else
    	setPlayerTeam ( source, empresa )
        end
    end)
    
    addEvent('setEmpresaNo',true) --despedir
    addEventHandler('setEmpresaNo',root, 
    function()
    	local playerTeam = getPlayerTeam( source )
    	if ( getTeamName( playerTeam ) == "TEAM" ) then --team
            setPlayerTeam ( source, nil )
        end
    end)
    
    addCommandHandler ("empresa",   --Comando, no confundir con teleport
    	function ( playerSource )
    	account = getPlayerAccount(playerSource)
    	accname = getAccountName(account) 
    	if( accname == "Juan_Camilo" ) then -- lo que esta dentro de las comillas es el nombre de la cuenta que tiene permitido usar el comando.
    	triggerClientEvent ( playerSource, "onEmpresa", playerSource)
    	end
    	end
    )

     

    1. Master_MTA

      Master_MTA

      -- client
      addEventHandler('onClientGUIClick',root,
      function()
      if source == contrar then
            local sel = guiGridListGetSelectedItem(jugador)
            
            if sel==-1 then outputChatBox( 'por favor seleccione jugador',255,0,0 ) return end
            local plrname = guiGridListGetItemText(jugador , sel , 1)
            if not getPlayerFromName(plrname) then outputChatBox( 'no puedo encontrar jugador',255,0,0 ) return end
      triggerServerEvent('setEmpresa',localPlayer , getPlayerFromName(plrname))
      guiSetVisible(contrataciones,false)
      showCursor(false)
      end
      end)	
      
      --server
      
      addEvent('setEmpresa',true)  --contratar,
      addEventHandler('setEmpresa',root,
      function(plr)
      		setPlayerTeam ( plr, empresa )
      end)

      No puedo hablar español pero prefiero

×
×
  • Create New...