Jump to content

onClientMarkerHit y Gridlist AYUDA!!


Kilfwan

Recommended Posts

Posted

Hola a todos tengo un problema, es que hice algunos scripts y todos a lo bien pero los he echo para que cuando se entre al marker se abra el gui y se abre y todo, pero en vez de que solo a mi se me haga visible la gui, a todos los jugadores les aparece la gui y no se como solucionar.

aqui el codigo:

  
function panelSicario() 
    guiSicario = guiCreateWindow(524, 219, 227, 332, "Sicariato Job", false) 
    guiWindowSetSizable(guiSicario, false) 
    guiSetAlpha(guiSicario, 0.45) 
  
  
    -- Botones 
    entrar = guiCreateButton(75, 278, 65, 39, "Entrar", false, guiSicario) 
    cierra = guiCreateButton(150, 278, 65, 39, "X", false, guiSicario) 
  
  
    -- Labels  
    GUIEditor.label[1] = guiCreateLabel(17, 25, 198, 15, "Este es un Trabajo De sicario tienes", false, guiSicario) 
    GUIEditor.label[2] = guiCreateLabel(17, 55, 198, 15, "que matar para Ganar Dinero.", false, guiSicario) 
    GUIEditor.label[3] = guiCreateLabel(17, 40, 198, 15, "que Buscar a la Persona que Tienes ", false, guiSicario) 
    GUIEditor.label[4] = guiCreateLabel(18, 108, 197, 17, "Se te dara un auto y se te indicara", false, guiSicario) 
    GUIEditor.label[5] = guiCreateLabel(18, 130, 197, 17, "a donde tendras que ir.", false, guiSicario) 
  
  
    guiSetVisible( guiSicario, false) 
    showCursor(false) 
    addEventHandler("onClientGUIClick", entrar, darTeam, false) 
    addEventHandler("onClientGUIClick", cierra, close, false) 
end 
addEventHandler("onClientResourceStart", resourceRoot, panelSicario) 
  
local entro = createMarker (864.61279 + 2,-28.02875 + 2, 62.1, "cylinder", 1.5, 255, 0, 0, 170 ) 
  
local carro = createMarker (861.57001 +2, -13.5 +2, 62.1, "cylinder", 1.5, 255, 0, 0, 170 ) 
  
function harkerHit ( hitPlayer ) 
    guiSetVisible (guiSicario, true) 
    showCursor(true) 
end 
addEventHandler ( "onClientMarkerHit", entro, harkerHit ) 

No creo que sea nesecario publicar todo el codigo y resumi la parte q esta mal.

Y tambien queria saber como Hago para que cuando de click dos veces en un row de una gridlist se de este Objeto Osea desde una tabla y esa parte no entiendo sobre seleccionarlos dos veces.

Podrian explicarme?

NaciónZ

Developing server to the 65 %

Posted

Prueba con estó:

guiSicario = guiCreateWindow(524, 219, 227, 332, "Sicariato Job", false) 
guiWindowSetSizable(guiSicario, false) 
guiSetAlpha(guiSicario, 0.45) 
  
  
-- Botones 
entrar = guiCreateButton(75, 278, 65, 39, "Entrar", false, guiSicario) 
cierra = guiCreateButton(150, 278, 65, 39, "X", false, guiSicario) 
  
  
    -- Labels 
label = guiCreateLabel(17, 25, 198, 15, "Este es un Trabajo De sicario tienes", false, guiSicario) 
label2 = guiCreateLabel(17, 55, 198, 15, "que matar para Ganar Dinero.", false, guiSicario) 
label3 = guiCreateLabel(17, 40, 198, 15, "que Buscar a la Persona que Tienes ", false, guiSicario) 
label4 = guiCreateLabel(18, 108, 197, 17, "Se te dara un auto y se te indicara", false, guiSicario) 
GUIEditor.label[5] = guiCreateLabel(18, 130, 197, 17, "a donde tendras que ir.", false, guiSicario) 
  
  
guiSetVisible( guiSicario, false) 
  
local entro = createMarker (864.61279 + 2,-28.02875 + 2, 62.1, "cylinder", 1.5, 255, 0, 0, 170 ) 
  
local carro = createMarker (861.57001 +2, -13.5 +2, 62.1, "cylinder", 1.5, 255, 0, 0, 170 ) 
  
function harkerHit ( hitPlayer ) 
    guiSetVisible (guiSicario, true) 
    showCursor(true) 
end 
addEventHandler ( "onClientMarkerHit", entro, harkerHit ) 
  
function click () 
    if source == cierra then 
        guiSetVisible(guiSicario, false) 
        showCursor(false) 
-- elseif source == entrar then 
    end 
end 
addEventHandler("onClientGUIClick", resourceRoot, click) 

My name in the game is: Sticmy

My discord: Sticmy#3817

My discord community: https://discord.gg/366Y9bB

Posted

