iFoReX Posted April 6, 2012 Posted April 6, 2012 Como podria aser una GUI para que solo el que tenga mi nombre osea yo pueda abrirla ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Castillo Posted April 6, 2012 Posted April 6, 2012 Pues depende de como quieras que la GUI se muestre, un comando, un bind, simplemente comparas el nombre del jugador. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
iFoReX Posted April 6, 2012 Author Posted April 6, 2012 name = getPlayerName function test() if name is == ElMota[Gold]x~ then guiSetVisible( GUIEditor_Window[1], true ) showCursor(true) end end ) bindKey("F6", "down", test) algo asi ? lo ago de prueba ._. elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Alexs Posted April 6, 2012 Posted April 6, 2012 name = getPlayerName function test() if name is == ElMota[Gold]x~ then guiSetVisible( GUIEditor_Window[1], true ) showCursor(true) end end ) bindKey("F6", "down", test) algo asi ? lo ago de prueba ._. no se mucho pero creo que seria if ( name == ElMota[Gold]x~ ) then Developer @ MYVAL
iFoReX Posted April 6, 2012 Author Posted April 6, 2012 name = getPlayerName function test() if name is == ElMota[Gold]x~ then guiSetVisible( GUIEditor_Window[1], true ) showCursor(true) end end ) bindKey("F6", "down", test) algo asi ? lo ago de prueba ._. no se mucho pero creo que seria if ( name == ElMota[Gold]x~ ) then ?? name = getPlayerName function test() if ( name == ElMota[Gold]x~ ) then guiSetVisible( GUIEditor_Window[1], true ) showCursor(true) if ( name == nil ) then guiSetVisible( GUIEditor_Window[1], false ) showCursor(false) end end ) bindKey("F6", "down", test) elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Castillo Posted April 6, 2012 Posted April 6, 2012 Dios mio, sos un desastre ( sin ofender ). function test ( ) local name = getPlayerName ( localPlayer ) if ( name == "ElMota[Gold]x~" ) then guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) end end bindKey ( "F6", "down", test ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Edikosh998 Posted April 6, 2012 Posted April 6, 2012 Dios mio, sos un desastre ( sin ofender ). function test ( ) local name = getPlayerName ( localPlayer ) if ( name == "ElMota[Gold]x~" ) then guiSetVisible ( GUIEditor_Window[1], true ) showCursor ( true ) end end bindKey ( "F6", "down", test ) OFF TOPIC : GRACIAS CASTILLO, me alegraste el dia al decir eso. Yo sinceramente digo, si tenes 14 años...debes de estar scripteando, me dedicaria a jugar o capaz mapear que puede ser mas divertido WRS( World Racing Server) [server] = 8%
iFoReX Posted April 6, 2012 Author Posted April 6, 2012 Pa no crear otro topic me ayudarian a Obtener el nombre de un player ? GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(152,157,149,368,"Jugadores",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Label[1] = guiCreateLabel(8,38,70,15,"ChatPrivado",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],255,0,0) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Grid[1] = guiCreateGridList(9,69,131,290,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) local column =guiGridListAddColumn(GUIEditor_Grid[1],"Jugadores",0.-- s8) --> GUIEditor_Window[2] = guiCreateWindow(300,156,317,370,"Chat",false) guiWindowSetMovable(GUIEditor_Window[2],false) guiWindowSetSizable(GUIEditor_Window[2],false) guiLabelSetColor(GUIEditor_Label[2],255,255,0) guiSetFont(GUIEditor_Label[2],"sa-header") GUIEditor_Memo[1] = guiCreateMemo(10,99,298,215,"",false,GUIEditor_Window[2]) guiMemoSetReadOnly(GUIEditor_Memo[1],true) GUIEditor_Edit[1] = guiCreateEdit(11,318,224,43,"",false,GUIEditor_Window[2]) GUIEditor_Button[1] = guiCreateButton(236,320,72,39,"Enviar",false,GUIEditor_Window[2]) if ( column ) then for id, playeritem in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, column, getPlayerName( playeritem ), false, false ) end end function doubleClickedName( ) local selectedRow, selectedCol = guiGridListGetSelectedItem( GUIEditor_Grid[1] ) local playerName = guiGridListGetItemText( GUIEditor_Grid[1], selectedRow, selectedCol ) GUIEditor_Label[2] = guiCreateLabel(9,57,298,31,"PM a : GetPlayerName",false,GUIEditor_Window[2]) end addEventHandler( "onClientGUIDoubleClick", GUIEditor_Grid[1], doubleClickedName, false ); bindKey ( "F7", "down", function ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) guiSetVisible ( GUIEditor_Window[2], not guiGetVisible ( GUIEditor_Window[2] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end ) ------------------------------------------------- ---poner invisible las GUIs--- guiSetVisible(GUIEditor_Window[1], false) guiSetVisible(GUIEditor_Window[2], false) ------------------------------------------------- elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Castillo Posted April 6, 2012 Posted April 6, 2012 No necesitas obtener el nombre, ya lo tenes en la lista, solo obtene el item que selecciono y cambias el texto del label. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
iFoReX Posted April 6, 2012 Author Posted April 6, 2012 ? function doubleClickedName( ) local selectedRow, selectedCol = guiGridListGetSelectedItem( GUIEditor_Grid[1] ) local playerName = guiGridListGetItemText( GUIEditor_Grid[1], selectedRow, selectedCol ) GUIEditor_Label[2] = guiCreateLabel(9,57,298,31,"PM a : playerName",false,GUIEditor_Window[2]) end addEventHandler( "onClientGUIDoubleClick", GUIEditor_Grid[1], doubleClickedName, false ); elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Castillo Posted April 6, 2012 Posted April 6, 2012 No te das cuenta que aun no tiene sentido? nomas estas cambiando el texto del label a: "PM a : playerName", nada mas. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts