Jump to content

que anda mal ?


iFoReX

Recommended Posts

  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Syntax

bool triggerServerEvent ( string event, element theElement, [arguments...] )

Required Arguments

event: The name of the event to trigger server-side. You should register this event with addEvent and add at least one event handler using addEventHandler.

theElement: The element that is the source of the event. This could be another player, or if this isn't relevant, use the root element.

Optional Arguments

arguments...: A list of arguments to trigger with the event. You can pass any lua data type (except functions). You can also pass

Link to comment

Cree un Nuevo GUI y cambie casi toda la estructura pero se me olvido que isiste para que aparecieran los items a mi no me aparecen ._. dime que :D porfa

local x = 1540.95654 
local y = -1687.67078 
local z = 5.89063 
local market = createMarker ( 685.62610, -2692.39307, 7.5,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local market2 = createMarker ( 294.38306 + 2, -167.90103, 1.57813 - 1,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local market3 = createMarker ( 1526.51270, -1677.93237, 5,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) 
setElementFrozen(ped, true) 
  
GUIEditor_Grid = {} 
  
GUIEditor_Grid[1] = guiCreateGridList(225,165,297,382,false) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
guiSetVisible(GUIEditor_Grid[1], false) 
  
guiGridListAddColumn(GUIEditor_Grid[1],"Jobs",0.2) 
  
for i = 1, 3 do 
    guiGridListAddRow(GUIEditor_Grid[1]) 
end 
  
guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Job de $10000") 
  
guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Job de $20000") 
  
guiGridListSetItemText(GUIEditor_Grid[1],2,1,"Job de $30000") 
  
addEventHandler("onClientGUIDoubleClick", root, 
    function ( ) 
        if ( source == GUIEditor_Grid[1] ) then 
            local row, col = guiGridListGetSelectedItem ( source ) 
            if ( row and col and row ~= -1 and col ~= -1 ) then 
                if ( row == 0 ) then 
  
          markerjob = createMarker ( 246.54626, 1435.73621, 23.37029, "cylinder", 1.5, 255, 200, 0, 180 ) 
  
                elseif ( row == 1 ) then 
                    arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) 
                    attachElements ( arrowMarker, v2, 0, 0, 2 ) 
                end 
                guiSetVisible( GUIEditor_Grid[1], false ) 
            end 
        end 
    end 
) -- Te falto el parentesis. 
  
addEventHandler ( "onClientVehicleEnter", root, 
    function ( ) 
        local markerjob = createMarker ( 246.55173, 1434.92371, 23.37029,  "cylinder", 1.5, 0, 255, 255, 170 ) 
        blip = createBlipAttachedTo ( markerjob, 51, 1 ) 
    end 
) 
  
  
bindKey ( "enter", "down", 
    function ( ) 
        if ( isElementWithinMarker ( localPlayer, market3 ) ) then 
            guiSetVisible ( GUIEditor_Grid[1], true ) 
        end 
    end 
) 
  
addEventHandler ( 'onClientMarkerHit', root, 
    function ( player ) 
        if ( player == localPlayer and source == market ) then 
            setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); 
        elseif ( player == localPlayer and source == market2 ) then 
            setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); 
        elseif ( player == localPlayer and source == market3 ) then 
            addEventHandler ( "onClientRender", root, drawText ) 
        end 
    end 
) 
  
addEventHandler ( 'onClientMarkerLeave', root, 
    function ( player ) 
        if ( player == localPlayer and source == market3 ) then 
            removeEventHandler ( "onClientRender", root, drawText ) 
        end 
    end 
) 
  
function drawText ( ) 
    dxDrawText("Press Enter for do the job",458.0,295.0,631.0,317.0,tocolor(255,0,0,170),1.2,"default","left","top",false,false,false) 
end 

Link to comment

Che sin ofender, pero lo que te dice castillo es que leas un poco lo que estas scripteando.

Por ejemplo, si queres sabes programacion es fundamental que entiendas lo que son los argumentos ya que es clave para leer en la wiki.

Castillo te puso los argumentos del triggerServerEvent que son los que aparecen en la misma wiki.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...