Wysłany: 2019-02-23, 14:04
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam ot?? mam prace pizza boya, rozpoczynam, lecz nie ma markera do za?adowania
db3
https://imgur.com/a/eA0jLeB
kod
c.lua
--[[
Autor : sayo
]]
local pkt = {
{- 2545.98 , - 203.16 , 14.65 },
{- 2795.59 , 139.16 , 7.20 },
{- 2415.08 , 332.47 , 34.98 },
{- 2723.87 , - 314.69 , 7.19 },
{- 2759.96 , 556.03 , 14.55 },
{- 2861.80 , 813.36 , 38.82 },
{- 2714.26 , 127.89 , 4.34 },
{- 2230.01 , 250.83 , 35.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.1 , 255 , 80 , 0 )
blip = createBlipAttachedTo ( marker , 12 )
end
function createBlips1 ()
marker2 = createMarker (- 2663.61 , 238.24 , 4.34 , "cylinder" , 1.2 )
blip2 = createBlipAttachedTo ( marker2 , 12 )
end
function destroyBlips ()
if marker and isElement ( marker ) then
destroyElement ( marker )
end
if blip and isElement ( blip ) then
destroyElement ( blip )
end
if blip2 and isElement ( blip2 ) then
destroyElement ( blip2 )
end
if marker2 and isElement ( marker2 ) then
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 ()
end , 5000 , 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" , localPlayer , kasa , 0 )
setElementData ( localPlayer , "player:reputation" , rp + 2 )
exports [ 'noti' ]: showBox ( "error" , "Za dostarczenie pizzy otrzymujesz... " .. kasa .. " PLN" )
destroyBlips ()
createBlips1 ()
end , 6000 , 1 )
end )
s.lua
--[[
Autor : sayo
]]
local marker = createMarker (- 2672.18 , 258.40 , 4.63 , "cylinder" , 1.1 )
createBlipAttachedTo ( marker , 46 , 2 , 0 , 0 , 0 , 0 , 0 , 275 )
setElementData ( marker , "praca" , true )
local colshape = createColSphere (- 2672.18 , 258.40 , 4.63 , 5 )
local pojazd = {}
addEventHandler ( "onMarkerHit" , marker , function( hit )
if getElementType ( hit ) ~= "player" then return end
if isPlayerInVehicle ( hit ) then 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 ( hit , pojazd [ 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( player , seat )
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" , root , createBlips1 )
addEvent ( "stopJob:pizza" , true )
addEventHandler ( "stopJob:pizza" , root , destroyBlips ) [/list]
Wysłany: 2019-02-25, 22:06
Mezo.
Mod-Team
Wiek: 24 Na forum: 3211 dni Posty: 548
Nick w MP: Mezo
Piwa : 6070
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
Tagi: pizzaboy :: praca
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: