Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-12-23, 21:15


Marcinos651







Wiek: 28
Na forum: 4621 dni
Posty: 18
Nick w MP: Marcin651



Respekt: 50

Witam. Potrzebuj? ?eby po przyj?ciu zlecenia dawalo blipa id 41 bo nie da sie dojechac bo nie ma lokalizacji a nikt w slepo jezdzic nie bedzie.
Nie mog? za nic tego ogarn??

Dam piwko ka?demu kto mi pomo?e ;)



Client-


createBlip( -1853.0203857422, 115.5154876709, 14.1171875, 52) -- miejsce pracy dorywczej "kopalnia"

local marker_zacznijprace = createMarker ( -1853.0203857422, 115.5154876709, 14.1171875, "cylinder", 3, 255, 0, 0, 85 ) -- marker w kt?rym zaczyna si? prace

local cele = -- cele kopalnii
{
    { -1805.08,999.21,23.89 };
    { -2016.65,970.11,44.56 };
    { -1955.51,1188.48,44.45 };
    { -1617.51,1074.92,6.19 };
    { -1581.15,865.56,6.60 };
}


addEventHandler("onResourceStart",marker_zacznijprace,
function(panel) 
    if panel == gracz and not isPedInVehicle(gracz) then 
        guiSetVisible(marker_zacznijprace,true) 
        showCursor(true) 
    end 
end)



