leonmrtin123 Posted January 12, 2016 Share Posted January 12, 2016 Bueno hola estoy haciendo un panel de moderador y el problema que tengo es que no muestra la lista de jugadores y en el debugscript 3 no hay ningun error. Client function panelmod() ventanita = guiCreateWindow(533, 210, 602, 381, "Panel mod", false) guiWindowSetSizable(ventanita, false) botonmute = guiCreateButton(9, 35, 96, 44, "Mutear", false, ventanita) botonban = guiCreateButton(170, 35, 96, 44, "Banear", false, ventanita) botonkick = guiCreateButton(10, 124, 96, 44, "Kickear", false, ventanita) botonspect = guiCreateButton(170, 122, 96, 44, "Ver", false, ventanita) botonslap = guiCreateButton(9, 216, 96, 44, "Slap", false, ventanita) botonwarp = guiCreateButton(170, 215, 96, 44, "Warpear", false, ventanita) botonwarpto = guiCreateButton(96, 305, 96, 44, "Warpear hacia", false, ventanita) labelname = guiCreateLabel(448, 32, 49, 18, "Nombre", false, ventanita) labelaccount = guiCreateLabel(448, 60, 49, 18, "Cuenta", false, ventanita) labelping = guiCreateLabel(447, 88, 49, 18, "Ping", false, ventanita) labelip = guiCreateLabel(448, 116, 49, 18, "IP", false, ventanita) labelserial = guiCreateLabel(448, 148, 49, 18, "Serial", false, ventanita) labelteam = guiCreateLabel(447, 176, 49, 18, "Team", false, ventanita) labelmoney = guiCreateLabel(448, 204, 49, 18, "Dinero", false, ventanita) labeldim = guiCreateLabel(448, 232, 58, 18, "Dimension", false, ventanita) labelint = guiCreateLabel(447, 260, 49, 18, "Interior", false, ventanita) gridlistt = guiCreateGridList(278, 12, 169, 359, false, ventanita) column = guiGridListAddColumn(gridlistt, "Jugadores", 0.9) cerrarp = guiCreateButton(487, 315, 75, 37, "Cerrar", false, ventanita) showCursor(true) addEventHandler("onClientGUIClick", cerrarp, exittt) end addCommandHandler("panelmod", panelmod) function createlistp() if(column) then for id, playeritem in ipairs(getElementsByType("player")) do row = guiGridListAddRow(gridlistt) guiGridListSetItemText(gridlistt, row, column, getPlayerName(playeritem), false, false) end end end addEventHandler("onClientResourceStart", getRootElement(), createlistp) function exittt() guiSetVisible(ventanita, false) showCursor(false) end Link to comment
Tomas Posted January 12, 2016 Share Posted January 12, 2016 function createlistp() for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(gridlistt) guiGridListSetItemText(gridlistt, row, 1, getPlayerName(playeritem), false, false) end end addEventHandler("onClientResourceStart", getRootElement(), createlistp) Link to comment
leonmrtin123 Posted January 12, 2016 Author Share Posted January 12, 2016 Gracias me funciono pero como podria hacer para que aparte de mostrarme el nombre me muestra la ip, serial, cuenta, dinero, etc. Link to comment
Jmaniacs Posted January 12, 2016 Share Posted January 12, 2016 Derberia ser algo como Player = "showAccount" (? nose hace mcuho no scripteo Link to comment
Tomas Posted January 12, 2016 Share Posted January 12, 2016 Gracias me funciono pero como podria hacer para que aparte de mostrarme el nombre me muestra la ip, serial, cuenta, dinero, etc. Para eso debes hacer un trigger al servidor y luego desde ahí al cliente para editar los valores. Link to comment
leonmrtin123 Posted January 13, 2016 Author Share Posted January 13, 2016 Gracias me funciono pero como podria hacer para que aparte de mostrarme el nombre me muestra la ip, serial, cuenta, dinero, etc. Para eso debes hacer un trigger al servidor y luego desde ahí al cliente para editar los valores. Me podrias dar un ejemplo de como se hace eso porfavor?. Link to comment
Tomas Posted January 13, 2016 Share Posted January 13, 2016 -- client addEvent("ipcallback", true) function getPlayerIPByName(name) local name = name or "" if ( not getPlayerFromName(name) ) then return false end triggerServerEvent("getPlayerIPfn", root, localPlayer, getPlayerFromName(name)) end addEventHandler("ipcallback", root, function (ip) outputChatBox(ip) end ) -- server addEvent("getPlayerIPfn", true) addEventHandler("getPlayerIPfn", root, function (player, whosip) triggerClientEvent(player, "ipcallback", player, getPlayerIP(whosip)) end ) Link to comment
leonmrtin123 Posted January 16, 2016 Author Share Posted January 16, 2016 -- client addEvent("ipcallback", true) function getPlayerIPByName(name) local name = name or "" if ( not getPlayerFromName(name) ) then return false end triggerServerEvent("getPlayerIPfn", root, localPlayer, getPlayerFromName(name)) end addEventHandler("ipcallback", root, function (ip) outputChatBox(ip) end ) -- server addEvent("getPlayerIPfn", true) addEventHandler("getPlayerIPfn", root, function (player, whosip) triggerClientEvent(player, "ipcallback", player, getPlayerIP(whosip)) end ) Hola perdon por la demora y por molestar tanto, pero como podria hacer para que muestre eso en el label probe modificando unas cosas pero no funciono. Link to comment
Tomas Posted January 17, 2016 Share Posted January 17, 2016 -- client addEvent("ipcallback", true) function getPlayerIPByName(name) local name = name or "" if ( not getPlayerFromName(name) ) then return false end triggerServerEvent("getPlayerIPfn", root, localPlayer, getPlayerFromName(name)) end addEventHandler("ipcallback", root, function (ip) outputChatBox(ip) end ) -- server addEvent("getPlayerIPfn", true) addEventHandler("getPlayerIPfn", root, function (player, whosip) triggerClientEvent(player, "ipcallback", player, getPlayerIP(whosip)) end ) Hola perdon por la demora y por molestar tanto, pero como podria hacer para que muestre eso en el label probe modificando unas cosas pero no funciono. Postea tu intento Link to comment
leonmrtin123 Posted January 19, 2016 Author Share Posted January 19, 2016 -- client addEvent("ipcallback", true) function getPlayerIPByName(name) local name = name or "" if ( not getPlayerFromName(name) ) then return false end triggerServerEvent("getPlayerIPfn", root, localPlayer, getPlayerFromName(name)) end addEventHandler("ipcallback", root, function (ip) outputChatBox(ip) end ) -- server addEvent("getPlayerIPfn", true) addEventHandler("getPlayerIPfn", root, function (player, whosip) triggerClientEvent(player, "ipcallback", player, getPlayerIP(whosip)) end ) Hola perdon por la demora y por molestar tanto, pero como podria hacer para que muestre eso en el label probe modificando unas cosas pero no funciono. Postea tu intento Client addEvent("ipcallback", true) function getPlayerIPByName(name) local name = name or "" if ( not getPlayerFromName(name) ) then return false end triggerServerEvent("getPlayerIPfn", root, localPlayer, getPlayerFromName(name)) local playerNamee = guiGridListGetItemText ( gridlistt, guiGridListGetSelectedItem ( gridlistt ), 1 ) end addEventHandler("ipcallback", root, function (ip) guiSetText(labelip, "IP:"..ip) end ) server addEvent("getPlayerIPfn", true) addEventHandler("getPlayerIPfn", root, function (player, whosip) triggerClientEvent(player, "ipcallback", player, getPlayerIP(whosip)) end ) Link to comment
Enargy, Posted January 20, 2016 Share Posted January 20, 2016 Ya lo tienes mostrado en el label al usar guiSetText. Link to comment
leonmrtin123 Posted January 20, 2016 Author Share Posted January 20, 2016 Ya lo tienes mostrado en el label al usar guiSetText. Pero en el label no lo veo. Link to comment
Recommended Posts