Jump to content

Ayuda Con Mi Panel


#Raiden

Recommended Posts

Posted

Me das mucha pena, tienes 16 años y andas haciendo, con perdón, el imbécil por foros, te afecta lo que te dicen y luego te sales con que llevas 5 años y te importa una "verga" MTA. Deja de hacer el ridículo, por favor.

PD: Volviendo al tema, usa /debugscript 3 dentro del juego y pon el panel, si te sale algun error, postealo aquí.

Posted

No me sale ningun error, solo que el auto no spawnea pero no se si lo estaba haciendo bien por que no entendi muy bien lo que dijeron :S, también que la ventana de los autos aparece al iniciar el script

Posted

client:

 vehiculos = { 
                   --Precio 
    {"402"},  
      
    }   
Horns = guiCreateGridList(10, (260 - 191) / 2, 104, 191, false) 
usar = guiCreateButton(267 - 100 - 10, (260 - 70) / 2, 100, 70, "Usar", false) 
cerrar = guiCreateButton(128, 157, 85, 34, "Cerrar", false) 
guiSetFont(usar, "sa-header")   
  
guiGridListAddColumn(Horns, "Autos Vip", 0.9) 
  
for i,v in ipairs (vehiculos) do 
local row = guiGridListAddRow (Horns) 
guiGridListSetItemText (Horns, row, 1, Autos, false, true)         
end 
  
  
local player = getLocalPlayer() 
        
addEventHandler("onClientGUIClick", root, 
function() 
    if source == usar then 
        local skinRow, column = guiGridListGetItemText (Horns, guiGridListGetSelectedItem (Horns), 2) 
        if ( skinRow ~= 0 and column ~= 0 ) then 
            triggerServerEvent("skin1", player, skinRow) 
            --outputChatBox( row ) 
        end 
    end 
end 
) 

server

addEvent("skin1", true) 
addEventHandler("skin1", root, 
function( skin ) 
    if ( skin ) then 
        createVehicle( source, tonumber(skin) ); 
        return true; 
    end 
end) 

asi fue como lo intente pero no sirve...

Posted

Client.

vehiculos = { 
{411}, 
  
--{"nombreDeSkin", ID} 
} 
  
  
Horns = guiCreateGridList(10, (260 - 191) / 2, 104, 191, false) 
usar = guiCreateButton(267 - 100 - 10, (260 - 70) / 2, 100, 70, "Usar", false, window2) 
guiSetFont(usar, "sa-header")   
  
guiGridListAddColumn(Horns, "Autos Vip", 0.9) 
  
for i,v in ipairs (vehiculos) do 
local vehicle = getVehicleNameFromID(v[1]) 
local row = guiGridListAddRow (Horns) 
guiGridListSetItemText (Horns, row, 1, vehicle, false, true)         
end 
  
  
local player = getLocalPlayer() 
        
addEventHandler("onClientGUIClick", root, 
function() 
    if source == usar then 
        local vehRow, column = guiGridListGetItemText (Horns, guiGridListGetSelectedItem (Horns), 2) 
        if ( vehRow ~= 0 and column ~= 0 ) then 
            triggerServerEvent("onPlayerRequestVehicleVIP", player, vehRow) 
            --outputChatBox( row ) 
        end 
    end 
end) 

Server.

addEvent("onPlayerRequestVehicleVIP", true) 
addEventHandler("onPlayerRequestVehicleVIP", root, 
function( vehicle ) 
    if ( vehicle ) then 
        local vehicleID = getVehicleIDFromName(vehicle) 
        local x,y,z = getElementPosition( source ); x = x + 5 
        vipCar = createVehicle( vehicleID, x, y, z );       
        return true; 
    end 
end) 

Posted