function marker_cel ()
    return unpack ( cele [ math.random ( #cele ) ] )
end



                                                                           -- [[ Panel Pracy Dorywczej ]] --
                                                                           
----------------------------------------------------------------------------------------------------------------------------------------------------                                                                           
sx,sy = guiGetScreenSize()
gracz = getLocalPlayer()
pieniadze = math.random(1,2)
----------------------------------------------------------------------------------------------------------------------------------------------------
praca_panel = guiCreateWindow(541/1366*sx, 112/768*sy, 363/1366*sx, 416/768*sy,"Praca w Kopalni", false)
guiWindowSetSizable(praca_panel, false)
guiSetAlpha(praca_panel, 0.70)
----------------------------------------------------------------------------------------------------------------------------------------------------
tekst = guiCreateMemo(25/1366*sx, 115/768*sy, 314/1366*sx, 123/768*sy, "     Praca G?rnik\n     Zarobki: 300-500$", false, praca_panel)
----------------------------------------------------------------------------------------------------------------------------------------------------

label = guiCreateLabel(15/1366*sx, 19/768*sy, 334/1366*sx, 46/768*sy, "       Praca Dorywcza by Milo. Zakaz Usuwania Autora!", false, praca_panel)
guiSetFont(label, "default-bold-small")
----------------------------------------------------------------------------------------------------------------------------------------------------
zaczyna_prace = guiCreateButton(52/1366*sx, 264/768*sy, 260/1366*sx, 57/768*sy, "Zacznij Prac?", false, praca_panel)
guiSetProperty(zaczyna_prace, "NormalTextColour", "FFAAAAAA")
----------------------------------------------------------------------------------------------------------------------------------------------------
skoncz_prace = guiCreateButton(52/1366*sx, 337/768*sy, 260/1366*sx, 57/768*sy, "Wy??cz Panel", false, praca_panel)
guiSetProperty(skoncz_prace, "NormalTextColour", "FFAAAAAA")  
guiSetVisible (praca_panel,false)
guiMemoSetReadOnly(tekst,true)
guiWindowSetMovable (praca_panel,true )
guiWindowSetSizable (praca_panel,false )

----------------------------------------------------------------------------------------------------------------------------------------------------

dalsza_praca = guiCreateWindow(522, 232, 353, 138, "", false)

----------------------------------------------------------------------------------------------------------------------------------------------------
tekstt = guiCreateLabel(118/1366*sx, 24/768*sy, 246/1366*sx, 30/768*sy, "Chcesz dalej pracowa??", false, dalsza_praca)

----------------------------------------------------------------------------------------------------------------------------------------------------
dalej = guiCreateButton(20, 67, 144, 44, "TAK", false, dalsza_praca)

----------------------------------------------------------------------------------------------------------------------------------------------------
koniec = guiCreateButton(185, 67, 144, 44, "NIE", false, dalsza_praca)

----------------------------------------------------------------------------------------------------------------------------------------------------
guiWindowSetSizable(dalsza_praca, false)
guiWindowSetMovable(dalsza_praca, true)
guiSetVisible (dalsza_praca, false)






addEventHandler("onClientGUIClick",praca_panel,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == zaczyna_prace then
            outputChatBox ("((Teraz wejdz ponownie w marker aby wzi??? pojazd!))",225,225,225, true)
            guiSetVisible(praca_panel,false)
            guiSetVisible(zaczyna_prace,false)
            showCursor(false)
            --
            wez_pojazd = guiCreateButton(52/1366*sx, 264/768*sy, 260/1366*sx, 57/768*sy, "We? Pojazd", false, praca_panel)
            koncz = guiCreateButton(52/1366*sx, 337/768*sy, 260/1366*sx, 57/768*sy, "Wy??cz Panel", false, praca_panel)
            guiSetAlpha(koncz, 0.0)
            --
            end
        end
    end
)

addEventHandler("onClientGUIClick",praca_panel,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == skoncz_prace then
        guiSetVisible(praca_panel,false)
        showCursor(false)
    end
  end
end)

addEventHandler("onClientGUIClick",praca_panel,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == koncz then
        guiSetVisible(praca_panel,false)
        guiSetVisible(koncz,false)
        guiSetVisible(wez_pojazd,false)
        guiSetVisible(offduty,false)
        guiSetVisible(skoncz_prace,true)
        guiSetVisible(zaczyna_prace,true)
        showCursor(false)
        destroyElement ( pojazdmarker )
        destroyElement ( blipcelu )
    end
  end
end)
    
addEventHandler("onClientGUIClick",praca_panel,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == wez_pojazd then
        outputChatBox ("((Jeste? ju? w poje?dzie jed? do wyznaczonego celu))",thePlayer,225,225,225, true)
        triggerServerEvent ( "praca_dorywcza", gracz)
        triggerServerEvent ( "dajepojazd", gracz)
        guiSetVisible(praca_panel,false)
        guiSetVisible(koncz,true)
        guiSetVisible(zaczyna_prace,false)
        guiSetVisible(wez_pojazd,false)
        guiSetVisible(skoncz_prace,true)
        showCursor(false)
        end
    end
end)


        
addEventHandler("onClientMarkerHit",marker_zacznijprace,
    function(panel)
        if panel == gracz and not isPedInVehicle(gracz) then
            guiSetVisible(praca_panel,true)
            showCursor(true)
        end
    end
)


addEventHandler ( "onClientMarkerHit", root,
    function ( hitElement )
        if source == pojazdmarker and localPlayer == hitElement  then
        local pojazd = getPedOccupiedVehicle ( localPlayer )
        if pojazd and getElementModel(pojazd) == 524 then -- pojazd 
            triggerServerEvent ( "dostaje_pieniadze", localPlayer )
            destroyElement ( pojazdmarker )
 
            if isElement(blipcelu) then 
            destroyElement ( blipcelu ) -- usuwa blip celu 
end
 
            guiSetVisible(dalsza_praca,true)
            showCursor(true)
        end
    end
end)




addEventHandler("onClientGUIClick",dalsza_praca,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == dalej then
            x, y, z = marker_cel ()
            pojazdmarker = createMarker ( x, y, z, "checkpoint", 5, 255, 51, 102, 85, localPlayer )
            blipcelu = createBlipAttachedTo ( pojazdmarker, 41, localPlayer )
            guiSetVisible(dalsza_praca,false)
            showCursor(false)
            elseif source == koniec then
            guiSetVisible(dalsza_praca,false)
            showCursor(false)
        end
    end
end)


addEvent("praca_dorywcza", true)
function createDestinations ()
    x, y, z = marker_cel ()
    pojazdmarker = createMarker ( x, y, z, "checkpoint", 5, 255, 51, 102, 85, localPlayer )
    blipcelu = createBlipAttachedTo ( pojazdmarker, 41, localPlayer )
end
addEventHandler ( "praca_dorywcza", root, createDestinations )



Ostatnio zmieniony przez Marcinos651 2015-12-23, 23:09, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-23, 21:26


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4475 dni
Posty: 217
Nick w MP: Serek.

Piwa: 375

Respekt: 70


createBlip( -1853.0203857422, 115.5154876709, 14.1171875, 52) -- miejsce pracy dorywczej "kopalnia"

local marker_zacznijprace = createMarker ( -1853.0203857422, 115.5154876709, 14.1171875, "cylinder", 3, 255, 0, 0, 85 ) -- marker w kt?rym zaczyna si? prace

local cele = -- cele kopalnii
{
    { -1805.08,999.21,23.89 };
    { -2016.65,970.11,44.56 };
    { -1955.51,1188.48,44.45 };
    { -1617.51,1074.92,6.19 };
    { -1581.15,865.56,6.60 };
}


addEventHandler("onResourceStart",marker_zacznijprace,
function(panel) 
    if panel == gracz and not isPedInVehicle(gracz) then 
        guiSetVisible(marker_zacznijprace,true) 
        showCursor(true) 
    end 
end)



function marker_cel ()
    return unpack ( cele [ math.random ( #cele ) ] )
end



                                                                           -- [[ Panel Pracy Dorywczej ]] --
                                                                           
----------------------------------------------------------------------------------------------------------------------------------------------------                                                                           
sx,sy = guiGetScreenSize()
gracz = getLocalPlayer()
pieniadze = math.random(1,2)
----------------------------------------------------------------------------------------------------------------------------------------------------
praca_panel = guiCreateWindow(541/1366*sx, 112/768*sy, 363/1366*sx, 416/768*sy,"Praca w Kopalni", false)
guiWindowSetSizable(praca_panel, false)
guiSetAlpha(praca_panel, 0.70)
----------------------------------------------------------------------------------------------------------------------------------------------------
tekst = guiCreateMemo(25/1366*sx, 115/768*sy, 314/1366*sx, 123/768*sy, "     Praca G?rnik\n     Zarobki: 300-500$", false, praca_panel)
----------------------------------------------------------------------------------------------------------------------------------------------------

label = guiCreateLabel(15/1366*sx, 19/768*sy, 334/1366*sx, 46/768*sy, "       Praca Dorywcza by Milo. Zakaz Usuwania Autora!", false, praca_panel)
guiSetFont(label, "default-bold-small")
----------------------------------------------------------------------------------------------------------------------------------------------------
zaczyna_prace = guiCreateButton(52/1366*sx, 264/768*sy, 260/1366*sx, 57/768*sy, "Zacznij Prac?", false, praca_panel)
guiSetProperty(zaczyna_prace, "NormalTextColour", "FFAAAAAA")
----------------------------------------------------------------------------------------------------------------------------------------------------
skoncz_prace = guiCreateButton(52/1366*sx, 337/768*sy, 260/1366*sx, 57/768*sy, "Wy??cz Panel", false, praca_panel)
guiSetProperty(skoncz_prace, "NormalTextColour", "FFAAAAAA")  
guiSetVisible (praca_panel,false)
guiMemoSetReadOnly(tekst,true)
guiWindowSetMovable (praca_panel,true )
guiWindowSetSizable (praca_panel,false )

----------------------------------------------------------------------------------------------------------------------------------------------------

dalsza_praca = guiCreateWindow(522, 232, 353, 138, "", false)

----------------------------------------------------------------------------------------------------------------------------------------------------
tekstt = guiCreateLabel(118/1366*sx, 24/768*sy, 246/1366*sx, 30/768*sy, "Chcesz dalej pracowa??", false, dalsza_praca)

----------------------------------------------------------------------------------------------------------------------------------------------------
dalej = guiCreateButton(20, 67, 144, 44, "TAK", false, dalsza_praca)

----------------------------------------------------------------------------------------------------------------------------------------------------
koniec = guiCreateButton(185, 67, 144, 44, "NIE", false, dalsza_praca)

----------------------------------------------------------------------------------------------------------------------------------------------------
guiWindowSetSizable(dalsza_praca, false)
guiWindowSetMovable(dalsza_praca, true)
guiSetVisible (dalsza_praca, false)






addEventHandler("onClientGUIClick",praca_panel,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == zaczyna_prace then
            outputChatBox ("((Teraz wejdz ponownie w marker aby wzi??? pojazd!))",225,225,225, true)
            guiSetVisible(praca_panel,false)
            guiSetVisible(zaczyna_prace,false)
            showCursor(false)
            --
            wez_pojazd = guiCreateButton(52/1366*sx, 264/768*sy, 260/1366*sx, 57/768*sy, "We? Pojazd", false, praca_panel)
            koncz = guiCreateButton(52/1366*sx, 337/768*sy, 260/1366*sx, 57/768*sy, "Wy??cz Panel", false, praca_panel)
            guiSetAlpha(koncz, 0.0)
            --
            end
        end
    end
)

addEventHandler("onClientGUIClick",praca_panel,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == skoncz_prace then
        guiSetVisible(praca_panel,false)
        showCursor(false)
    end
  end
end)

addEventHandler("onClientGUIClick",praca_panel,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == koncz then
        guiSetVisible(praca_panel,false)
        guiSetVisible(koncz,false)
        guiSetVisible(wez_pojazd,false)
        guiSetVisible(offduty,false)
        guiSetVisible(skoncz_prace,true)
        guiSetVisible(zaczyna_prace,true)
        showCursor(false)
        destroyElement ( pojazdmarker )
        destroyElement ( blipcelu )
    end
  end
end)
    
addEventHandler("onClientGUIClick",praca_panel,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == wez_pojazd then
        outputChatBox ("((Jeste? ju? w poje?dzie jed? do wyznaczonego celu))",thePlayer,225,225,225, true)
        triggerServerEvent ( "praca_dorywcza", gracz)
        triggerServerEvent ( "dajepojazd", gracz)
        guiSetVisible(praca_panel,false)
        guiSetVisible(koncz,true)
        guiSetVisible(zaczyna_prace,false)
        guiSetVisible(wez_pojazd,false)
        guiSetVisible(skoncz_prace,true)
        showCursor(false)
        end
    end
end)


        
addEventHandler("onClientMarkerHit",marker_zacznijprace,
    function(panel)
        if panel == gracz and not isPedInVehicle(gracz) then
            guiSetVisible(praca_panel,true)
            showCursor(true)
        end
    end
)


addEventHandler ( "onClientMarkerHit", root,
    function ( hitElement )
        if source == pojazdmarker and localPlayer == hitElement  then
        local pojazd = getPedOccupiedVehicle ( localPlayer )
        if pojazd and getElementModel(pojazd) == 524 then -- pojazd 
            triggerServerEvent ( "dostaje_pieniadze", localPlayer )
            destroyElement ( pojazdmarker )
 
            if isElement(blipcelu) then 
            destroyElement ( blipcelu ) -- usuwa blip celu 
end
 
            guiSetVisible(dalsza_praca,true)
            showCursor(true)
        end
    end
end)




addEventHandler("onClientGUIClick",dalsza_praca,
function(liczba,thePlayer)
    if liczba == "left" then
        if source == dalej then
            x, y, z = marker_cel ()
            pojazdmarker = createMarker ( x, y, z, "checkpoint", 5, 255, 51, 102, 85, localPlayer )
            blipcelu = createBlipAttachedTo ( pojazdmarker, 41 )
            guiSetVisible(dalsza_praca,false)
            showCursor(false)
            elseif source == koniec then
            guiSetVisible(dalsza_praca,false)
            showCursor(false)
        end
    end
end)


addEvent("praca_dorywcza", true)
function createDestinations ()
    x, y, z = marker_cel ()
    pojazdmarker = createMarker ( x, y, z, "checkpoint", 5, 255, 51, 102, 85, localPlayer )
    blipcelu = createBlipAttachedTo ( pojazdmarker, 41 )
end
addEventHandler ( "praca_dorywcza", root, createDestinations )

Zobacz tak

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-12-23, 23:08


Marcinos651







Wiek: 28
Na forum: 4621 dni
Posty: 18
Nick w MP: Marcin651



Respekt: 50

Dziala piwko polecialo ;)

Postaw piwo autorowi tego posta
 

 
Tagi: piwko!.blip :: przyjeciu :: zlecenia.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Piwko!.Blip po przyjeciu zlecenia. Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku