Jump to content

Mark0

Members
  • Posts

    89
  • Joined

  • Last visited

Posts posted by Mark0

  1. blipbtn = guiCreateButton(22, 422, 110, 30, "setBlip", false, window) 
      
    addEventHandler("onClientGUIClick", root, 
    function () 
            if (source == blip) then 
        local player = guiGridListGetItemText (playersgrid, guiGridListGetSelectedItem (playersgrid), 1) 
        local Blip = createBlipAttachedTo ( player,56 ) 
            end 
    end 
    ) 
      
    

    Bad argument@'createBlipAttachedTo '

  2.   
      
    function ( ) 
    if source == Button then 
      
    showdx = dxDrawText("test", 421, 30, 911, 68, tocolor(255, 255, 255, 255), 1, "default", "left", "top", false, false, true, false, false) 
      
    end 
     ) 
    addEventHandler("onClientRender", g_localPlayer, showdx ) 
    setTimer ( showdx, 100, 0 ) 
      
      
    

  3. What's Wrong ??

    function createCustomBlips() 
        blip = exports.customblips:createCustomBlip(x, y, 20, 20, "icon.png" ) 
        exports.customblips:setCustomBlipStreamRadius(blip, 120) 
    end 
    addEventHandler("onClientResourceStart", root, createCustomBlips) 
    

  4. local marker = createMarker(1183.9000244141, -1331, 12.5, 'cylinder', 1.5, 255, 255, 255, 155)

    local vehicles = {"BMX", "Bike", "Mountain Bike", "Faggio"}

    function createVehGui ()

    wnd = guiCreateWindow(0.39,0.1633,0.21,0.55,"Free Vehicles",true)

    guiSetAlpha(CIGwnd,1)

    guiWindowSetSizable(CIGwnd,false)

    VehGrid = guiCreateGridList(0.0536,0.1394,0.8869,0.6273,true,wnd)

    guiGridListSetSelectionMode(VehGrid,2)

    _bikes = guiGridListAddColumn(VehGrid,"Vehicles name:",0.8)

    Spownbtn = guiCreateButton(0.1667,0.7939,0.6905,0.0727,"Spown",true,wnd)

    guiSetFont(Spownbtn,"clear-normal")

    closebtn = guiCreateButton(0.1667,0.9,0.6905,0.0727,"Close",true,wnd)

    guiSetFont(closebtn,"clear-normal")

    for index, vehicle in ipairs(vehicles) do

    local row = guiGridListAddRow (VehGrid)

    guiGridListSetItemText ( VehGrid, row, _bikes, tostring(vehicle), false, false )

    end

    end

    function markerspown( hitElement )

    if ( hitElement == localPlayer ) then

    createVehGui ( hitElement )

    if ( wnd ~= nil ) then

    guiSetVisible ( wnd, true )

    showCursor ( true )

    guiSetInputEnabled ( true )

    setElementFrozen ( hitElement, true )

    end

    end

    end

    addEventHandler ( "onClientMarkerHit", marker, markerspown)

    addEventHandler("onClientGUIClick", root,

    function ()

    if (source == Spownbtn) then

    local row,col = guiGridListGetSelectedItem(VehGrid)

    if (row and col and row ~= -1 and col ~= -1) then

    local vehicleName = guiGridListGetItemText(VehGrid, row, 1)

    if vehicleName == "BMX" then

    triggerServerEvent("spawnvehicle",localPlayer,481)

    elseif vehicleName == "Bike" then

    triggerServerEvent("spawnvehicle",localPlayer,509)

    elseif vehicleName == "Mountain Bike" then

    triggerServerEvent("spawnvehicle",localPlayer,510)

    elseif vehicleName == "Faggio" then

    triggerServerEvent("spawnvehicle",localPlayer,462)

    end

    else

    outputChatBox("Please,select a vehicle of the list.",255,0,0)

    end

    elseif (source == closebtn) then

    triggerEvent("closeWindow", root )

    end

    end

    )

    addEventHandler("onClientGUIDoubleClick", root,

    function ()

    if ( source == VehGrid ) then

    local row,col = guiGridListGetSelectedItem(VehGrid)

    if (row and col and row ~= -1 and col ~= -1) then

    local vehicleName = guiGridListGetItemText(VehGrid, row, 1)

    if vehicleName == "BMX" then

    triggerServerEvent("spawnvehicle",localPlayer,509)

    elseif vehicleName == "Bike" then

    triggerServerEvent("spawnvehicle",localPlayer,481)

    end

    end

    end

    end

    )

    addEventHandler("onClientMarkerLeave", marker,

    function ()

    triggerEvent("closeWindow", root )

    end

    )

    addEvent("closeWindow", true)

    addEventHandler("closeWindow", root,

    function ()

    guiSetVisible(wnd, false)

    showCursor(false)

    guiSetInputEnabled(false)

    setElementFrozen(localPlayer, false)

    end

    )

  5. what's Wrong :

    1-evry one can take vehicles but i make it only for Medic

    2-when i take a vehicle i spown out of the vehicle

    local vehicles = { } 
      
    addEvent ( "spawnvehicle", true ) 
    addEventHandler ( "spawnvehicle", root, 
        function ( vehID ) 
        local team = getPlayerTeam(source) 
        if (isElement(vehicles[source])) then destroyElement(vehicles[source]) end 
         vehicles [ source ] = createVehicle ( vehID, getElementPosition ( source ) ) 
            if ( vehicles [ source ] ) then 
                setVehicleColor ( vehicles [ source ], 255, 255, 255 ) 
            end 
            if(isPedInVehicle(source)) then return end 
         if (team and getTeamName(team) == "Medic") then 
          setTimer ( warpPedIntoVehicle, 200, 1, source, vehicles [ source ] ) 
            triggerClientEvent ( source, "closeWindow", root ) 
    end 
    end 
    ) 
    

×
×
  • Create New...