iFoReX Posted April 24, 2012 Posted April 24, 2012 bueeno como dice el titulo quiero saber como darle refresh a una funcion para cuando un player se conecte y a causa de eso se actualize el gridlist Aqui el script GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.2275,0.2367,0.5362,0.5533,"GUI Stats",true) GUIEditor_Grid[1] = guiCreateGridList(261,36,158,280,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Jugadores",0.80) GUIEditor_Label[1] = guiCreateLabel(10,58,233,23,"Nickname : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Label[2] = guiCreateLabel(10,91,233,23,"Location : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Label[3] = guiCreateLabel(10,125,233,23,"Money : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[3],"clear-normal") GUIEditor_Label[4] = guiCreateLabel(10,157,233,23,"Skin : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Label[5] = guiCreateLabel(10,190,233,23,"Ping : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[5],"clear-normal") GUIEditor_Label[6] = guiCreateLabel(10,223,233,23,"Dimension : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[6],"clear-normal") GUIEditor_Label[7] = guiCreateLabel(10,255,233,23,"Serial : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[7],"clear-normal") guiSetVisible( GUIEditor_Window[1], false ) showCursor ( false ) function showGUI ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end bindKey ( "F2","down", showGUI ) function losLabels ( ) 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 end addEventHandler ( "onClientResourceStart", resourceRoot, losLabels ) addEventHandler ( "onClientPlayerJoin", resourceRoot, losLabels ) addEventHandler ( "onClientPlayerQuit", resourceRoot, losLabels ) addEventHandler ( "onClientPlayerChangeNick", resourceRoot, losLabels ) function setStats ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) local thePlayer = getPlayerFromName ( playername ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local location = getZoneName ( x, y, z ) local money = getPlayerMoney( thePlayer ) local id = getElementModel( thePlayer ) local ping = getPlayerPing( thePlayer ) local dm = getElementDimension( thePlayer ) local sr = getPlayerSerial() guiSetText ( GUIEditor_Label[1], "Nickname : ".. playername ) guiSetText ( GUIEditor_Label[2], "Location : ".. location ) guiSetText ( GUIEditor_Label[3], "Money : ".. money ) guiSetText ( GUIEditor_Label[4], "Skin : ".. id ) guiSetText ( GUIEditor_Label[6], "Dimension : ".. dm ) guiSetText ( GUIEditor_Label[7], "Serial : "..tostring(sr) ) if ( ping > 300 ) then guiSetText ( GUIEditor_Label[5], "Ping ( very Bad ) : ".. ping ) elseif ( ping < 300 ) and ( ping > 150 ) then guiSetText ( GUIEditor_Label[5], "Ping ( Good ) : ".. ping ) elseif ( ping < 150 ) and ( ping > 100 ) then guiSetText ( GUIEditor_Label[5], "Ping ( VeryGood ) : ".. ping ) elseif ( ping < 100 ) and ( ping > 150 ) then guiSetText ( GUIEditor_Label[5], "Ping ( Nice! ) : ".. ping ) elseif ( ping > 50 ) and ( ping < 100 ) then guiSetText ( GUIEditor_Label[5], "Ping ( ChileanPlayer! ) : ".. ping ) elseif ( ping > 0 ) and ( ping < 50 ) then guiSetText ( GUIEditor_Label[5], "Ping ( ElMota! ) : ".. ping ) end end end end end addEventHandler ( "onClientGUIDoubleClick", root, setStats ) elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Edikosh998 Posted April 24, 2012 Posted April 24, 2012 onClientRender setTimer -- Es la otra A y che, un ping bueno es de 250 ?? Para mi 250 ms es ya bastante lagoso. WRS( World Racing Server) [server] = 8%
iFoReX Posted April 24, 2012 Author Posted April 24, 2012 #OFFTOPIC : es que no tengo hosting y digamos que mi internet no es tan buena u.u EDIT : ya probe con un timer pero No funciona elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Edikosh998 Posted April 24, 2012 Posted April 24, 2012 Pasame lo que hiciste WRS( World Racing Server) [server] = 8%
iFoReX Posted April 24, 2012 Author Posted April 24, 2012 GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.2275,0.2367,0.5362,0.5533,"GUI Stats",true) GUIEditor_Grid[1] = guiCreateGridList(261,36,158,280,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Jugadores",0.80) GUIEditor_Label[1] = guiCreateLabel(10,58,233,23,"Nickname : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Label[2] = guiCreateLabel(10,91,233,23,"Location : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Label[3] = guiCreateLabel(10,125,233,23,"Money : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[3],"clear-normal") GUIEditor_Label[4] = guiCreateLabel(10,157,233,23,"Skin : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Label[5] = guiCreateLabel(10,190,233,23,"Ping : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[5],"clear-normal") GUIEditor_Label[6] = guiCreateLabel(10,223,233,23,"Dimension : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[6],"clear-normal") GUIEditor_Label[7] = guiCreateLabel(10,255,233,23,"Serial : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[7],"clear-normal") guiSetVisible( GUIEditor_Window[1], false ) showCursor ( false ) function showGUI ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end bindKey ( "F2","down", showGUI ) function losLabels ( ) 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 end setTimer( losLabels, 1500, 1 ) function setStats ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) local thePlayer = getPlayerFromName ( playername ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local location = getZoneName ( x, y, z ) local money = getPlayerMoney( thePlayer ) local id = getElementModel( thePlayer ) local ping = getPlayerPing( thePlayer ) local dm = getElementDimension( thePlayer ) local sr = getPlayerSerial() guiSetText ( GUIEditor_Label[1], "Nickname : ".. playername ) guiSetText ( GUIEditor_Label[2], "Location : ".. location ) guiSetText ( GUIEditor_Label[3], "Money : ".. money ) guiSetText ( GUIEditor_Label[4], "Skin : ".. id ) guiSetText ( GUIEditor_Label[6], "Dimension : ".. dm ) guiSetText ( GUIEditor_Label[7], "Serial : "..tostring(sr) ) if ( ping > 300 ) then guiSetText ( GUIEditor_Label[5], "Ping ( very Bad ) : ".. ping ) elseif ( ping < 300 ) and ( ping > 150 ) then guiSetText ( GUIEditor_Label[5], "Ping ( Good ) : ".. ping ) elseif ( ping < 150 ) and ( ping > 100 ) then guiSetText ( GUIEditor_Label[5], "Ping ( VeryGood ) : ".. ping ) elseif ( ping < 100 ) and ( ping > 150 ) then guiSetText ( GUIEditor_Label[5], "Ping ( Nice! ) : ".. ping ) elseif ( ping > 50 ) and ( ping < 100 ) then guiSetText ( GUIEditor_Label[5], "Ping ( ChileanPlayer! ) : ".. ping ) elseif ( ping > 0 ) and ( ping < 50 ) then guiSetText ( GUIEditor_Label[5], "Ping ( ElMota! ) : ".. ping ) end end end end end addEventHandler ( "onClientGUIDoubleClick", root, setStats ) elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
BorderLine Posted April 24, 2012 Posted April 24, 2012 Estoy intentando averiguar tambien como poder dar refresh man, sakando mas o menos las funciones del panel de admin y para extraer los codigos hexadecimales. y la verdad man me interesa este script porq quiero agregarle una linea que muestre el nombre de user. Mi server tiene clanes por acl y cada recluta debera saber el nombre de usuario del que quiera entrar o salir para poder aplicarlo al comando. Si pillo algo te ayudo man Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 Ok yakusa gracias , cualquier cosa avisame elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
BorderLine Posted April 25, 2012 Posted April 25, 2012 mira pille esto por ai cheka si sirve function atualizarlista() guiGridListClear(playerList) for id, players in ipairs (getElementsByType("player")) do local row = guiGridListAddRow(playerList) guiGridListSetItemText(playerList, row, 1, unfuck(getPlayerName(players)), false, false) guiGridListSetItemColor ( playerList, row, 1, 0, 250, 154, 255 ) end end addEventHandler("onClientPlayerJoin", getRootElement(), atualizarlista) addEventHandler("onClientPlayerQuit", getRootElement(), atualizarlista) addEventHandler("onClientPlayerChangeNick", getRootElement(), atualizarlista) intenta adaptarla Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 lo testeo y te digo q tal EDIT: Ahora funciona me cambie el name y funciona peroc uando me conecto no aparesco elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 ahora si funciona a la perfeccion le puse onClientResourceStart y funciona 100%, pero 1 problema el dinero es solo el q tengo yo no el que tiene el otro player elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
BorderLine Posted April 25, 2012 Posted April 25, 2012 si tambien me fije eso, voy a buscar la manera de arreglarlo, y me parece que tampoco te esta funcionando la IP Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 Si pero lo cambie por la serial para no complicarme tanto ahora mi codigo es asi GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.2275,0.2367,0.5362,0.5533,"GUI Stats",true) GUIEditor_Grid[1] = guiCreateGridList(261,36,158,280,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Jugadores",0.80) GUIEditor_Label[1] = guiCreateLabel(10,58,233,23,"Nickname : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Label[2] = guiCreateLabel(10,91,233,23,"Location : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Label[3] = guiCreateLabel(10,125,233,23,"Money : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[3],"clear-normal") GUIEditor_Label[4] = guiCreateLabel(10,157,233,23,"Skin : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Label[5] = guiCreateLabel(10,190,233,23,"Ping : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[5],"clear-normal") GUIEditor_Label[6] = guiCreateLabel(10,223,233,23,"Dimension : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[6],"clear-normal") GUIEditor_Label[7] = guiCreateLabel(10,255,233,23,"Serial : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[7],"clear-normal") GUIEditor_Label[8] = guiCreateLabel(10,287,233,23,"Team : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[7],"clear-normal") guiSetVisible( GUIEditor_Window[1], false ) showCursor ( false ) function showGUI ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end bindKey ( "F2","down", showGUI ) function atualizarlista() guiGridListClear(GUIEditor_Grid[1]) for id, players in ipairs (getElementsByType("player")) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, 1, (getPlayerName(players)), false, false) guiGridListSetItemColor ( GUIEditor_Grid[1], row, 1, 0, 250, 255, 255 ) end end addEventHandler("onClientPlayerJoin", getRootElement(), atualizarlista) addEventHandler("onClientPlayerQuit", getRootElement(), atualizarlista) addEventHandler("onClientPlayerChangeNick", getRootElement(), atualizarlista) addEventHandler("onClientResourceStart", getRootElement(), atualizarlista) function setStats ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) local thePlayer = getPlayerFromName ( playername ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local location = getZoneName ( x, y, z ) local money = getPlayerMoney( thePlayer ) local id = getElementModel( thePlayer ) local ping = getPlayerPing( thePlayer ) local dm = getElementDimension( thePlayer ) local sr = getPlayerSerial() local tm1 = getPlayerTeam( thePlayer ) local tm2 = getTeamName( tm1 ) guiSetText ( GUIEditor_Label[1], "Nickname : ".. playername ) guiSetText ( GUIEditor_Label[2], "Location : ".. location ) guiSetText ( GUIEditor_Label[3], "Money : ".. money ) guiSetText ( GUIEditor_Label[4], "Skin : ".. id ) guiSetText ( GUIEditor_Label[6], "Dimension : ".. dm ) guiSetText ( GUIEditor_Label[7], "Serial : "..tostring(sr) ) guiSetText ( GUIEditor_Label[8], "Team : ".. tm2 ) if ( ping > 300 ) then guiSetText ( GUIEditor_Label[5], "Ping ( very Bad ) : ".. ping ) elseif ( ping < 300 ) and ( ping > 150 ) then guiSetText ( GUIEditor_Label[5], "Ping ( Good ) : ".. ping ) elseif ( ping < 150 ) and ( ping > 100 ) then guiSetText ( GUIEditor_Label[5], "Ping ( VeryGood ) : ".. ping ) elseif ( ping < 100 ) and ( ping > 150 ) then guiSetText ( GUIEditor_Label[5], "Ping ( Nice! ) : ".. ping ) elseif ( ping > 50 ) and ( ping < 100 ) then guiSetText ( GUIEditor_Label[5], "Ping ( ChileanPlayer! ) : ".. ping ) elseif ( ping > 0 ) and ( ping < 50 ) then guiSetText ( GUIEditor_Label[5], "Ping ( ElMota! ) : ".. ping ) end end end end end addEventHandler ( "onClientGUIDoubleClick", root, setStats ) elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 y cuando un player se desconecta no se sale del gridlist 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 25, 2012 Posted April 25, 2012 1: No hagas dos post seguidos, edita el anterior. 2: getPlayerMoney client side solo obtiene el dinero del cliente, no sirve para jugadores remotos. 3: Podes enviar a los jugadores desde el server side al client side. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 y la serial supongo q tampoco 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 25, 2012 Posted April 25, 2012 y la serial supongo q tampoco getPlayerSerial es client y server side Developer @ MYVAL
Castillo Posted April 25, 2012 Posted April 25, 2012 Tampoco, vos podes saber si soporta un jugador remoto en la wiki: https://wiki.multitheftauto.com/wiki/GetPlayerSerial Fijate que dice los argumentos para el server y el client side. En el client side solo dice: string getPlayerSerial ( ) Y en el server side dice: string getPlayerSerial ( player thePlayer ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
BorderLine Posted April 25, 2012 Posted April 25, 2012 @ElMota Incluyendo tus derechos de autor yo estaba modificando uno ami modo, y bueno tenia algo asi, solid nose que falla, nose si sera el trigger o algo Clientside function setStats ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) local thePlayer = getPlayerFromName ( playername ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local location = getZoneName ( x, y, z ) local id = getElementModel( thePlayer ) local tm1 = getPlayerTeam( thePlayer ) local tm2 = getTeamName( tm1 ) triggerServerEvent( "getUn", getLocalPlayer(), thePlayer ) triggerServerEvent( "getMon", getLocalPlayer(), thePlayer ) triggerServerEvent( "getSer", getLocalPlayer(), thePlayer ) guiSetText ( GUIEditor_Label[1], "Nickname : ".. playername ) guiSetText ( GUIEditor_Label[2], "Location : ".. location ) guiSetText ( GUIEditor_Label[3], "Money : ".. money ) guiSetText ( GUIEditor_Label[4], "Skin : ".. id ) guiSetText ( GUIEditor_Label[5], "Serial : ".. theSerial ) guiSetText ( GUIEditor_Label[6], "Team : ".. tm2 ) guiSetText ( GUIEditor_Label[7], "Username : ".. un ) end end end end addEventHandler ( "onClientGUIDoubleClick", root, setStats ) Server function getUN(thePlayer) local un = getAccountName ( thePlayer ) end addEvent("getUN", true) addEventHandler("getUN", getRootElement(), getUN) function getMon(thePlayer) local money = getPlayerMoney(thePlayer) end addEvent("getMon", true) addEventHandler("getMon", getRootElement(), getMon) function getSer(thePlayer) local theSerial = getPlayerSerial( thePlayer ) end addEvent("getSer", true) addEventHandler("getSer", getRootElement(), getSer) Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 Ok man no problem , ahora podria usar lo que tu hiciste ? Probaste con (source) ? elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
BorderLine Posted April 25, 2012 Posted April 25, 2012 nomas me muestra el nombre y la localidad y si, acabo de probar con source Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 por esa razon es q casi nunca triggeo Buee y he aqui como finalmnete me qdo en script *-* GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Grid = {} GUIEditor_Window[1] = guiCreateWindow(0.2275,0.2367,0.5362,0.4900,"GUI Stats",true) GUIEditor_Grid[1] = guiCreateGridList(261,36,158,280,false,GUIEditor_Window[1]) column = guiGridListAddColumn(GUIEditor_Grid[1],"Jugadores",0.80) GUIEditor_Label[1] = guiCreateLabel(10,58,233,23,"Nickname : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[1],"clear-normal") GUIEditor_Label[2] = guiCreateLabel(10,91,233,23,"Location : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[2],"clear-normal") GUIEditor_Label[4] = guiCreateLabel(10,157,233,23,"Skin : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[4],"clear-normal") GUIEditor_Label[5] = guiCreateLabel(10,190,233,23,"Ping : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[5],"clear-normal") GUIEditor_Label[6] = guiCreateLabel(10,223,233,23,"Dimension : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[6],"clear-normal") GUIEditor_Label[8] = guiCreateLabel(10,125,233,23,"Team : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[7],"clear-normal") GUIEditor_Label[8] = guiCreateLabel(10,125,233,23,"Team : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[7],"clear-normal") guiSetVisible( GUIEditor_Window[1], false ) showCursor ( false ) function showGUI ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end bindKey ( "F2","down", showGUI ) function atualizarlista() guiGridListClear(GUIEditor_Grid[1]) if (guiGridListClear) then for id, players in ipairs (getElementsByType("player")) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, 1, (getPlayerName(players)), false, false) guiGridListSetItemColor ( GUIEditor_Grid[1], row, 1, 0, 250, 255, 255 ) end end end addEventHandler("onClientPlayerJoin", getRootElement(), atualizarlista) addEventHandler("onClientPlayerQuit", getRootElement(), atualizarlista) addEventHandler("onClientPlayerChangeNick", getRootElement(), atualizarlista) addEventHandler("onClientResourceStart", getRootElement(), atualizarlista) function anunciarGUI() outputChatBox( "[server] #000FFFPara ver la GUI De Stats porfavor preciona #00FF00F2", 255, 0, 0, true ) end addEventHandler("onClientResourceStart", getRootElement(), anunciarGUI) addEventHandler("onClientPlayerJoin", getRootElement(), anunciarGUI) setTimer( function() outputChatBox( "[server] #000FFFPara ver la GUI De Stats porfavor preciona #00FF00F2", 255, 0, 0, true ) end , 300000, 1 ) function setStats ( ) if ( source == GUIEditor_Grid[1] ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local playername = guiGridListGetItemText ( source, row, col ) local thePlayer = getPlayerFromName ( playername ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) local location = getZoneName ( x, y, z ) local money = getPlayerMoney( thePlayer ) local id = getElementModel( thePlayer ) local ping = getPlayerPing( thePlayer ) local dm = getElementDimension( thePlayer ) local tm1 = getPlayerTeam( thePlayer ) local tm2 = getTeamName( tm1 ) guiSetText ( GUIEditor_Label[1], "Nickname : ".. playername ) guiSetText ( GUIEditor_Label[2], "Location : ".. location ) guiSetText ( GUIEditor_Label[4], "Skin : ".. id ) guiSetText ( GUIEditor_Label[6], "Dimension : ".. dm ) guiSetText ( GUIEditor_Label[8], "Team : ".. tm2 ) if ( ping > 300 ) then guiSetText ( GUIEditor_Label[5], "Ping ( very Bad ) : ".. ping ) elseif ( ping < 300 ) and ( ping > 150 ) then guiSetText ( GUIEditor_Label[5], "Ping ( Good ) : ".. ping ) elseif ( ping < 150 ) and ( ping > 100 ) then guiSetText ( GUIEditor_Label[5], "Ping ( VeryGood ) : ".. ping ) elseif ( ping < 100 ) and ( ping > 150 ) then guiSetText ( GUIEditor_Label[5], "Ping ( Nice! ) : ".. ping ) elseif ( ping > 50 ) and ( ping < 100 ) then guiSetText ( GUIEditor_Label[5], "Ping ( ChileanPlayer! ) : ".. ping ) elseif ( ping > 0 ) and ( ping < 50 ) then guiSetText ( GUIEditor_Label[5], "Ping ( ElMota! ) : ".. ping ) end end end end end addEventHandler ( "onClientGUIDoubleClick", root, setStats ) 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 25, 2012 Posted April 25, 2012 Te olvidaste de triggerClientEvent, no pensaras que es magico y se auto envia el dato? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 Verdad yakusa tienes que triggear server y client lo mismo q me paso con la IP elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
BorderLine Posted April 25, 2012 Posted April 25, 2012 triggear desde client a server? y desde server a client?? jamas habia hecho eso Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
iFoReX Posted April 25, 2012 Author Posted April 25, 2012 yendo a otro tema porq este label no se me agrega a la GUI credits = guiCreateLabel(10,290,233,23,"GUI Made by ElMota",false,GUIEditor_Window[1]) elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Recommended Posts