rx5h1G1.png Lo que no entiendo es esto al iniciar el script aparece esa ventana pero al darle click al boton ''Autos Vip''' Me sale la gridlist de los skins pero no la de los autos

Dejare los codigos para ver si tengo un error

client

function centerWindow (center_window) 
    local screenW, screenH = guiGetScreenSize()
    local windowW, windowH = guiGetSize(center_window, false)
    local x, y = (screenW - windowW) /2,(screenH - windowH) /2
    guiSetPosition(center_window, x, y, false)
end
 
function centerWindow1 (center_window1)
    local screenW1, screenH1 = guiGetScreenSize()
    local windowW1, windowH1 = guiGetSize(center_window1, false)
    local x1, y1 = (screenW1- windowW1) /2,(screenH1 - windowH1) /6
    guiSetPosition(center_window1, x1, y1, false)
end
 
function centerWindow2 (center_window2)
    local screenW2, screenH2 = guiGetScreenSize()
    local windowW2, windowH2 = guiGetSize(center_window2, false)
    local x2, y2 = (screenW2- windowW2) /2,(screenH2 - windowH2) /2.5
    guiSetPosition(center_window2, x2, y2, false)
end
 
local xp, yp = guiGetScreenSize()
local ypf =  (yp - 157) /2
local mix, miy = 1366, 768
local screenW, screenH = guiGetScreenSize()
 
window = guiCreateWindow(103, 99, 618, 404, "Panel V.I.P", false)
        guiWindowSetSizable(window, false)
        guiSetProperty(window, "CaptionColour", "FF0BFD3E")
        centerWindow(window)
 
        memoVIP = guiCreateMemo(9, 25, 599, 100, "Hola!!, Bienvenido al panel vip, aqui podras hacer varias cosas que un jugador Normal no podria hacer, Habrá teleports para los V.I.P por ahora Solo Esta La Base Vip, Si tienes una sugerencia o vez algun bug sobre el panel No dudes en decirmelo nick: Raiden, Tambien Si quieres otros Teleports Solo Preguntame si lo puedo hacer... Bueno, ya terminando Lo ultimo Es un Panel Warp que se utiliza Poniendo /warp Gracias.!! Nota: Al elegir los botones skins vip e autos vip es mejor darle a cerrar al elegir tu skin o auto ", false, window)
        guiMemoSetReadOnly( memoVIP, true )
        Jugador = guiCreateLabel(19, 145, 61, 19, "Jugador:", false, window)
        JetPack = guiCreateLabel(19, 168, 61, 19, "JetPack:", false, window)
        guiLabelSetColor(JetPack, 8, 108, 245)
        Invisible = guiCreateLabel(19, 192, 49, 14, "Invisible:", false, window)
        guiLabelSetColor(Invisible, 114, 138, 134)
        Velocidadx3 = guiCreateLabel(19, 216, 76, 14, "Velocidad x3:", false, window)
        guiLabelSetColor(Velocidadx3, 247, 227, 4)
        AutoIndestructible = guiCreateLabel(19, 240, 110, 14, "Auto Indestructible:", false, window)
        guiLabelSetColor(AutoIndestructible, 250, 0, 0)
        AutoInvisible = guiCreateLabel(19, 264, 76, 16, "Auto Invisible:", false, window)
        guiLabelSetColor(AutoInvisible, 7, 242, 35)
        ItemsVip = guiCreateLabel(241, 308, 61, 19, "Items Vip", false, window)
        guiSetFont(ItemsVip, "clear-normal")
        SkinsVip = guiCreateButton(27, 337, 72, 24, "Skins Vip", false, window)
        guiSetProperty(SkinsVip, "NormalTextColour", "FF07F223")
        AutosVip = guiCreateButton(109, 337, 72, 24, "Autos Vip", false, window)
        guiSetProperty(AutosVip, "NormalTextColour", "FFF1B705")
        Vida200 = guiCreateButton(27, 370, 72, 24, "Vida", false, window)
        guiSetProperty(Vida200, "NormalTextColour", "FFF80000")
        Chaleco = guiCreateButton(109, 374, 72, 20, "Chaleco", false, window)
        guiSetProperty(Chaleco, "NormalTextColour", "FF03F4CF")
        PackArmas1 = guiCreateButton(191, 337, 82, 24, "Pack Armas 1", false, window)
        guiSetProperty(PackArmas1, "NormalTextColour", "FFE403F2")
        HabilidadDeArmas = guiCreateButton(283, 337, 82, 57, "Todas las Habilidades De Armas", false, window)
        guiSetProperty(HabilidadDeArmas, "NormalTextColour", "FFE36C14")
        Teleports = guiCreateLabel(355, 135, 61, 19, "Teleports", false, window)
        guiSetFont(Teleports, "clear-normal")
        BaseVip = guiCreateButton(350, 164, 66, 24, "Base Vip ", false, window)
        guiSetProperty(BaseVip, "NormalTextColour", "FF07F223")
        MasTeleports = guiCreateButton(432, 164, 141, 24, "Pronto mas teleports ", false, window)
        guiSetProperty(MasTeleports, "NormalTextColour", "FFFFFFFF")
        guiSetVisible(window, false)
       
        CheckJetPack = guiCreateCheckBox(68, 171, 15, 15, "", false, false, window)
        CheckInvisible = guiCreateCheckBox(65, 192, 15, 15, "", true, false, window)
        CheckVelocidadx3 = guiCreateCheckBox(95, 215, 15, 15, "", false, false, window)
        CheckAutoGod = guiCreateCheckBox(129, 240, 15, 15, "", true, false, window)
        CheckAutoInvisible = guiCreateCheckBox(95, 264, 15, 15, "", false, false, window)
        OnJetPack = guiCreateLabel(84, 170, 21, 16, "On", false, window)
        guiLabelSetColor(OnJetPack, 254, 13, 13)
        BarraJetPack = guiCreateLabel(100, 170, 21, 16, "/", false, window)
        OffJetPack = guiCreateLabel(105, 170, 21, 16, "Off", false, window)
        OnInvisible = guiCreateLabel(83, 191, 21, 16, "On", false, window)
        guiLabelSetColor(OnInvisible, 254, 13, 13)
        BarraInvisible = guiCreateLabel(100, 190, 21, 16, "/", false, window)
        OffJetPack = guiCreateLabel(105, 191, 21, 16, "Off", false, window)
        OnVelocidadx3 = guiCreateLabel(114, 214, 21, 16, "On", false, window)
        guiLabelSetColor(OnVelocidadx3, 254, 13, 13)
        BarraVelocidadx3 = guiCreateLabel(133, 214, 21, 16, "/", false, window)
        OffJetPack = guiCreateLabel(139, 214, 21, 16, "Off", false, window)
        OnAutoGod = guiCreateLabel(145, 238, 21, 16, "On", false, window)
        guiLabelSetColor(OnAutoGod, 254, 13, 13)
        BarraAutoGod = guiCreateLabel(166, 238, 21, 16, "/", false, window)
        OffAutoGod = guiCreateLabel(170, 238, 21, 16, "Off", false, window)
        OnAutoInvisible = guiCreateLabel(112, 263, 21, 16, "On", false, window)
        guiLabelSetColor(OnAutoInvisible, 254, 13, 13)
        BarraInvisible = guiCreateLabel(0.21, 0.65, 0.03, 0.04, "/", true, window)
        OffAutoInvisible = guiCreateLabel(135, 263, 21, 16, "Off", false, window)
        PackArmas2 = guiCreateButton(191, 371, 82, 24, "Pack Armas 2", false, window)
        guiSetProperty(PackArmas2, "NormalTextColour", "FFD73030")
       
    vehiculos = {
    {411},
     
    --{"nombreDeSkin", ID}
    }
     
     
    Horns = guiCreateGridList(10, (260 - 191) / 2, 104, 191, false)
    usar = guiCreateButton(267 - 100 - 10, (260 - 70) / 2, 100, 70, "Usar", false, window2)
    cerrar = guiCreateButton(128, 157, 85, 34, "Cerrar", false)
    guiSetFont(usar, "sa-header")  
     
    guiGridListAddColumn(Horns, "Autos Vip", 0.9)
     
    for i,v in ipairs (vehiculos) do
    local vehicle = getVehicleNameFromID(v[1])
    local row = guiGridListAddRow (Horns)
    guiGridListSetItemText (Horns, row, 1, vehicle, false, true)        
    end
     
     
    local player = getLocalPlayer()
           
    addEventHandler("onClientGUIClick", root,
    function()
        if source == usar then
            local vehRow, column = guiGridListGetItemText (Horns, guiGridListGetSelectedItem (Horns), 2)
            if ( vehRow ~= 0 and column ~= 0 ) then
                triggerServerEvent("onPlayerRequestVehicleVIP", player, vehRow)
                --outputChatBox( row )
            end
        end
    end)
 
 
skins = {
{"Skin1", 256},
{"Skin2", 230},
 
--{"nombreDeSkin", ID}
}
 
 
Horns = guiCreateGridList(10, (260 - 191) / 2, 104, 191, false)
usar = guiCreateButton(267 - 100 - 10, (260 - 70) / 2, 100, 70, "Usar", false)
cerrar = guiCreateButton(128, 157, 85, 34, "Cerrar", false)
guiSetFont(usar, "sa-header")  
 
guiGridListAddColumn(Horns, "Skins Vip", 0.9)
guiGridListAddColumn(Horns, "ID", 0.5)
 
for i,v in ipairs (skins) do
local skinIDs, idModel = v[1], v[2]
local row = guiGridListAddRow (Horns)
guiGridListSetItemText (Horns, row, 1, skinIDs, false, true)
guiGridListSetItemText (Horns, row, 2, idModel, false, true)          
end
 
 
local player = getLocalPlayer()
       
addEventHandler("onClientGUIClick", root,
function()
    if source == usar then
        local skinRow, column = guiGridListGetItemText (Horns, guiGridListGetSelectedItem (Horns), 2)
        if ( skinRow ~= 0 and column ~= 0 ) then
            triggerServerEvent("skin1", player, skinRow)
            --outputChatBox( row )
        end
    end
end
)
 
 
 
function quit()
showCursor (true)
guiSetVisible (usar, false)
guiSetVisible(Horns, false)
guiSetVisible(cerrar, false)
end
addEventHandler ("onClientGUIClick", cerrar, quit, false)
 
 
 
       
       
guiSetVisible(Horns, false)
guiSetVisible(usar, false)
guiSetVisible(cerrar, false)
 
 
function clicks()
 if (source == SkinsVip) then
        guiSetVisible(Horns, true)
        guiSetVisible(usar, true)
        guiSetVisible(cerrar, true)
    elseif
        (source == AutosVip) then
        guiSetVisible(Horns, true)
        guiSetVisible(usar, true)
        guiSetVisible(cerrar, true)
    end
     
end
addEventHandler("onClientGUIClick", root, clicks)
---------------------------------------------------
 
 
 
 
 
 
function Habilidades()
showCursor(true)
triggerServerEvent("HabilidadesFuncion", getLocalPlayer() )
end
addEventHandler("onClientGUIClick",HabilidadDeArmas, Habilidades )
 
function Vida1()
showCursor(true)
triggerServerEvent("VidaFuncion", getLocalPlayer() )
end
addEventHandler("onClientGUIClick",Vida200, Vida1, false )
 
 
function Chaleco1 ()
showCursor (true)
triggerServerEvent ( "ChalecoFuncion", getLocalPlayer() )
end
addEventHandler("onClientGUIClick",Chaleco, Chaleco1, false )
 
addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()),
        function ( )
            if (source == BaseVip) then
            local player = getLocalPlayer()
                    setElementPosition (player , 1707.45435, -2398.20752, 13.55469  )
            end
          end
)
 
function isInvisable()
  if getElementAlpha(localPlayer) == 0 then
    guiCheckBoxSetSelected(CheckInvisible)
  else
    guiCheckBoxSetSelected(CheckInvisible, false)
  end
end
addEventHandler("onClientResourceStart", localPlayer, isInvisable)
 
 
function invisable()
  if guiCheckBoxGetSelected(CheckInvisible) == true then
    triggerServerEvent("noalpha", getRootElement(), localPlayer)
  else
    triggerServerEvent("noalpha1", getRootElement(), localPlayer)
  end
Posted

Bueno, ya pude arreglar las gridlist , pero ahora me tira un error al debugscript 3 cuando intento crear el auto:

XwKOmpB.png

[Expexted Number at argument 1, got bolean] Por si no Sale la foto completa e_e.

Posted
  
for i,v in ipairs (vehiculos) do 
    local vehicle = getVehicleNameFromID(v[1]) 
    local row = guiGridListAddRow (Horns) 
    guiGridListSetItemText (Horns, row, 1, vehicle, false, true) 
    guiGridListSetItemData (Horns, row, 1, v[1] ) 
end 
      
    local player = getLocalPlayer() 
            
    addEventHandler("onClientGUIClick", root, 
    function() 
        if source == usar then 
            local vehRow, column = guiGridListGetItemText (Horns, guiGridListGetSelectedItem (Horns), 2) 
            if ( vehRow ~= 0 and column ~= 0 ) then 
                local vehID = guiGridListGetItemText(Horns, vehRow, column) 
                triggerServerEvent("onPlayerRequestVehicleVIP", player, vehID) 
                --outputChatBox( row ) 
            end 
        end 
    end) 
  
  

Posted

Con eso que me pasate Tomas, me Pone otro error en el debugscript, es este

WARNING: PanelVip/Vip_c.lua:128 Bad Argument 'guiGridListGetItemText' [expexted number at argument 3, got nil]

Posted
guiGridListSetItemText (Horns, row, 1, vehicle, false, true) 

Mira si copiaste bien ésto

local vehicle = getVehicleNameFromID(v[1]) 

Mírate también la tabla porque lo que te puso Tomas es que lee el coche mediante su ID, no mediante su nombre, es decir, no uses ésto

{"Infernus"} 

Usa ésto

{250} 

Osea, la ID del vehículo, no su nombre.

Posted

Claro, aqui los dejo

Client

vehiculos = { 
    {411}, 
      
    --{"nombreDeSkin", ID} 
    } 
      
      
    Horns2 = guiCreateGridList(10, (260 - 191) / 2, 104, 191, false) 
    usar2 = guiCreateButton(267 - 100 - 10, (260 - 70) / 2, 100, 70, "Usar", false, window2) 
    cerrar2 = guiCreateButton(128, 157, 85, 34, "Cerrar", false) 
    guiSetFont(usar2, "sa-header")   
      
    guiGridListAddColumn(Horns2, "Autos Vip", 0.9) 
      
    for i,v in ipairs (vehiculos) do 
        local vehicle = getVehicleNameFromID(v[1]) 
    local row = guiGridListAddRow (Horns2) 
    guiGridListSetItemText (Horns2, row, 1, vehicle, false, true) 
    guiGridListSetItemData (Horns2, row, 1, v[1] ) 
end 
      
    local player = getLocalPlayer() 
            
    addEventHandler("onClientGUIClick", root, 
    function() 
        if source == usar2 then 
            local vehRow, column = guiGridListGetItemText (Horns2, guiGridListGetSelectedItem (Horns2), 2) 
            if ( vehRow ~= 0 and column ~= 0 ) then 
                local vehID =     guiGridListSetItemText (Horns2, row, 1, vehicle, false, true) 
                triggerServerEvent("onPlayerRequestVehicleVIP", player, vehID) 
                --outputChatBox( row ) 
            end 
        end 
    end) 

server

addEvent("onPlayerRequestVehicleVIP", true) 
    addEventHandler("onPlayerRequestVehicleVIP", root, 
    function( vehicle ) 
        if ( vehicle ) then 
            local vehicleID = getVehicleIDFromName(vehicle) 
            local x,y,z = getElementPosition( source ); x = x + 5 
            vipCar = createVehicle( vehicleID, x, y, z );      
            return true; 
        end 
    end) 

Posted

Ya funciona.

vehiculos = { 
    {411}, 
      
    --{"nombreDeSkin", ID} 
    } 
      
      
Horns2 = guiCreateGridList(10, (260 - 191) / 2, 104, 191, false) 
usar2 = guiCreateButton(267 - 100 - 10, (260 - 70) / 2, 100, 70, "Usar", false, window2) 
cerrar2 = guiCreateButton(128, 157, 85, 34, "Cerrar", false) 
guiSetFont(usar2, "sa-header")   
      
guiGridListAddColumn(Horns2, "Autos Vip", 0.9) 
      
for i,v in pairs (vehiculos) do 
    local vehicle = getVehicleNameFromID(v[1]) 
    local row = guiGridListAddRow (Horns2) 
    guiGridListSetItemText (Horns2, row, 1, vehicle, false, true) 
end 
      
local player = getLocalPlayer() 
            
addEventHandler("onClientGUIClick", root, 
function() 
    if source == usar2 then 
        local row, column = guiGridListGetSelectedItem(Horns2) 
        if ( row ~= guiGridListGetRowCount ( Horns2 ) and column ~= 0 ) then 
            local vehicleID = guiGridListGetItemText ( Horns2, row, 1 ) 
            triggerServerEvent("onPlayerRequestVehicleVIP", player, vehicleID) 
            --outputChatBox( vehicleID ) 
        end 
    end 
end) 

@Blue Pie, v[1] son los valor que hay dentro de la tabla que se exporta cuando se usa algún looping, i es el indice inicial de los valores. creo que no me explique bien xD.

Posted
Ya funciona.
vehiculos = { 
    {411}, 
      
    --{"nombreDeSkin", ID} 
    } 
      
      
Horns2 = guiCreateGridList(10, (260 - 191) / 2, 104, 191, false) 
usar2 = guiCreateButton(267 - 100 - 10, (260 - 70) / 2, 100, 70, "Usar", false, window2) 
cerrar2 = guiCreateButton(128, 157, 85, 34, "Cerrar", false) 
guiSetFont(usar2, "sa-header")   
      
guiGridListAddColumn(Horns2, "Autos Vip", 0.9) 
      
for i,v in pairs (vehiculos) do 
    local vehicle = getVehicleNameFromID(v[1]) 
    local row = guiGridListAddRow (Horns2) 
    guiGridListSetItemText (Horns2, row, 1, vehicle, false, true) 
end 
      
local player = getLocalPlayer() 
            
addEventHandler("onClientGUIClick", root, 
function() 
    if source == usar2 then 
        local row, column = guiGridListGetSelectedItem(Horns2) 
        if ( row ~= guiGridListGetRowCount ( Horns2 ) and column ~= 0 ) then 
            local vehicleID = guiGridListGetItemText ( Horns2, row, 1 ) 
            triggerServerEvent("onPlayerRequestVehicleVIP", player, vehicleID) 
            --outputChatBox( vehicleID ) 
        end 
    end 
end) 

@Blue Pie, v[1] son los valor que hay dentro de la tabla que se exporta cuando se usa algún looping, i es el indice inicial de los valores. creo que no me explique bien xD.

No me manejo mucho con tablas y pues lo vi y dije, podría ser ésto jaja.

  • Recently Browsing   0 members

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