Client:
PanelObjetosMapa = guiCreateWindow(124, 50, 579, 354, "Panel de objetos de mapeo ~ By: Tomasito", false)
guiSetVisible(PanelObjetosMapa,false)
guiWindowSetSizable(PanelObjetosMapa, false)
Close = guiCreateButton(470, 309, 99, 35, "Cerrar", false, PanelObjetosMapa)
guiSetFont(Close, "sa-header")
guiSetProperty(Close, "NormalTextColour", "C8E70000")
Gate1V = guiCreateButton(10, 50, 70, 27, "Gate1", false, PanelObjetosMapa)
Gate8V = guiCreateButton(10, 271, 70, 27, "Gate7", false, PanelObjetosMapa)
Gate2V = guiCreateButton(10, 98, 70, 27, "Gate2", false, PanelObjetosMapa)
Gate9V = guiCreateButton(10, 317, 70, 27, "Gate8", false, PanelObjetosMapa)
Gate3V = guiCreateButton(10, 141, 70, 27, "Gate4", false, PanelObjetosMapa)
Gate6V = guiCreateButton(10, 225, 70, 27, "Gate6", false, PanelObjetosMapa)
Gate4V = guiCreateButton(10, 184, 70, 27, "Gate5", false, PanelObjetosMapa)
Memo = guiCreateMemo(9, 23, 560, 27, "Al hacer click en cada boton aparecera un objeto diferente. ", false, PanelObjetosMapa)
guiMemoSetReadOnly(Memo, true)
addCommandHandler ( "panel", function ()
if guiGetVisible(PanelObjetosMapa) then
guiSetVisible(PanelObjetosMapa,false)
showCursor (false)
else
showCursor (true)
guiSetVisible(PanelObjetosMapa,true)
end
end )
addEventHandler ("onClientGUIClick",resourceRoot,function ()
if source == Gate1V then
triggerServerEvent ( "onGreeting", localPlayer)
elseif source == Close then
guiSetVisible(PanelObjetosMapa,false)
showCursor (false)
end
end )
Server:
function greetingHandler ()
local x, y, z = getElementPosition ( source )
local theObject = createObject ( 976, x + 0.1, y + 0.1, z, 0, 0, 0)
if theObject then
outputConsole ( "Object created successfully", source )
else
outputConsole ( "Failed to create Object", source )
end
end
addEvent( "onGreeting", true )
addEventHandler( "onGreeting", root, greetingHandler )