Jump to content

iFoReX

Members
  • Posts

    1,708
  • Joined

  • Last visited

Everything posted by iFoReX

  1. getElementInterior con eso
  2. como triggear esto cl-side GUIEditor_Window = {} GUIEditor_Label = {} GUIEditor_Grid = {} function creandoLaGUI() GUIEditor_Window[1] = guiCreateWindow(0.2275,0.2367,0.5400,0.5200,"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[7] = guiCreateLabel(10,125,233,23,"Team : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[7],"clear-normal") GUIEditor_Label[9] = guiCreateLabel(10,259,149,16,"Stars : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[8],"default-bold-small") GUIEditor_Label[8] = guiCreateLabel(10,290,149,16,"GUI Made By ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[8],255,255,0) guiSetFont(GUIEditor_Label[8],"default-bold-small") guiSetVisible( GUIEditor_Window[1], false ) showCursor ( false ) guiWindowSetSizable ( GUIEditor_Window[1], false ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), creandoLaGUI) 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, 255, 255, 0, 255 ) end end end addEventHandler("onClientPlayerJoin", getRootElement(), atualizarlista) addEventHandler("onClientPlayerQuit", getRootElement(), atualizarlista) addEventHandler("onClientPlayerChangeNick", getRootElement(), atualizarlista) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), atualizarlista) function anunciarGUI() outputChatBox( "[server] #000FFFPara ver la GUI De Stats porfavor preciona #00FF00F2", 255, 0, 0, true ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), anunciarGUI) addEventHandler("onClientPlayerJoin", anunciarGUI2) function anunciarGUI2() outputChatBox( "[server] #000FFFPara ver la GUI De Stats porfavor preciona #00FF00F2", localPlayer, 255, 0, 0, true ) end 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 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[7], "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 ) local table = {{255, 0, 0},{0, 255, 0},{0, 0, 255},{255, 255, 0}} setTimer( function () guiLabelSetColor( GUIEditor_Label[8], unpack(table[math.random(#table)]) ) end , 400, 0 ) con este sv-side function getwan() local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do local wanted = getPlayerWantedLevel(thePlayer) local zero = "" local one = "*" local two = "**" local three = "***" local four = "****" local five = "*****" local six = "******" if wanted == 0 then setElementData ( thePlayer, "Wanted", zero ) else if wanted == 1 then setElementData ( thePlayer, "Wanted", one ) else if wanted == 2 then setElementData ( thePlayer, "Wanted", two ) else if wanted == 3 then setElementData ( thePlayer, "Wanted", three ) else if wanted == 4 then setElementData ( thePlayer, "Wanted", four ) else if wanted == 5 then setElementData ( thePlayer, "Wanted", five ) else if wanted == 6 then setElementData ( thePlayer, "Wanted", six ) end end end end end end end end end setTimer(getwan,100,0) addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), getwan ) Para obtener las estrellas del player y escribirlas al seleccionar a un player en el gridlist
  3. ai un resouce en la comunidad que hace algo parecido a lo que tu quieres se llama "countryid" y pone el pais del jugador en el scoreboard pero sin imagenes
  4. Solid a mi lo de getElemenetRotation con 1 argumento me funcionaba
  5. @Tittle i cant Put any Theme in my MTA When I go to interface doent appears only the classic and the default please help me
  6. aa si para el give weapon tienes q poner este resource en server-side en meta donde dice type="server" eso
  7. Stats GUI Script For start the Informacion : is a GUI when press F2 open it GUI with message in chatBox and the Gridlist refresh when a Player connect or a Player Quit or a Player Change Name, and Messages in ChatBox with a set Timer of 4 minutes Scripter made By Me and the People of forum help me very thnx to they For Download here https://community.multitheftauto.com/index.php?p=resources&s=details&id=4590 in the community I upload a Some images please rate And comment for some bugg Thnx
  8. seria mas ordenado asi addCommandHandler("cp", function () local x,y,z = getElementPosition( localPlayer ) local rot = getElementRotation ( localPlayer ) local ped1 = createPed(107, x, y, z, rot ) setPedAnimation(ped1, "ped", "WALK_gang1") giveWeapon(ped1, 31, 800) end ) en un rato lo pruebo en mi sver y te digo q tal EDIT : Ya lo probe funciona Perfectamente pruebalo en el tuyo y dime q tal
  9. Ok aca esta todo 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[7] = guiCreateLabel(10,125,233,23,"Team : \"\"",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Label[7],"clear-normal") credits = guiCreateLabel(10,290,233,23,"GUI Made by ElMota",false,GUIEditor_Window[1]) ---Aqui esta el LABEL 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[7], "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 )
  10. 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])
  11. Verdad yakusa tienes que triggear server y client lo mismo q me paso con la IP
  12. 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 )
  13. Ok man no problem , ahora podria usar lo que tu hiciste ? Probaste con (source) ?
  14. y cuando un player se desconecta no se sale del gridlist
  15. 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 )
  16. 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
  17. lo testeo y te digo q tal EDIT: Ahora funciona me cambie el name y funciona peroc uando me conecto no aparesco
  18. Ok yakusa gracias , cualquier cosa avisame
  19. 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 )
  20. #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
  21. ve ahora exports.dxscoreboard:addScoreboardColumn('Rango') addEventHandler("onPlayerSpawn",root, function() local account = getPlayerAccount(source) local zombieKills = getAccountData(account,"Zombie kills") if (zombiekills > 0) and (zombiekills < 4) then setAccountData ( account, "Rango", Nuevo ) elseif (zombiekills > 5) and (zombiekills < 99) then setAccountData ( account, "Rango", Iniciado ) elseif (zombiekills > 100) and (zombiekills < 249) then setAccountData ( account, "Rango", Aficionado ) elseif (zombiekills > 250) and (zombiekills < 499) then setAccountData ( account, "Rango", Amateur ) elseif (zombiekills > 500) and (zombiekills < 999) then setAccountData ( account, "Rango", Asesino ) elseif (zombiekills > 1000) and (zombiekills < 1499) then setAccountData ( account, "Rango", Maestro ) elseif (zombiekills > 1500) and (zombiekills < 1999) then setAccountData ( account, "Rango", Cannibal ) elseif (zombiekills > 2000) and (zombiekills < 2999) then setAccountData ( account, "Rango", Rampager ) elseif (zombiekills > 3000) and (zombiekills < 3999) then setAccountData ( account, "Rango", Monster ) elseif (zombiekills > 4000) and (zombiekills < 4999) then setAccountData ( account, "Rango", Blooder ) elseif (zombiekills > 5000) and (zombiekills < 5999) then setAccountData ( account, "Rango", ZombieKiller ) elseif (zombiekills > 5000) and (zombiekills < 5999) then setAccountData ( account, "Rango", HeadShooter ) elseif (zombiekills > 6000) and (zombiekills < 6999) then setAccountData ( account, "Rango", Animal ) elseif (zombiekills > 7000) and (zombiekills < 7999) then setAccountData ( account, "Rango", Depredador ) elseif (zombiekills > 8000) and (zombiekills < 8999) then setAccountData ( account, "Rango", Psicopata ) elseif (zombiekills > 9000) and (zombiekills < 10000000) then setAccountData ( account, "Rango", PsykoKiller ) end )
  22. 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 )
  23. Nose si tu codigo funcione correctamente alex pero asi como isiste los if estan bien pero seria asi addEventHandler("onPlayerSpawn",root, function () local account = getPlayerAccount(source) local zombieKills = getAccountData(account,"Zombie kills") if (zombiekills > 0) and (zombiekills < 5) then setAccountData ( account, "Rango", Nuevo ) elseif (zombiekills > 6) and (zombiekills < 99) then setAccountData ( account, "Rango", Iniciado ) elseif (zombiekills > 100) and (zombiekills < 250) then setAccountData ( account, "Rango", Asesino ) end) Yo ise un script con esto de entre cierta cantidad y me funciono perfecto
×
×
  • Create New...