Pero si es lo mismo solo me acomodastes las funciones y ademas quitastes el

function () 

Que en lua no puedes iniciar algo un poco mas avanzado , sin hacer una funcion ._. , tu aun no tienes muchos conocimientos deja que me ayuden enargy o tomas o cualquier otro tu todavia no tienes muchos conocimientos.

NaciónZ

Developing server to the 65 %

Posted

No quites nunca el function nombre()

a un gui por que te va a dar error , y no es nesecario que uses el if variable then

ya que esa mas se usa para esto mira:

  
function clearChat( thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("      ....            ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("INFO : [Admin] Ha Limpiado el Chat", getRootElement(), 255, 255, 0, true) 
    else 
        outputChatBox(" No eres administrador", thePlayer, 255, 255, 0, true) --- osea para que uses else para que cuando el jugador no es nada en dicho grupo se le diga que no es nada o ocurrio un error. 
    end 

NaciónZ

Developing server to the 65 %

Posted

Server:

local entro = createMarker ( 864.61279 + 2,-28.02875 + 2, 62.1, "cylinder", 1.5, 255, 0, 0, 170) 
  
function entro_al_marcador ( player ) 
   triggerClientEvent(player, "AbrirWindows", player) 
end 
addEventHandler ( "onMarkerHit", entro, entro_al_marcador ) 
  

Client:

function abrir ( ) 
    guiSetVisible (guiSicario, true) 
    showCursor(true) 
end 
addEvent( "AbrirWindows", true ) 
addEventHandler( "AbrirWindows", localPlayer, abrir ) 

My name in the game is: Sticmy

My discord: Sticmy#3817

My discord community: https://discord.gg/366Y9bB

Posted

Con razon que usaba thePlayer en triggerclient y no funcionaba LOL ! :v

luego lo pruebo con un amigo a ver si funciona.

y sabes hacer lo de el gridlist?

NaciónZ

Developing server to the 65 %

Posted

mm seh te dejo una función xD

function testeando () 
    if ( source == boton ) then -- variable del boton 
        local row = guiGridListGetSelectedItem( variabledelgui ) -- Pon el nombre de la variable del gridlist 
        local name = guiGridListGetItemText( variabledelgui, row, testa) -- testa = guiGridListAddColumn(variabledelgui, "Listas.", 0.9) así como esta 
        if name == "Skin 2" then -- Nombre del por ejemplo este guiGridListSetItemText(variabledelgui, 0, 1, "Skin 2", false, false) 
            outputChatBox("test") 
-- elseif name="  Skin 2" then 
        end 
    end 
end 
addEventHandler("onClientGUIClick", root, testeando) 

ahí ve añadiendo elseif.

My name in the game is: Sticmy

My discord: Sticmy#3817

My discord community: https://discord.gg/366Y9bB

Posted
No quites nunca el function nombre()

a un gui por que te va a dar error , y no es nesecario que uses el if variable then

ya que esa mas se usa para esto mira:

  
function clearChat( thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("      ....            ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("INFO : [Admin] Ha Limpiado el Chat", getRootElement(), 255, 255, 0, true) 
    else 
        outputChatBox(" No eres administrador", thePlayer, 255, 255, 0, true) --- osea para que uses else para que cuando el jugador no es nada en dicho grupo se le diga que no es nada o ocurrio un error. 
    end 

Amigo, si no tienes conocimiento no digas cosas sin sentido ya que los nuevos que lo lean lo creerán..

Currently developing for International Gaming Community - Join us!

Posted
No quites nunca el function nombre()

a un gui por que te va a dar error , y no es nesecario que uses el if variable then

ya que esa mas se usa para esto mira:

  
function clearChat( thePlayer) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("      ....            ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("                  ", getRootElement(), 0, 0, 0, true) 
        outputChatBox("INFO : [Admin] Ha Limpiado el Chat", getRootElement(), 255, 255, 0, true) 
    else 
        outputChatBox(" No eres administrador", thePlayer, 255, 255, 0, true) --- osea para que uses else para que cuando el jugador no es nada en dicho grupo se le diga que no es nada o ocurrio un error. 
    end 

Amigo, si no tienes conocimiento no digas cosas sin sentido ya que los nuevos que lo lean lo creerán..

+1

33lypu1.png

Posted

Si tengo algunos conocimientos y enseño lo que yo se, pedi que me enseñen lo de el gridlist y puse mi ejemplo para q el no ponga ese if de por gusto.

Si yo posteo Algo tomas o alguin mas que lo vea corrijanme y no traten de de hacer quedarme mal si no que ayuden o si van a hacer eso mejor callense y borren mi post.

Por sierto

Hace unos días llorabas porque pensaste que te habían estafado y ahora te pones a vender 'hosts', facepalm.

No te interesa si me hubieran estafado no es tu problema ni tu dinero, Solo queria pagar a medias con alguien y ya, A si que te vas largo al carajo.

NaciónZ

Developing server to the 65 %

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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