Jump to content

Ayuda con el siguiente script


leonmrtin123

Recommended Posts

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
  
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
  
-- 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
  
-- 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
  
-- 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
  
-- 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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...