Jump to content

que anda mal ?


iFoReX

Recommended Posts

buee estoy asiendo mi primer job :D recien asiendo la base, pero el ped no me aparece ni el marker de prueba tampoco ;:c porfas ayudenme :D

local x = 685.62610 
local y = -2692.39307 
local z = 7.5 
local x2 = 294.38306 
local y2 = -167.90103 
local z2 = 1.57813  
  
local market = createMarker ( x, y, z,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local market2 = createMarker ( x2 + 2, y2, z2 - 1,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local market3 = creteMarker ( 1526.51270, -1677.93237, 5.89063,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) 
setElementFrozen(ped, true) 
setTimer(giveWeapon,1000,1,ped,31,9999,true) 
  
  
addEventHandler ( 'onClientMarkerHit', root, 
    function ( player ) 
        if ( player == localPlayer and source == market ) then 
        setTimer(setElementPosition, 2000, 1, player, x2, y2, z2 ); 
        elseif ( player == localPlayer and source == market2 ) then 
        setTimer(setElementPosition, 2000, 1, player, x + 2, y + 2, z + 2 ); 
        end 
    end 
) 

Link to comment
  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

no seria mejor acerlo asi

  
  
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 = creteMarker ( 1526.51270, -1677.93237, 5.89063,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) 
setElementFrozen(ped, true) 
setTimer(giveWeapon,1000,1,ped,31,9999,true) 
  
  
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 ); 
        end 
    end 
) 

Prueba asi creo que funcionara asi

Link to comment

Sigue sin funcionar man :c

  
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 = creteMarker ( 1526.51270, -1677.93237, 5.89063,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) 
setElementFrozen(ped, true)  
  
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 ); 
        end 
    end 
) 

Link to comment

Pusiste creteMarker, no createMarker.

Porque no haces el script server-side? asi podrias darles armas.

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.89063,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) 
setElementFrozen ( ped, true ) 
setTimer ( giveWeapon, 1000, 1, ped, 31, 9999, true ) 
  
addEventHandler ( 'onMarkerHit', root, 
    function ( player ) 
        if ( source == market ) then 
            setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); 
        elseif ( source == market2 ) then 
            setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); 
        end 
    end 
) 

Link to comment

y como puedo aserle con esto ? es que quiero que al entrar al marker osea que sera invisibisible se aga visible este texto ?

  
  
-- Direct X Drawing 
addEventHandler("onClientRender",root, 
    function() 
        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 
) 
  
  

Se que eso es Client como lo ago para unirlo al server-side ?

Link to comment
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.89063,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) 
setElementFrozen(ped, true) 
  
addEventHandler ( 'onClientMarkerHit', root, 
    function ( player ) 
        if ( player == localPlayer and source == market ) then 
            addEventHandler ( "onClientRender", root, drawText ) 
            setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); 
        elseif ( player == localPlayer and source == market2 ) then 
            addEventHandler ( "onClientRender", root, drawText ) 
            setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); 
        end 
    end 
) 
  
addEventHandler ( 'onClientMarkerLeave', root, 
    function ( player ) 
        if ( player == localPlayer and source == market ) then 
            removeEventHandler ( "onClientRender", root, drawText ) 
        elseif ( player == localPlayer and source == market2 ) 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

no me aparece man :

  
... 
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

a mi no :c como vez no me aparece nada :c

aqui te dejo el meta por si algo esta mal

    "ElMota" version="1.0.0" type="script" name="Skins" description="" showInResourceBrowser="true" /> 
    

y el script :

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) 
  
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.89063,  "cylinder", 1.5, 0, 0, 255, 170 ) 
local ped = createPed ( 286, 1525.26294, -1677.85596, 5.89063, 270 ) 
setElementFrozen(ped, true) 
  
addEventHandler ( 'onClientMarkerHit', root, 
    function ( player ) 
        if ( player == localPlayer and source == market ) then 
            addEventHandler ( "onClientRender", root, drawText ) 
            setTimer ( setElementPosition, 2000, 1, player, 294.38306, -167.90103, 1.57813 ); 
        elseif ( player == localPlayer and source == market2 ) then 
            addEventHandler ( "onClientRender", root, drawText ) 
            setTimer ( setElementPosition, 2000, 1, player, 685.62610 + 2, -2692.39307 + 2, 7.5 + 2 ); 
        end 
    end 
) 
  
