Jump to content

que anda mal ?


iFoReX

Recommended Posts

Posted

que esta mal ?

No aparece el marker

  
... 
function onMrWhoopeeEnter ( thePlayer, seat, jackedPlayer ) 
    local arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) 
    attachElements ( arrowMarker, thePlayer, 0, 0, 2 ) 
end 
  
addEventHandler ( "onVehicleEnter", v1, onMrWhoopeeEnter ) 
addEventHandler ( "onVehicleEnter", v2, onMrWhoopeeEnter ) 

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
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 
                    v1 = createVehicle ( 427, x, y, z ) 
                elseif ( row == 1 ) then 
                    v2 = 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 
  
function onMrWhoopeeEnter ( thePlayer ) 
    if ( source == v1 or source == v2 ) then 
        arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) 
        attachElements ( arrowMarker, source, 0, 0, 2 ) 
    end 
end  
addEventHandler ( "onClientVehicleEnter", root, onMrWhoopeeEnter ) 

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

Lo estas usando con los vehiculos que creas con el script, verdad?

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

sip man :

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 
                    v1 = createVehicle ( 427, x, y, z ) 
                elseif ( row == 1 ) then 
                    v2 = createVehicle ( 596, x, y, z ) 
                end 
                guiSetVisible( GUIEditor_Grid[1], false ) 
            end 
        end 
    end 
) 
... 
function onMrWhoopeeEnter ( thePlayer ) 
    if ( source == v1 or source == v2 ) then -------aqui estan el v1 y el v2 osea los autos que se crean al aprietar double click 
        arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) 
        attachElements ( arrowMarker, source, 0, 0, 2 ) 
    end 
end 
addEventHandler ( "onClientVehicleEnter", root, onMrWhoopeeEnter ) 

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 
                    v1 = createVehicle ( 427, x, y, z ) 
                    arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) 
                    attachElements ( arrowMarker, v1, 0, 0, 2 ) 
                elseif ( row == 1 ) then 
                    v2 = createVehicle ( 596, x, y, z ) 
                    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. 
  
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 

Cambie como funciona, ahora pone la flecha arriva del vehiculo cuando lo spawneas.

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

que esta mal ? xD es que no entiendo muy bien :roll:

  
... 
addEventHandler ( "onVehicleEnter", root, 
function crearjob() 
local markerjob = createMarker ( 246.55173, 1434.92371, 23.37029,  "cylinder", 1.5, 0, 255, 255, 170 ) 
blip = createBlipAttachedTo ( markerjob, 51, 1 ) 
   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

Me parece que tenes que empezar a usar anteojos:

onClientVehicleEnter no: onVehicleEnter.

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

en que parte pongo los autos ?

addEventHandler ( "onClientVehicleEnter", root, 
function crearjob() 
local markerjob = createMarker ( 246.55173, 1434.92371, 23.37029,  "cylinder", 1.5, 0, 255, 255, 170 ) 
blip = createBlipAttachedTo ( markerjob, 51, 1 ) 
   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

Que autos? no te entiendo.

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

Sabes detectar errores en tus scripts? si no es asi, entonces pone: /debugscript 3 en el chat del juego y postea los errores que aparecen.

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

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

Sep, ami me paso lo mismo, podrias intentar crear los coches server side.

Usa triggerServerEvent.

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

Podrias al menos intentar hacerlo? ya me estoy aburriendo de hacerte todo porque vos no lo intentas.

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
Podrias al menos intentar hacerlo? ya me estuy aburriendo de hacerte todo porque vos no lo intentas.

Lo intente toda la noche ayer asta las 3 a.m ._. y no pude

Me podrias decir aunque sea como unirlos que funciones uno y eso ?

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

Postea lo que intentaste.

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

xD ok pero si no tiene sentido es porq no entendia mucho

Client-Side

  
... 
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 
 triggerServerEvent ( "crearVehiculo1") 
                    arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) 
                    attachElements ( arrowMarker, v1, 0, 0, 2 ) 
outputChatBox ( "Porfavor #00FF00Sube al Camion", getRootElement(), 255, 0, 0, true ) 
                elseif ( row == 1 ) then 
triggerServerEvent ( "crearVehiculo2") 
                    arrowMarker = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 170 ) 
                    attachElements ( arrowMarker, v2, 0, 0, 2 ) 
                end 
                guiSetVisible( GUIEditor_Grid[1], false ) 
outputChatBox ( "Porfavor #00FF00Sube al auto", getRootElement(), 255, 0, 0, true ) 
            end 
        end 
    end 
) 
... 

Server-Side

function crearAuto2() 
  
v2 = createVehicle ( 596, x, y, z ) 
  
    end 
end 
  
addEvent("crearVehiculo2", true) 
addEventHandler("crearVehiculo2, crearAuto2) 
  
function crearAuto1() 
  
v1 = createVehicle ( 427, x, y, z ) 
  
    end 
end 
  
addEvent("crearVehiculo1", true) 
addEventHandler("crearVehiculo1, crearAuto1) 

xD

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

No leiste todos los argumentos de la funcion. Tambien te faltan comillas, variables.

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