Jump to content

que anda mal ?


iFoReX

Recommended Posts

Posted

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 
) 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

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

rsilex.png.0e6ad382b3fdc3cbe6390e3e847572c9.png
Posted

El problema es que la funcion giveWeapon es server-side, y tu script client-side.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 
) 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 ?

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted
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 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

Aca funciona perfectamente, cuando voy al marker #3 me aparece el texto, al salir se va.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ese no es el marker #3, el que yo digo esta debajo de la estacion de policia en Los Santos.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Si, ese, ami me muestra el texto al entrar.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

Pues eso es porque el script es client-side, no server side.

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted
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 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 ?

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted
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 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Usa guiSetVisible para ocultarla al crearse, es algo muy facil, podes hacerlo solo.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted
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 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...