Jump to content

Porque La GUI no aparece ?


iFoReX

Recommended Posts

La GUI No Me Aparece ://

client :

GUIEditor = { 
    gridlist = {}, 
    button = {}, 
    label = {}, 
    window = {}, 
} 
GUIEditor.window[1] = guiCreateWindow(209, 156, 453, 239, "Panel Autos Privados", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FBFF") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 25, 197, 205, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Tus Autos", 0.9) 
GUIEditor.button[1] = guiCreateButton(211, 97, 232, 48, "spawn", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[1], "default-bold-small") 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FBFF") 
GUIEditor.button[2] = guiCreateButton(210, 152, 233, 49, "respawn", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[2], "default-bold-small") 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF00FBFF") 
GUIEditor.label[1] = guiCreateLabel(211, 24, 227, 58, "GUI Creada Por ElMota", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.label[1], "default-bold-small") 
guiLabelSetColor(GUIEditor.label[1], 253, 1, 1) 
guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) 
guiLabelSetVerticalAlign(GUIEditor.label[1], "center") 
  
guiSetVisible(GUIEditor.window[1],false) 
  
addEvent("aparecer",true) 
addEventHandler("aparecer",root,function() 
guiSetVisible(GUIEditor.window[1],guiGetVisible(GUIEditor.window[1])) 
showCursor(guiGetVisible(GUIEditor.window[1])) 
end 
) 
  

server :

addCommandHandler("autos",function(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent("aparecer",thePlayer) 
end 
end 
) 
  

Link to comment

Ahora Me Da Error En GetAccount y GetAccountName ( la verdad nose como ocupar estas 2 funciones :/ )

addCommandHandler("autos",function(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent ( thePlayer, "aparecer", thePlayer ) 
end 
end 
) 
  
addEventHandler("onResourceStart",resourceRoot,function() 
for v,i in ipairs(getElementsByType"player") do 
local account = getAccount(i) 
local cuenta = getAccountName(i) 
if cuenta == "ElMota" then 
triggerClientEvent(thePlayer,"elmotacars",thePlayer) 
end 
end 
end 
) 
  

Link to comment

ahora me dice ke el evento "elmota" no esta añadido al clientside :/

addCommandHandler("autos",function(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent ( thePlayer, "aparecer", thePlayer ) 
end 
end 
) 
  
addEventHandler("onResourceStart",resourceRoot,function() 
for v,i in ipairs(getElementsByType"player") do 
local account = getPlayerAccount(i) 
local cuenta = getAccountName(account) 
if cuenta == "ElMota" then 
triggerClientEvent("elmota",cuenta) 
end 
end 
end 
) 
  

GUIEditor = { 
    gridlist = {}, 
    button = {}, 
    label = {}, 
    window = {}, 
} 
GUIEditor.window[1] = guiCreateWindow(209, 156, 453, 239, "Panel Autos Privados", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FBFF") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 25, 197, 205, false, GUIEditor.window[1]) 
col = guiGridListAddColumn(GUIEditor.gridlist[1], "Tus Autos", 0.9) 
GUIEditor.button[1] = guiCreateButton(211, 97, 232, 48, "spawn", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[1], "default-bold-small") 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FBFF") 
GUIEditor.button[2] = guiCreateButton(210, 152, 233, 49, "respawn", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[2], "default-bold-small") 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF00FBFF") 
GUIEditor.label[1] = guiCreateLabel(211, 24, 227, 58, "GUI Creada Por ElMota Para PGS Server", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.label[1], "default-bold-small") 
guiLabelSetColor(GUIEditor.label[1], 253, 1, 1) 
guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) 
guiLabelSetVerticalAlign(GUIEditor.label[1], "center") 
  
guiSetVisible(GUIEditor.window[1],false) 
  
-----autos-MOTA---- 
mota = createVehicle(411,-685.12195, 955.14368, 12.13281) 
addVehicleUpgrade ( mota, 1010 ) 
setVehicleDamageProof ( mota, true ) 
setVehicleColor ( mota, 0, 0, 0, 255, 0, 102 ) 
setElementData(mota, "owner", "ElMota") 
setElementData(mota, "model", "Carrito") 
------------------- 
  
function onLockedVehicleEnter ( player, seat, jacked ) 
    if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then 
        outputChatBox ("*** [sERVER] Carro Propiedad De "..tostring(getElementData(source, "owner"  )), player, 255, 255, 0) 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter ) 
  
  
addEvent("aparecer",true) 
addEventHandler("aparecer",root,function() 
guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
showCursor(guiGetVisible(GUIEditor.window[1])) 
end 
) 
  
addEvent("elmota",true) 
addEventHandler("elmota",root,function() 
row1 = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],row1,col,getElementData(mota,"model"),false,false) 
end 
) 
  

