Angel Carvajal

TeamSpawnPanel

Recommended Posts

Quisiera como pudiera hacer que mi panel cuando muera alguien se abra automaticamente ya que solo abre cuando entras al sv

 

x,y = guiGetScreenSize()

JobsWin = guiCreateWindow(x/3 - 170,y/3 - 20,200,320,"Selecciona Tu Equipo",false)

teamsList = guiCreateGridList(0,22,186,255,false,JobsWin)
column = guiGridListAddColumn( teamsList, "Teams", 0.85 )
	
for id, team in ipairs(getElementsByType("team")) do
		local row = guiGridListAddRow ( teamsList )
		guiGridListSetItemText ( teamsList, row, 1, getTeamName ( team ), false, false )
		guiGridListSetItemColor ( teamsList, row, 1, getTeamColor ( team ) )
end

guiWindowSetMovable ( teamsList, false )
guiWindowSetMovable ( JobsWin, false )
guiWindowSetSizable ( teamsList, false )
guiWindowSetSizable ( JobsWin, false )
 
send = guiCreateButton(0,285,90,25,"Seleccionar",false,JobsWin)

CloseButton = guiCreateButton(105,285,90,25,"Cerrar",false,JobsWin)

guiSetVisible(JobsWin, true)
showCursor(true)
setTimer ( showingTeams, 1000, 1)

function close()
if source == CloseButton then
guiSetVisible(JobsWin, false)
showCursor(false)
end
end

addEventHandler ( "onClientGUIClick", root,
function ( button )
if button == "left" then
if source == send then
local row, col = guiGridListGetSelectedItem ( teamsList )
local teamName = guiGridListGetItemText ( teamsList, row, col )
triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(), teamName )
end
end
end)

addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), close)

 

Edited by Angel Carvajal

Share this post


Link to post
25 minutes ago, Angel Carvajal said:

quisiera saber como puedo hacer que el panel se abra automaticamente cuando un jugador muera y tambien como privatizar para que solo entren algunos jguadores en ciertos teams 

 


x,y = guiGetScreenSize()

JobsWin = guiCreateWindow(x/3 - 170,y/3 - 20,200,320,"Selecciona Tu Equipo",false)

teamsList = guiCreateGridList(0,22,186,255,false,JobsWin)
column = guiGridListAddColumn( teamsList, "Teams", 0.85 )
	
for id, team in ipairs(getElementsByType("team")) do
		local row = guiGridListAddRow ( teamsList )
		guiGridListSetItemText ( teamsList, row, 1, getTeamName ( team ), false, false )
		guiGridListSetItemColor ( teamsList, row, 1, getTeamColor ( team ) )
end

guiWindowSetMovable ( teamsList, false )
guiWindowSetMovable ( JobsWin, false )
guiWindowSetSizable ( teamsList, false )
guiWindowSetSizable ( JobsWin, false )
 
send = guiCreateButton(0,285,90,25,"Seleccionar",false,JobsWin)

CloseButton = guiCreateButton(105,285,90,25,"Cerrar",false,JobsWin)

guiSetVisible(JobsWin, true)
showCursor(true)
setTimer ( showingTeams, 1000, 1)

function close()
if source == CloseButton then
guiSetVisible(JobsWin, false)
showCursor(false)
end
end

addEventHandler ( "onClientGUIClick", root,
function ( button )
if button == "left" then
if source == send then
local row, col = guiGridListGetSelectedItem ( teamsList )
local teamName = guiGridListGetItemText ( teamsList, row, col )
triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(), teamName )
end
end
end)

addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), close)

 

 

Share this post


Link to post

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.