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

Wysłany: 2019-02-23, 14:04


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot?? mam prace pizza boya, rozpoczynam, lecz nie ma markera do za?adowania
db3
https://imgur.com/a/eA0jLeB
kod
c.lua


--[[
Autorsayo
]]

local pkt = {
    {-2545.98, -203.1614.65},
    {-2795.59139.167.20},
    {-2415.08332.4734.98},
    {-2723.87, -314.697.19},
    {-2759.96556.0314.55},
    {-2861.80813.3638.82},
    {-2714.26127.894.34},
    {-2230.01250.8335.32},

local marker false
local blip false

function createBlips()
    local rnd math.random(1#pkt)
    marker createMarker(pkt[rnd][1], pkt[rnd][2], pkt[rnd][3]-0.99"cylinder"1.1255,80,0)
    blip createBlipAttachedTo(marker12)
end

function createBlips1()
    marker2 createMarker(-2663.61238.244.34"cylinder"1.2)
    blip2 createBlipAttachedTo(marker212)
end

function destroyBlips()
    if marker and isElement(markerthen
        destroyElement(marker)
    end
    if blip and isElement(blipthen
        destroyElement(blip)
    end
    if blip2 and isElement(blip2then
        destroyElement(blip2)
    end
    if marker2 and isElement(marker2then
        destroyElement(marker2)
    end
end



addEventHandler("onClientMarkerHit"resourceRoot, function(hit)
    if hit ~= localPlayer then return end
    if source ~= marker2 then return end
    local veh getPedOccupiedVehicle(hit)
    if not veh then return end
    fadeCamera(false)
    exports['notyfikacje']:showBox("info","Trwa za?adunek pizzy.")
    setElementFrozen(veh,true)
    showCursor(true)
    setTimer(function()
    destroyBlips()
    fadeCamera(true)
    exports['notyfikacje']:showBox("info","Udaj si? dostarczy? pizz? do wyznaczonego celu.")
    setElementFrozen(veh,false)
    showCursor(false)
    createBlips()
    end5000,1)
end)

addEventHandler("onClientMarkerHit"resourceRoot, function(hit)
    local rp =  getElementData(localPlayer,"player:reputation")
    if hit ~= localPlayer then return end
    if source ~= marker then return end
    local veh getPedOccupiedVehicle(hit)
    if not veh then return end
    local kasa math.random(37,63)
    if getElementData(hit"player:premium"then
        kasa math.random(37*2.0,63*2.0)
    end
    fadeCamera(false)
    exports['noti']:showBox("info","Oddajesz pizze klientowi...")
    setElementFrozen(veh,true)
    showCursor(true)
    setTimer(function()
    fadeCamera(true)
    setElementFrozen(veh,false)
    showCursor(false)
    triggerServerEvent("givePlayerMoney"localPlayerkasa0)  
    setElementData(localPlayer,"player:reputation",rp+2)
    exports['noti']:showBox("error","Za dostarczenie pizzy otrzymujesz... "..kasa.." PLN")
    destroyBlips()
    createBlips1()
    end6000,1)
end)

s.lua
--[[
Autorsayo
]]

local marker createMarker(-2672.18258.404.63"cylinder"1.1)
createBlipAttachedTo(marker,46,2,0,0,0,0,0,275)
setElementData(marker,"praca",true)
local colshape createColSphere(-2672.18258.404.635)

local pojazd = {}

addEventHandler("onMarkerHit"marker, function(hit)
    if getElementType(hit) ~= "player" then return end
    if isPlayerInVehicle(hitthen return end
    if getElementData(hit,"player:job"then exports['noti']:showBox(hit,"warning","Posiadasz ju? aktywn? prace.") return end
--    if getElementData(hit,"player:license:pjA") == 0 then exports['notyfikacje']:showBox(hit,"warning","Nie posiadasz prawa jazdy kategorii A") return end
    local vehiclesInShape getElementsWithinColShape(colshape"vehicle")
    if #vehiclesInShape > 0 then
        exports.noti:showBox(client,"info""Miejsce spawnu jest zaj?te.")
        return 
    end
    pojazd[hit] = createVehicle(474, -2658.32,268.08,3.93,359.5,359.9,1.5)
    exports["noti"]:showBox(hit,"info","Udaj si? za?adowa? pizz?.")
    warpPedIntoVehicle(hitpojazd[hit])
    setElementData(hit,"player:job",true)
    triggerClientEvent(hit"startJob:pizza"resourceRoot)
end)

function removeAll(player)
    if pojazd[player] and isElement(pojazd[player]) then
        destroyElement(pojazd[player])
    end
    triggerClientEvent(player"stopJob:pizza"resourceRoot)
    setElementData(player,"player:job",false)
    exports["notyfikacje"]:showBox(player,"info","Zako?czy?e? prac?")
end

addEventHandler("onVehicleExit"resourceRoot, function(playerseat)
    if seat ~= 0 then return end
    removeAll(player)
    setElementPosition(player,xyz)
end)

addEventHandler("onPlayerWasted"root, function()
    removeAll(source)
end)

addEventHandler("onPlayerQuit"root, function()
    removeAll(source)
end)

addEvent("startJob:pizza"true)
addEventHandler("startJob:pizza"rootcreateBlips1)

addEvent("stopJob:pizza"true)
addEventHandler("stopJob:pizza"rootdestroyBlips)
[/list]

Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-25, 22:06


Mezo.

Mod-Team






Wiek: 24
Na forum: 3211 dni
Posty: 548
Nick w MP: Mezo

Piwa: 6070

Respekt: 517
Respekt: 517

Teoretycznie DB3 wskazuje ?e nie masz kolumny o nazwie premium, a drugi b??d jest zwi?zany z notyfikacjami kt?re s? podpi?te pod owy skrypt. Powiedz mi czy jak w??czysz skrypt o nazwie; ,, noti " czy b??d dalej istnieje? bo tutaj wskazuje na to ?e po prostu owy skrypt jest nie w??czony oraz nie ma kolumny premium w bazie danych.

Podpis
- Na forum pomagam na miarę swoich możliwości, oraz bezpłatnie.
- Jeżeli potrzebujesz pomocy, pisz do mnie w prywatnej wiadomości, pomoc uzyskasz szybciej.
Współpraca - [email protected]


Użytkownik - 19.08.2017
GTAO MEMBER - 29.03.2019
Support-Team - 03.02.2019 - 07.05.2019
Moderator - 07.05.2019 - 02.08.2020
Mod-Team - 02.08.2020 - 25.03.2022

Postaw piwo autorowi tego posta
 

 
Tagi: pizzaboy :: praca
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » PizzaBoy praca Odpowiedz do tematu

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