Jump to content

que anda mal ?


iFoReX

Recommended Posts

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 ) 

Link to comment
  • Replies 58
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 ) 

Link to comment

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 ) 

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

Link to comment

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

Link to comment

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 

Link to comment
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 
) 

Link to comment

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

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...