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

Wysłany: 2016-11-26, 20:05


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

Witam mam pytanie czy mo?na zrobi? prac? dorywcz? od np x scora. Czyli jak gracz nie ma wystarczaj?cej liczby scora(pkt) wywala mu b??d. Twoje PKT jest za niskie by pracowa? w tej pracy dorywczej

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-26, 20:17


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466


local praca =createMarker(x,y,z)
addEventHandler("onMarketHit",praca,function()
if getElementData(source,"punkty")<50 then
outputChatBox("Masz za malo punktow",source)
return end
end)

Podpinasz to pod swoj? prace // strona s's

Ostatnio zmieniony przez amited 2016-11-26, 20:20, w całości zmieniany 3 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-26, 20:17


Pumelowsky

Amator 3D






Wiek: 23
Na forum: 4182 dni
Posty: 199
Nick w MP: Pumelowsky

Piwa: 1666

Respekt: 200,5
Respekt: 200,5Respekt: 200,5

Tak oczywi?cie
if getElementData(plr"user:score") > 15 then -- tutaj daj swojelementDate i zamie15 na swoje
Kod pracy
else 
outputChatBox("nie masz na tyle sc",plr)
end


Podpis
Kontakt:

- Skype: live:pumapl_2
- GG: 56865468
- Discord: Pumelowsky#1126
- PW forum
[/center]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-26, 20:49


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