addEventHandler ( 'onClientMarkerLeave', root, 
    function ( player ) 
        if ( player == localPlayer and source == market ) then 
            removeEventHandler ( "onClientRender", root, drawText ) 
        elseif ( player == localPlayer and source == market2 ) 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

Como le ago para que el grid aparesca apretando enter pero solo si esta en el marker osea si no esta en el marker y aprieta enter no aparece el gridlist

:D

GUIEditor_Grid = {} 
  
GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) 
  
for i = 1, 2 do 
    guiGridListAddRow(GUIEditor_Grid[1]) 
end 
  
guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis") 
  
guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis") 
  
  
  
  
  
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) 
  
  
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
GUIEditor_Grid = {} 
  
GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) 
  
for i = 1, 2 do 
    guiGridListAddRow(GUIEditor_Grid[1]) 
end 
guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis")  
guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis") 
  
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) 
  
  
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 
) 
  
bindKey ( "enter", "down", 
    function ( ) 
        if ( isElementWithinMarker ( localPlayer, market3 ) ) then 
            guiSetVisible ( GUIEditor_Grid[1], true ) 
        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

solid ise esto :

GUIEditor_Grid = {} 
  
GUIEditor_Grid[1] = guiCreateGridList(258,160,294,357,false) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
  
guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) 
  
for i = 1, 2 do 
    guiGridListAddRow(GUIEditor_Grid[1]) 
end 
  
local grid1 = guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis") 
  
local grid2 = guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis") 
  
    addEventHandler("onClientDoubleClick", root, 
        function () 
            if ( source == grid1 ) then 
           createVehicle ( 427, x, y, z ) 
guiSetVisible( GUIEditor_Grid[1], false ) 
            elseif ( source == grid2 ) then 
           createVehicle ( 596, x, y, z ) 
guiSetVisible( GUIEditor_Grid[1], false ) 
    end 
end 
  
bindKey ( "enter", "down", 
    function ( ) 
        if ( isElementWithinMarker ( localPlayer, market3 ) ) then 
            guiSetVisible ( GUIEditor_Grid[1], true ) 
        end 
    end 
) 
  
  
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) 
  
  
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 

Pero ahora no me aparece el marker ni nada del script que anda mal ?

Link to comment
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(258,160,294,357,false) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)  
guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) 
  
for i = 1, 2 do 
    guiGridListAddRow(GUIEditor_Grid[1]) 
end 
  
local grid1 = guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis") 
local grid2 = guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis") 
  
addEventHandler("onClientDoubleClick", root, 
    function ( ) 
        if ( source == grid1 ) then 
           createVehicle ( 427, x, y, z ) 
            guiSetVisible( GUIEditor_Grid[1], false ) 
        elseif ( source == grid2 ) then 
            createVehicle ( 596, x, y, z ) 
            guiSetVisible( GUIEditor_Grid[1], false ) 
        end 
    end 
) -- Te falto el parentesis. 
  
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

Listo man ya lo ise :D pero 1 problem cuando presiono enter en el marker no aparecen los items

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(258,160,294,357,false) 
guiSetVisible( GUIEditor_Grid[1], false ) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.2) 
  
for i = 1, 2 do 
    guiGridListAddRow(GUIEditor_Grid[1]) 
end 
  
local grid1 = guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis") 
local grid2 = guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis") 
  
addEventHandler("onClientDoubleClick", root, 
    function ( ) 
        if ( source == grid1 ) then 
           createVehicle ( 427, x, y, z ) 
            guiSetVisible( GUIEditor_Grid[1], false ) 
        elseif ( source == grid2 ) then 
            createVehicle ( 596, x, y, z ) 
            guiSetVisible( GUIEditor_Grid[1], false ) 
        end 
    end 
) -- Te falto el parentesis. 
  
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
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(258,160,294,357,false) 
guiSetVisible( GUIEditor_Grid[1], false ) 
guiGridListSetSelectionMode(GUIEditor_Grid[1],2) 
guiGridListAddColumn(GUIEditor_Grid[1],"Autos",0.50) 
  
for i = 1, 2 do 
    guiGridListAddRow(GUIEditor_Grid[1]) 
end 
  
guiGridListSetItemText(GUIEditor_Grid[1],0,1,"Camion Polis",false,false) 
guiGridListSetItemText(GUIEditor_Grid[1],1,1,"Auto Polis",false,false) 
  
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 
                    createVehicle ( 427, x, y, z ) 
                elseif ( row == 1 ) then 
                    createVehicle ( 596, x, y, z ) 
                end 
                guiSetVisible( GUIEditor_Grid[1], false ) 
            end 
        end 
    end 
) -- Te falto el parentesis. 
  
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
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...