Jump to content

KaMeR

Members
  • Posts

    25
  • Joined

  • Last visited

Posts posted by KaMeR

  1. here is part of my code the problem is only i see the text but i want it visible to selected player from gridlist..

    addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), 
            function ( ) 
                if (source == GUIEditor_Button[1]) then 
                        local playerName = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) 
                        guiSetText ( GUIEditor_Label[2], playerName ) 
      
                        local text = guiGetText ( GUIEditor_Edit[1] )--get the text from the edit box 
                        outputChatBox(playerName .. "-> " ..tostring(text), playerName, 255,255,0, true) 
      
                end 
            end 
    ) 
    

  2. my english is really bad so..

    i say simply i want send private message via gui textbox but i have no idea how to send it to chat "/msg.."

  3. how can i use chat via script send messages? these "outputConsole" , "outputChatBox" only appear text on chat.. not send message or im in wrong?

  4. why it doesnt work? size doesnt change

            WindowForm = guiCreateWindow ( 0.15, 0.2, 0.60, 0.50, "GUI", true ) 
            editX = guiCreateEdit( 0.1, 0.5, 0.10, 0.06, "0.1", true, WindowForm ) 
        editY = guiCreateEdit( 0.1, 0.6, 0.10, 0.06, "0.2", true, WindowForm ) 
        button = guiCreateButton( 0.1, 0.2, 0.15, 0.06, "B TEST", true, WindowForm )     
      
    addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), 
            function () 
                if (source == button) then 
                    local textX = guiSetText ( editX ) 
            local textY = guiSetText ( editY ) 
                guiSetSize ( WindowForm,  textX, textY, true ) 
               end 
          end 
    ) 
    

    btw is any gui editor?

  5. anyone know how use "triggerServerEvent" in it?

    addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), 
            function ( ) 
                if (source == button) then 
                    outputChatBox ( "Button Pressed" ) 
            end 
             end 
    ) 
    

  6. But how can you make like more buttons in 1 .lua file because like:

      
    button = guiCreateButton( 0.1, 0.2, 0.10, 0.03, "Admin!", true, WindowForm )     
      
    addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), 
            function ( ) 
                if (source == button) then 
                    outputChatBox ( "Admin! I Need You!, Help Me!!" ) 
            end 
             end 
    ) 
      
    button = guiCreateButton( 0.1, 0.2, 0.10, 0.03, "Admin!", true, WindowForm )     
      
    addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), 
            function ( ) 
                if (source == button) then 
                    outputChatBox ( "Admin! I Need You!, Help Me!!" ) 
            end 
             end 
    ) 
      
    etc... 
      
    

    That doesnt work at mine then it only displays 1 button.

    Can someone tell me this?

      
    button = guiCreateButton( 0.1, 0.2, 0.10, 0.03, "Admin!", true, WindowForm ) 
    button1 = guiCreateButton( 0.1, 0.3, 0.10, 0.03, "Admin!", true, WindowForm )         
      
    addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), 
            function ( ) 
                if (source == button) then 
                    outputChatBox ( "Admin! I Need You!, Help Me!!" ) 
                end 
             end 
    ) 
      
    addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), 
            function ( ) 
                if (source == button1) then 
                    outputChatBox ( "Admin! I Need You!, Help Me!!" ) 
                end 
             end 
    ) 
      
    etc... 
      
    

    ...

  7. button = guiCreateButton( 0.1, 0.2, 0.15, 0.06, "B TEST", true, WindowForm )     
      
    addEventHandler ( "onClientGUIClick", getResourceRootElement(getThisResource()), 
            function ( ) 
                if (source == button) then 
                    outputChatBox ( "Button Pressed" ) 
            end 
             end 
    ) 
    

    i tryed too>

    button = guiCreateButton( 0.1, 0.2, 0.15, 0.06, "B TEST", true, WindowForm )     
      
    function test () 
            outputChatBox ( "Button Pressed" ) 
    end 
    addEventHandler ( "onClientGUIClick", button, test ) 
    ) 
    

    and wont work what is the problem?? (this and this doesnt work)

  8. function Jump ( key, keyState ) 
            local vehicle = getPlayerOccupiedVehicle(getLocalPlayer())   
            if ( keyState == "down" ) and ( isVehicleOnGround( vehicle )  == true ) then 
      end 
        if ( isVehicleOnGround( vehicle ) ) then 
            local x, y, z = getElementVelocity(vehicle) 
            setElementVelocity(vehicle, x, y, z + 0.4) 
        end 
    end 
      bindKey ( "z", "down", Jump )   -- bind the player's z down key 
    

    try this one works for me

  9. why when vehicle is created cant destroy him and is locked??? :?

    function scriptCreateVoo ( commandName ) 
      
          local localPlayer = getLocalPlayer ( ) 
          local x, y, z = getElementPosition ( localPlayer ) 
          createVehicle ( 412, x + 5, y, z + 1 ) 
    end 
    addCommandHandler ( "voo", scriptCreateVoo ) 
    

  10. why the two buttons have same effect when clicking whats wrong?

        closeButton = guiCreateButton( 0.1, 0.9, 0.8, 0.1, "click here to close", true, windowForm) 
        button = guiCreateButton( 0.7, 0.4, 0.2, 0.1, "test", true, windowForm  ) 
    function bClose ( closeButton ) 
                    guiSetVisible ( windowForm, false ) 
                    showCursor ( false ) 
    end 
      
    function test( button ) 
            outputChatBox ( "test" ) 
    end 
      
    addEventHandler ( "onClientGUIClick", getRootElement(), bClose ) 
    addEventHandler ( "onClientGUIClick", getRootElement(), test ) 
    

×
×
  • Create New...