zrobi?em co? takiego m1 to jest marker. posiadam 300 scora. i normalnie mog? wej??

    addEventHandler("onMarketHit",m1,function()
        if getElementData(source,"player:reputation")<1000 then
outputChatBox("Masz za malo punktow",source)
return end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-26, 21:07


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

cyc11, Podaj kod swojej pracy ca?ej lub tam gdzie j? zaczynasz

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-26, 21:13


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

SV.lua

local missionText=createElement("text")
setElementData(missionText"name""Praca Dorywcza StreetView")
setElementPosition(missionText, -1922.84,574.36,35.59)
local zone createColCuboid(-1931.93115565.1687034.481256.7419433593756.85339355468754.5156234741211)
createBlip(-1942.57,573.09,35.1746,2,0,0,0,0,0,275)
local m1 createMarker(-1922.84,574.36,33.59"cylinder"2.2969696)
vehs = {}
local code "StreetView"


function removePreviousVehicles(plr)
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
        local sby getElementData(v"zrespilGracz")
        if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
            destroyElement(v)
        end
    end
end

addEventHandler("onMarkerHit"m1, function(elmd)
    if getElementData(el"zrespilGracz"then
        outputChatBox("praca w trakcie poprawek"el)

end
    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    if getElementData(el,"player:job"then return end
    if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
    local x,y,getElementPosition(el)
    local bus createVehicle(400, -1927.28,569.90,35.29)
    setElementData(bus"zrespilGracz"el)
    setElementData(bus"vehicle:fuel"100)
    setElementData(bus"vehicle:mileage"math.random(50000,80000))
    setVehicleHandling(bus,"maxVelocity"60,00)
    setElementData(el,"player:job",code)
    
    warpPedIntoVehicle(elbus)
    removePreviousVehicles(el)
    triggerClientEvent(el"STARTJobBus"resourceRootbus)

    vehs[el] = bus
end)

addEvent("STOPJobBus"true)
addEventHandler("STOPJobBus"resourceRoot, function()
    local pojazd getPedOccupiedVehicle(client)
    if pojazd then
        destroyElement(pojazd)
    end
end)

addEventHandler("onPlayerVehicleExit",resourceRoot,function()
destroyElement(source)
end)

addEvent("destroyVeh"true)
addEventHandler("destroyVeh"getRootElement(),
function()
     if vehs[clientthen
          if isElement(vehs[client]) then destroyElement(vehs[client]) end
     end
end)


addEvent("onPlayerQuit"true)
addEventHandler "onPlayerQuit"getRootElement(), function()
     if vehs[sourcethen
          if isElement(vehs[source]) then destroyElement(vehs[source]) end
    end
end)

addEventHandler("onPlayerCommand"getRootElement(), function(string)
if string == "hwdp" then
cancelEvent()
end
end)

addEvent("givePlayerMoneySTREET",true)
addEventHandler("givePlayerMoney",getRootElement(),function(kwota)
    if not tonumber(kwotathen return end
    givePlayerMoney(sourcekwota)
end)

addEvent("givePlayerMoneySTREET"true)
addEventHandler("givePlayerMoneySTREET"root, function(kwota)
    -- nie zalogowana osoba a fuj
    if not tonumber(kwotathen return end
    if not getElementData(source,"player:logged"then return end
    givePlayerMoney(source,kwota)
    local rnd={math.random(1,30),math.random(1,2)}
    if rnd[1] == or rnd[1] == 15 or rnd[1] == 26 then
        local rep=getElementData(source,"player:reputation") or 0
        local xd=rep+rnd[2]
        setElementData(source,"player:reputation",xd)
        triggerClientEvent(source"reputation:show"resourceRootrnd)
    end
end)

    addEventHandler("onMarketHit",m1,function(StreetView)
        if getElementData(source,"player:reputation")<1000 then
outputChatBox("Masz za malo punktow",source)
return end
end)

SV_c.lua

--[[
Praca busa

]]--
local code "StreetView"
local districtsBus = {

{-1946.06,576.68,35.17},
{-1977.65,563.64,35.17},
{-1997.81,552.35,35.02},
{-1999.73,623.61,35.68},
{-2000.36,706.83,45.30},
{-2002.46,869.43,45.30},
{-1984.03,918.51,45.30},
{-1919.52,920.94,36.14},
{-1838.39,918.46,30.83},
{-1733.78,915.18,24.74},
{-1719.71,890.64,24.74},
{-1718.24,856.76,24.73},
{-1684.85,840.03,24.73},
{-1566.73,830.90,7.04},
{-1562.09,690.80,7.04},
{-1562.37,542.92,7.03},
{-1667.58,392.10,7.03},
{-1736.49,319.31,7.03},
{-1795.43,360.74,17.08},
{-1812.61,481.28,24.42},
{-1892.46,596.32,35.02},
{-1990.67,608.13,35.02},
{-1990.01,540.02,35.01},
{-1974.86,564.12,35.17},
{-1939.31,573.38,35.17},
}
local jobTarget
local jobMarker
local jobVehicle
local maxTarget #districtsBus

function finishJob()
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker nil
    end
    
    if jobTarget and isElement(jobTargetthen
        destroyElement(jobTarget)
        jobTarget nil
        jobTarget 0
        
    end
if getElementData(localPlayer,"player:job") == code then
setElementData(localPlayer,"player:job",false)
end
triggerServerEvent("destroyVeh"localPlayer)

end
addEventHandler "onClientPlayerWasted"getLocalPlayer(),finishJob)
addEvent("finishJob",true)
addEventHandler("finishJob",root,function(plr)
if plr ~= localPlayer then return end
finishJob()
end)


function busDriver(elmd)
    if el ~= localPlayer or not md then return end
    if jobTarget maxTarget and getPedOccupiedVehicle(elthen return end
    if jobTarget == maxTarget and not getPedOccupiedVehicle(elthen return end
    
    if jobTarget == #districtsBus then
        finishJob()
        playSoundFrontEnd(5)
        outputChatBox("* Zako?czy?e?/a? prac?.")
    else
        showMarker()
        playSoundFrontEnd(12)
        if not getElementData(localPlayer"player:premium"then
        triggerServerEvent("givePlayerMoneySTREET"localPlayer600)
        outputChatBox("Otrzymujesz 60 PLN za zidentyfikowanie punktu.")
        end
        if getElementData(localPlayer"player:premium"then
            outputChatBox("Otrzymujesz 80 PLN za zidentyfikowanie punktu.")
            triggerServerEvent("givePlayerMoneySTREET",localPlayer800)
        end
    end
end

function showMarker()
    if jobMarker and isElement(jobMarkerthen
        destroyElement(jobMarker)
        jobMarker nil
    end
    
    jobTarget jobTarget 1
    jobMarker createMarker(districtsBus[jobTarget][1], districtsBus[jobTarget][2], districtsBus[jobTarget][3], "checkpoint"400255)
    
    if districtsBus[jobTarget+1then
        ile districtsBus[jobTarget+1]
        setMarkerTarget(jobMarkerile[1], ile[2], ile[3])
    end
    
    addEventHandler("onClientMarkerHit"jobMarkerbusDriver)
end

addEvent("STARTJobBus"true)
addEventHandler("STARTJobBus"resourceRoot, function(veh)
    outputChatBox("* Rozpocze?e?/a? prace.")
    jobVehicle veh
    jobTarget 0
    showMarker()
end)

addEventHandler("onClientResourceStop"resourceRoot, function()
    if jobVehicle and getElementData(localPlayer"player:job"then
        setElementData(localPlayer"player:job"false)
    end
end)


addEventHandler("onClientVehicleExit"resourceRoot, function(plrseat)
    if seat == 0 then
        if plr == localPlayer then
            finishJob()
            outputChatBox("Zako?czy?e? prac?")
        end
    end
end)

addEventHandler("onPlayerCommand"getRootElement(), function(string)
if string == "hwdp" then
cancelEvent()
end
end)




--[[
                       if getElementData(el,'player:premium'then
                                triggerServerEvent('givePlayerMoney',el,100,111)
                                outputChatBox('* (Premium)PREMIUM zarabia 100 ',54,0,235)
                                else
                                triggerServerEvent('givePlayerMoney',el,100,111)
                                end  
--]]


local sx,sy=guiGetScreenSize()

local data={
    value=nil,
    showed=false,
    text=nil,
}

local randomText={
    "",

}

function renderInformation()
    local sin=math.sin(getTickCount()/500)*0.01
    --dxDrawRectangle(sx*288/1024sy*512/768sx*471/1024sy*101/768tocolor(0102178255), false)
    dxDrawImage(sx*298/1024sy*512/768sx*471/1024sy*171/768"img/corona.png"sin00whitefalse)
    --dxDrawText("Otrzyma?e?(a?) dodatkow? reputacj?..."sx*(393+1)/1024sy*(513+1)/768sx*(759+1)/1024sy*(549+1)/768tocolor(000255), 1.11"default-bold""center""center"falsetrue)
    --dxDrawText("Otrzyma?e?(a?) dodatkow? reputacj?..."sx*393/1024sy*(513)/768sx*759/1024sy*549/768white1.11"default-bold""center""center"falsetrue)
    --dxDrawText(data.text.." ("..data.value.." REP)"sx*(393+1)/1024sy*(549+1)/768sx*(759+1)/1024sy*(603+1)/768tocolor(000255), 1.00"clear""center""center"falsetrue)
    dxDrawText(data.text..""..data.value.." YOSpoints"sx*510/1024sy*549/768sx*759/1024sy*680/768black1.50"pricedown""center""center"falsetrue)
end

addEvent("reputation:show"true)
addEventHandler("reputation:show"resourceRoot, function(rnd)
    data.value=rnd[2]
    data.text=randomText[math.random(#randomText)]
    addEventHandler("onClientRender"rootrenderInformation)
    setTimer(function()
        removeEventHandler("onClientRender"rootrenderInformation)
        data.value=nil
        data.text=nil
    end60001)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-26, 21:28


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

sv.lua :

addEventHandler("onMarkerHit"m1, function(elmd)
    if getElementData(el"zrespilGracz"then
        outputChatBox("praca w trakcie poprawek"el)

end
    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    if getElementData(el,"player:job"then return end
 if getElementData(el,"player:reputation")<1000 then
outputChatBox("Nie masz wystarczaj?cej reputacji!",el)
return end
    if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
    local x,y,getElementPosition(el)
    local bus createVehicle(400, -1927.28,569.90,35.29)
    setElementData(bus"zrespilGracz"el)
    setElementData(bus"vehicle:fuel"100)
    setElementData(bus"vehicle:mileage"math.random(50000,80000))
    setVehicleHandling(bus,"maxVelocity"60,00)
    setElementData(el,"player:job",code)
    
    warpPedIntoVehicle(elbus)
    removePreviousVehicles(el)
    triggerClientEvent(el"STARTJobBus"resourceRootbus)

    vehs[el] = bus
end)


Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-26, 21:56


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

ok dzia?a dzi?ki do zamkni?cia

Postaw piwo autorowi tego posta
 

 
Tagi: czy :: jest :: możliwość
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Czy jest możliwość 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