Link to comment
addCommandHandler("autos",function(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent ( thePlayer, "aparecer", thePlayer ) 
end 
end 
) 
  
addEvent("iniciar",true) 
addEventHandler("iniciar",root,function(thePlayer) 
for v,i in ipairs(getElementsByType"player") do 
local account = getPlayerAccount(i) 
local cuenta = getAccountName(account) 
if cuenta == "ElMota" then 
triggerClientEvent("elmota",cuenta) 
end 
end 
end 
) 
  

Link to comment
addEvent ( "iniciar", true ) 
addEventHandler ( "iniciar", root, 
    function ( ) 
        local account = getPlayerAccount ( source ) 
        local cuenta = getAccountName ( account ) 
        if ( cuenta == "ElMota" ) then 
            triggerClientEvent ( source, "elmota", source, cuenta ) 
        end 
    end 
) 

Link to comment
GUIEditor = { 
    gridlist = {}, 
    button = {}, 
    label = {}, 
    window = {}, 
} 
GUIEditor.window[1] = guiCreateWindow(209, 156, 453, 239, "Panel Autos Privados", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF00FBFF") 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 25, 197, 205, false, GUIEditor.window[1]) 
col = guiGridListAddColumn(GUIEditor.gridlist[1], "Tus Autos", 0.9) 
GUIEditor.button[1] = guiCreateButton(211, 97, 232, 48, "spawn", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[1], "default-bold-small") 
guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FBFF") 
GUIEditor.button[2] = guiCreateButton(210, 152, 233, 49, "respawn", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.button[2], "default-bold-small") 
guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF00FBFF") 
GUIEditor.label[1] = guiCreateLabel(211, 24, 227, 58, "GUI Creada Por ElMota Para PGS Server", false, GUIEditor.window[1]) 
guiSetFont(GUIEditor.label[1], "default-bold-small") 
guiLabelSetColor(GUIEditor.label[1], 253, 1, 1) 
guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) 
guiLabelSetVerticalAlign(GUIEditor.label[1], "center") 
  
guiSetVisible(GUIEditor.window[1],false) 
  
-----autos-MOTA---- 
mota = createVehicle(411,-685.12195, 955.14368, 12.13281) 
addVehicleUpgrade ( mota, 1010 ) 
setVehicleDamageProof ( mota, true ) 
setVehicleColor ( mota, 0, 0, 0, 255, 0, 102 ) 
setElementData(mota, "owner", "ElMota") 
setElementData(mota, "model", "Carrito") 
------------------- 
  
function onLockedVehicleEnter ( player, seat, jacked ) 
    if getElementData(source, "owner") and getElementData(source, "owner" ) ~= getAccountName(getPlayerAccount(player)) and ( seat == 0 ) then 
        outputChatBox ("*** [sERVER] Carro Propiedad De "..tostring(getElementData(source, "owner"  )), player, 255, 255, 0) 
        cancelEvent() 
    end 
end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), onLockedVehicleEnter ) 
  
  
addEvent("aparecer",true) 
addEventHandler("aparecer",root,function() 
guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) 
showCursor(guiGetVisible(GUIEditor.window[1])) 
end 
) 
  
addEventHandler("onClientResourceStart",resourceRoot,function() 
triggerServerEvent("iniciar",getLocalPlayer()) 
end 
) 
  
addEvent("elmota",true) 
addEventHandler("elmota",root,function() 
row1 = guiGridListAddRow(GUIEditor.gridlist[1]) 
guiGridListSetItemText(GUIEditor.gridlist[1],row1,col,getElementData(mota,"model"),false,false) 
end 
) 
  
addEventHandler("onClientGUIClick",root,function() 
local theItem = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) ) 
if theItem == "Carrito" and source == GUIEditor.button[1] then 
x,y,z = getElementPosition(getLocalPlayer()) 
setElementPosition(mota,x+1,y,z+1) 
end 
end 
) 
  

addCommandHandler("autos",function(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent ( thePlayer, "aparecer", thePlayer ) 
end 
end 
) 
  
addEvent ( "iniciar", true ) 
addEventHandler ( "iniciar", root, 
    function ( ) 
        local account = getPlayerAccount ( source ) 
        local cuenta = getAccountName ( account ) 
        if ( cuenta == "ElMota" ) then 
            triggerClientEvent ( source, "elmota", source, cuenta ) 
        end 
    end 
) 

Ahora no me aparece nada en el girdlist :/

Link to comment
  • Recently Browsing   0 members

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