Wysłany: 2020-05-10, 13:28
HEATEX
Wiek: 25 Na forum: 2250 dni Posty: 109
Nick w MP: HEATEX
Piwa : 1336
Witam chcialbym zrobic prace kuriera od ilosci srp 2000 praca kurier pomoze ktos
c.lua
pracaKuriera = createMarker ( 2151.162 , - 2257.165 , 13.343 , "cylinder" , 1 )
createBlipAttachedTo ( pracaKuriera , 46 , 2 , 255 , 255 , 255 , 255 , 0 , 250 )
text = createElement ( "text" )
setElementPosition ( text , 2151.162 , - 2257.165 , 13.343 )
setElementData ( text , "name" , "Praca kuriera\nBranie paczki\nZarobki: 45$ za paczke\nWymagania: Kat C" )
veh = nil
niesiePaczke = false
oddawaniePaczki = nil
pracuje = false
oddanychPaczek = 0
wyciaganiePaczki = nil
wrocDoBazy = nil
x , y , z = 0 , 0 , 0
spawny = {
{ 2159.747 , - 2280.643 , 13.439 , 0.109 , 0.013 , 224.075 }, -- 498 - Boxville
{ 2167.25 , - 2273.982 , 13.45 , 0.126 , 0.036 , 222.366 }, -- 498 - Boxville
{ 2174.383 , - 2266.406 , 13.459 , 0.183 , 0.026 , 222.634 }, -- 498 - Boxville
}
punkty = {
{ 2014.728 , - 1732.693 , 14.234 , 0 , 0 , 84.83 },
{ 989.462 , - 1349.562 , 13.377 , 0 , 0 , 266.753 },
{ 948.028 , - 1234.762 , 16.716 , 0 , 0 , 65.027 },
{ 969.978 , - 1115.562 , 23.857 , 0 , 0 , 107.631 },
{ 829.255 , - 861.336 , 69.922 , 0 , 0 , 204.335 },
{ 937.551 , - 848.108 , 93.675 , 0 , 0 , 25.262 },
{ 944.109 , - 706.326 , 122.211 , 0 , 0 , 28.819 },
{ 785.61 , - 825.977 , 70.29 , 0 , 0 , 8.986 },
{ 2011.183 , - 1643.589 , 13.547 , 0 , 0 , 112.41 },
{ 2072.727 , - 1645.702 , 13.547 , 0 , 0 , 251.283 },
{ 2326.929 , - 1915.344 , 13.593 , 0 , 0 , 53.434 },
{ 1930.972 , - 1778.792 , 13.547 , 0 , 0 , 226.775 },
{ 1730.517 , - 1912.169 , 13.563 , 0 , 0 , 91.146 },
{ 1726.268 , - 1177.37 , 23.828 , 0 , 0 , 33.066 },
{ 1553.051 , - 1093.736 , 25.055 , 0 , 0 , 275.565 },
{ 1282.145 , - 880.761 , 42.894 , 0 , 0 , 184.586 },
{ 1030.419 , - 1586.903 , 13.547 , 0 , 0 , 281.608 },
{ 1319.264 , - 1764.7 , 13.547 , 0 , 0 , 147.882 },
{ 2266.194 , - 1785.129 , 13.547 , 0 , 0 , 88.921 },
{ 2257.843 , - 1797.986 , 13.547 , 0 , 0 , 319.224 },
{ 2293.728 , - 1922.117 , 13.547 , 0 , 0 , 280.793 },
{ 2273.424 , - 1966.109 , 13.563 , 0 , 0 , 197.563 },
{ 2337.867 , - 1906.986 , 13.617 , 0 , 0 , 223.313 },
{ 2232.981 , - 1906.082 , 13.547 , 0 , 0 , 94.358 },
{ 1666.117 , - 1580.134 , 13.547 , 0 , 0 , 81.672 },
{ 1269.137 , - 1529.734 , 13.567 , 0 , 0 , 294.413 },
{ 1289.954 , - 890.666 , 42.883 , 0 , 0 , 7.011 },
}
skiny = { 142 , 143 , 144 , 141 , 130 , 131 , 132 , 133 , 134 , 135 , 123 , 124 , 125 , 126 , 127 , 128 , 129 , 110 , 111 , 112 , 113 , 114 , 115 , 116 , 91 , 90 , 51 , 52 , 53 , 54 , 55 , 56 }
obiekty = {
{ 2149.676 , - 2254.417 , 14.703 , 0 , 0 , 143.916 },
{ 2149.326 , - 2254.822 , 14.703 , 0 , 0 , 107.996 },
{ 2147.611 , - 2253.986 , 14.702 , 0 , 0 , 53.916 },
{ 2147.555 , - 2253.096 , 14.702 , 0 , 0 , 332.252 },
{ 2147.323 , - 2252.428 , 14.702 , 0 , 0 , 98.916 },
{ 2146.313 , - 2252.803 , 14.701 , 0 , 0 , 143.916 },
{ 2145.15 , - 2252.314 , 14.701 , 0 , 0 , 53.916 },
{ 2148.583 , - 2255.063 , 14.703 , 0 , 0 , 151.302 },
}
dft = createVehicle ( 578 , 2146.287 , - 2252.423 , 13.967 , 359.976 , 360 , 44.966 )
setElementFrozen ( dft , true )
for k , v in pairs ( obiekty ) do
ob = createObject ( 1271 , v [ 1 ], v [ 2 ], v [ 3 ] - 0.9 , v [ 4 ], v [ 5 ], v [ 6 ] )
setElementFrozen ( ob , true )
setElementCollidableWith ( ob , dft , false )
setElementCollidableWith ( dft , ob , false )
end
pedyDowozu = {}
blipyDowozu = {}
markeryDowozu = {}
function nastepnaPaczka ( )
oddawaniePaczki = createMarker ( 0 , 0 , 0 , "cylinder" , 1 )
attachElements ( oddawaniePaczki , veh , 0 , - 5 , 0 )
niesiePaczke = true
toggleControl ( "sprint" , false )
toggleControl ( "jump" , false )
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , true )
end
addEvent ( "nieMaPaczki" , true )
addEventHandler ( "nieMaPaczki" , localPlayer , function() niesiePaczke = false toggleControl ( "sprint" , true ) toggleControl ( "jump" , true ) end )
addEvent ( "pojazdzik" , true )
addEventHandler ( "pojazdzik" , localPlayer , function( veh ) poojazd = veh end )
function startDowoz ( )
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , false )
x , y , z = getElementPosition ( veh )
rx , ry , rz = getElementPosition ( veh )
triggerServerEvent ( "pojazd" , resourceRoot , localPlayer , true , x , y , z , rx , ry , rz )
if veh then
destroyElement ( veh )
veh = nil
end
for k , v in pairs ( punkty ) do
skin = math . random ( 1 , #skiny )
pedyDowozu [ k ] = createPed ( skiny [ skin ], v [ 1 ], v [ 2 ], v [ 3 ], v [ 6 ] )
markeryDowozu [ k ] = createMarker ( 0 , 0 , 0 , "cylinder" , 1 )
attachElements ( markeryDowozu [ k ], pedyDowozu [ k ], 0 , 1 , 0 )
blipyDowozu [ k ] = createBlipAttachedTo ( markeryDowozu [ k ], 12 , 2 , 255 , 255 , 255 , 255 , 0 , 9999999 )
setElementData ( markeryDowozu [ k ], "pedIblip" , { blipyDowozu [ k ], pedyDowozu [ k ]} )
end
timer = setTimer ( function()
veh = getPedOccupiedVehicle ( localPlayer )
if veh then
killTimer ( timer )
wyciaganiePaczki = createMarker ( 0 , 0 , 0 , "cylinder" , 1.5 )
attachElements ( wyciaganiePaczki , veh , 0 , - 5 , 0 )
end
end , 1000 , 0 )
end
function czyWszyscy ( )
ilosc = 0
for k , v in pairs ( markeryDowozu ) do
if isElement ( v ) then
ilosc = ilosc + 1
end
end
return ilosc
end
addEventHandler ( "onClientRender" , root , function()
keys = getBoundKeys ( "forwards" )
for keyName , state in pairs ( keys ) do
if state and niesiePaczke then
setPedControlState ( localPlayer , "walk" , true )
end
end
end )
addEventHandler ( "onClientMarkerHit" , root , function( plr , dim )
if getElementData ( el , "player:srp" ) < 800 then triggerClientEvent ( el , 'onClientAddNotification' , el , 'Nie posiadasz wystarczaj?co pkt. reputacji:#bf0101\n800 REP' , 'error' ) return end
if plr == localPlayer and dim then
if source == wrocDoBazy then
veh = getPedOccupiedVehicle ( localPlayer )
if not veh then return end
if getElementData ( veh , "fedex:owner" ) then
triggerServerEvent ( "pojazd" , resourceRoot , localPlayer , false )
veh = nil
niesiePaczke = false
setPedControlState ( localPlayer , "walk" , false )
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
oddawaniePaczki = nil
pracuje = false
destroyElement ( blip )
blip = nil
oddanychPaczek = 0
destroyElement ( wyciaganiePaczki )
wyciaganiePaczki = nil
destroyElement ( wrocDoBazy )
wrocDoBazy = nil
end
end
if niesiePaczke then
for k , v in pairs ( markeryDowozu ) do
if source == v then
niesiePaczke = false
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
setPedControlState ( localPlayer , "walk" , false )
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , niesiePaczke )
blip , ped = unpack ( getElementData ( v , "pedIblip" ) )
_ , _ , z = getElementRotation ( ped )
setElementRotation ( ped , 0 , 0 , z + 180 )
setPedAnimation ( ped , "ped" , "WOMAN_walknorm" )
triggerServerEvent ( "givePlayerMoney" , localPlayer , 45 )
destroyElement ( blip )
destroyElement ( v )
blip = nil
v = nil
alpha = 255
setTimer ( function()
alpha = alpha - 15
setElementAlpha ( ped , alpha )
end , 100 , 16 )
setTimer ( function()
destroyElement ( ped )
ped = nil
end , 3000 , 1 )
if czyWszyscy () == 0 then
wrocDoBazy = createMarker ( 2153.687 , - 2289.544 , 13.376 , "cylinder" , 3 )
blip = createBlipAttachedTo ( wrocDoBazy , 12 )
exports [ "pystories-notifications" ]: createAlert ( "Wr?? do bazy za?adunkowej." )
end
end
end
end
if source == wyciaganiePaczki then
niesiePaczke = not niesiePaczke
toggleControl ( "sprint" , not niesiePaczke )
toggleControl ( "jump" , not niesiePaczke )
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , niesiePaczke )
end
if source == oddawaniePaczki then
if not niesiePaczke then return end
destroyElement ( oddawaniePaczki )
oddawaniePaczki = nil
niesiePaczke = false
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
setPedControlState ( localPlayer , "walk" , false )
oddanychPaczek = oddanychPaczek + 1
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , false )
if oddanychPaczek >= 3 then
startDowoz ( )
exports [ "pystories-notifications" ]: createAlert ( "Zawie? paczki do klient?w." )
else
exports [ "pystories-notifications" ]: createAlert ( "Id? po nastepn? paczk?." )
end
end
if source == pracaKuriera then
if getElementData ( localPlayer , "player:license:pjC" ) ~= 1 and getElementData ( localPlayer , "player:license:pjC" ) ~= true then return exports [ "pystories-notifications" ]: createAlert ( "Nie posiadasz prawajazdy kategorii C." ) end
if not pracuje then
if not veh then
l = math . random ( 1 , #spawny )
l = spawny [ l ]
veh = createVehicle ( 498 , l [ 1 ], l [ 2 ], l [ 3 ], l [ 4 ], l [ 5 ], l [ 6 ] )
setElementData ( veh , "disabledCols" , true )
setVehicleColor ( veh , 255 , 255 , 255 , 255 , 255 , 255 )
setElementFrozen ( veh , true )
end
pracuje = true
oddanychPaczek = 0
nastepnaPaczka ( )
else
if niesiePaczke then return end
if oddanychPaczek < 3 then
nastepnaPaczka ( )
end
end
end
end
end )
setTimer ( function()
if pracuje then
if isElement ( poojazd ) then
x3 , y3 , z3 = getElementPosition ( localPlayer )
x4 , y4 , z4 = getElementPosition ( poojazd )
if getDistanceBetweenPoints2D ( x3 , y3 , x4 , y4 ) > 50 then
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , false )
triggerServerEvent ( "pojazd" , resourceRoot , localPlayer , false )
pracuje = false
niesiePaczke = false
toggleControl ( "sprint" , true )
if isElement ( veh ) then
destroyElement ( veh )
end
toggleControl ( "jump" , true )
setPedControlState ( localPlayer , "walk" , false )
oddanychPaczek = 0
end
end
end
end , 1000 , 0 )
s.lua
paczki = {}
pojazdy = {}
function zmienPaczke ( plr , przyczepCzyOdczep )
if przyczepCzyOdczep then
if not paczki [ plr ] then
paczki [ plr ] = createObject ( 1271 , 0 , 0 , 0 )
setElementCollisionsEnabled ( paczki [ plr ], false )
end
attachElements ( paczki [ plr ], plr , 0 , 0.3 , 0.45 )
setPedAnimation ( plr , "carry" , "crry_prtial" , 1 , true , true , false )
else
if paczki [ plr ] then
detachElements ( paczki [ plr ], plr )
setElementPosition ( paczki [ plr ], 0 , 0 , 0 )
setTimer ( setPedAnimation , 500 , 1 , plr )
end
end
end
addEvent ( "paczka" , true )
addEventHandler ( "paczka" , resourceRoot , zmienPaczke )
function zmienPojazd ( plr , spawnCzyUsun , x , y , z , rx , ry , rz )
if spawnCzyUsun then
if not pojazdy [ plr ] then
pojazdy [ plr ] = createVehicle ( 498 , x , y , z , 0 , 0 , 220 )
setVehicleColor ( pojazdy [ plr ], 255 , 255 , 255 , 255 , 255 , 255 )
setElementData ( pojazdy [ plr ], "fedex:owner" , getElementData ( plr , "player:sid" ) )
exports [ "pystories-busy" ]: deleteColisionsWithVehicles ( pojazdy [ plr ] )
warpPedIntoVehicle ( plr , pojazdy [ plr ], 0 )
triggerClientEvent ( plr , "pojazdzik" , plr , pojazdy [ plr ] )
end
else
if pojazdy [ plr ] then
destroyElement ( pojazdy [ plr ] )
pojazdy [ plr ] = nil
end
end
end
addEvent ( "pojazd" , true )
addEventHandler ( "pojazd" , resourceRoot , zmienPojazd )
addEventHandler ( "onPlayerQuit" , root , function()
zmienPaczke ( source , false )
zmienPojazd ( source , false )
end )
addEventHandler ( "onVehicleStartEnter" , root , function( plr , seat , jacked )
zmienPaczke ( plr , false )
triggerClientEvent ( plr , "nieMaPaczki" , plr )
if seat == 0 then
if getElementData ( source , "fedex:owner" ) and getElementData ( source , "fedex:owner" ) ~= getElementData ( plr , "player:sid" ) then
cancelEvent ( )
end
end
end )
Ostatnio zmieniony przez HEATEX 2020-05-10, 13:33, w całości zmieniany 1 raz
Wysłany: 2020-05-10, 13:32
Szyszka947
ASP NET Core / Lua
Wiek: 19 Na forum: 2579 dni Posty: 288
Piwa : 16
if getElementData ( el , "player:srp" ) < 800 then
zmien na
if getElementData ( el , "player:srp" ) < 2000 then
Naprawd?, je?li nie potrafisz nawet zmieni? warto?ci w instrukcji warunkowej, to oszcz?d? sobie robienia nast?pnego pseudola, i we? si? za jakie? poradniki, chocia? dost?pne na forum, i zr?b co? autorskiego...
Wysłany: 2020-05-10, 13:34
HEATEX
Wiek: 25 Na forum: 2250 dni Posty: 109
Nick w MP: HEATEX
Piwa : 1336
nie dziala
[ Dodano : 2020-05-10, 13:35 ]
przepraszam przeslalem zly kod to jest prawidlowy
pracaKuriera = createMarker ( 2151.162 , - 2257.165 , 13.343 , "cylinder" , 1 )
createBlipAttachedTo ( pracaKuriera , 46 , 2 , 255 , 255 , 255 , 255 , 0 , 250 )
text = createElement ( "text" )
setElementPosition ( text , 2151.162 , - 2257.165 , 13.343 )
setElementData ( text , "name" , "Praca kuriera\nBranie paczki\nZarobki: 45$ za paczke\nWymagania: Kat C" )
veh = nil
niesiePaczke = false
oddawaniePaczki = nil
pracuje = false
oddanychPaczek = 0
wyciaganiePaczki = nil
wrocDoBazy = nil
x , y , z = 0 , 0 , 0
spawny = {
{ 2159.747 , - 2280.643 , 13.439 , 0.109 , 0.013 , 224.075 }, -- 498 - Boxville
{ 2167.25 , - 2273.982 , 13.45 , 0.126 , 0.036 , 222.366 }, -- 498 - Boxville
{ 2174.383 , - 2266.406 , 13.459 , 0.183 , 0.026 , 222.634 }, -- 498 - Boxville
}
punkty = {
{ 2014.728 , - 1732.693 , 14.234 , 0 , 0 , 84.83 },
{ 989.462 , - 1349.562 , 13.377 , 0 , 0 , 266.753 },
{ 948.028 , - 1234.762 , 16.716 , 0 , 0 , 65.027 },
{ 969.978 , - 1115.562 , 23.857 , 0 , 0 , 107.631 },
{ 829.255 , - 861.336 , 69.922 , 0 , 0 , 204.335 },
{ 937.551 , - 848.108 , 93.675 , 0 , 0 , 25.262 },
{ 944.109 , - 706.326 , 122.211 , 0 , 0 , 28.819 },
{ 785.61 , - 825.977 , 70.29 , 0 , 0 , 8.986 },
{ 2011.183 , - 1643.589 , 13.547 , 0 , 0 , 112.41 },
{ 2072.727 , - 1645.702 , 13.547 , 0 , 0 , 251.283 },
{ 2326.929 , - 1915.344 , 13.593 , 0 , 0 , 53.434 },
{ 1930.972 , - 1778.792 , 13.547 , 0 , 0 , 226.775 },
{ 1730.517 , - 1912.169 , 13.563 , 0 , 0 , 91.146 },
{ 1726.268 , - 1177.37 , 23.828 , 0 , 0 , 33.066 },
{ 1553.051 , - 1093.736 , 25.055 , 0 , 0 , 275.565 },
{ 1282.145 , - 880.761 , 42.894 , 0 , 0 , 184.586 },
{ 1030.419 , - 1586.903 , 13.547 , 0 , 0 , 281.608 },
{ 1319.264 , - 1764.7 , 13.547 , 0 , 0 , 147.882 },
{ 2266.194 , - 1785.129 , 13.547 , 0 , 0 , 88.921 },
{ 2257.843 , - 1797.986 , 13.547 , 0 , 0 , 319.224 },
{ 2293.728 , - 1922.117 , 13.547 , 0 , 0 , 280.793 },
{ 2273.424 , - 1966.109 , 13.563 , 0 , 0 , 197.563 },
{ 2337.867 , - 1906.986 , 13.617 , 0 , 0 , 223.313 },
{ 2232.981 , - 1906.082 , 13.547 , 0 , 0 , 94.358 },
{ 1666.117 , - 1580.134 , 13.547 , 0 , 0 , 81.672 },
{ 1269.137 , - 1529.734 , 13.567 , 0 , 0 , 294.413 },
{ 1289.954 , - 890.666 , 42.883 , 0 , 0 , 7.011 },
}
skiny = { 142 , 143 , 144 , 141 , 130 , 131 , 132 , 133 , 134 , 135 , 123 , 124 , 125 , 126 , 127 , 128 , 129 , 110 , 111 , 112 , 113 , 114 , 115 , 116 , 91 , 90 , 51 , 52 , 53 , 54 , 55 , 56 }
obiekty = {
{ 2149.676 , - 2254.417 , 14.703 , 0 , 0 , 143.916 },
{ 2149.326 , - 2254.822 , 14.703 , 0 , 0 , 107.996 },
{ 2147.611 , - 2253.986 , 14.702 , 0 , 0 , 53.916 },
{ 2147.555 , - 2253.096 , 14.702 , 0 , 0 , 332.252 },
{ 2147.323 , - 2252.428 , 14.702 , 0 , 0 , 98.916 },
{ 2146.313 , - 2252.803 , 14.701 , 0 , 0 , 143.916 },
{ 2145.15 , - 2252.314 , 14.701 , 0 , 0 , 53.916 },
{ 2148.583 , - 2255.063 , 14.703 , 0 , 0 , 151.302 },
}
dft = createVehicle ( 578 , 2146.287 , - 2252.423 , 13.967 , 359.976 , 360 , 44.966 )
setElementFrozen ( dft , true )
for k , v in pairs ( obiekty ) do
ob = createObject ( 1271 , v [ 1 ], v [ 2 ], v [ 3 ] - 0.9 , v [ 4 ], v [ 5 ], v [ 6 ] )
setElementFrozen ( ob , true )
setElementCollidableWith ( ob , dft , false )
setElementCollidableWith ( dft , ob , false )
end
pedyDowozu = {}
blipyDowozu = {}
markeryDowozu = {}
function nastepnaPaczka ( )
oddawaniePaczki = createMarker ( 0 , 0 , 0 , "cylinder" , 1 )
attachElements ( oddawaniePaczki , veh , 0 , - 5 , 0 )
niesiePaczke = true
toggleControl ( "sprint" , false )
toggleControl ( "jump" , false )
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , true )
end
addEvent ( "nieMaPaczki" , true )
addEventHandler ( "nieMaPaczki" , localPlayer , function() niesiePaczke = false toggleControl ( "sprint" , true ) toggleControl ( "jump" , true ) end )
addEvent ( "pojazdzik" , true )
addEventHandler ( "pojazdzik" , localPlayer , function( veh ) poojazd = veh end )
function startDowoz ( )
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , false )
x , y , z = getElementPosition ( veh )
rx , ry , rz = getElementPosition ( veh )
triggerServerEvent ( "pojazd" , resourceRoot , localPlayer , true , x , y , z , rx , ry , rz )
if veh then
destroyElement ( veh )
veh = nil
end
for k , v in pairs ( punkty ) do
skin = math . random ( 1 , #skiny )
pedyDowozu [ k ] = createPed ( skiny [ skin ], v [ 1 ], v [ 2 ], v [ 3 ], v [ 6 ] )
markeryDowozu [ k ] = createMarker ( 0 , 0 , 0 , "cylinder" , 1 )
attachElements ( markeryDowozu [ k ], pedyDowozu [ k ], 0 , 1 , 0 )
blipyDowozu [ k ] = createBlipAttachedTo ( markeryDowozu [ k ], 12 , 2 , 255 , 255 , 255 , 255 , 0 , 9999999 )
setElementData ( markeryDowozu [ k ], "pedIblip" , { blipyDowozu [ k ], pedyDowozu [ k ]} )
end
timer = setTimer ( function()
veh = getPedOccupiedVehicle ( localPlayer )
if veh then
killTimer ( timer )
wyciaganiePaczki = createMarker ( 0 , 0 , 0 , "cylinder" , 1.5 )
attachElements ( wyciaganiePaczki , veh , 0 , - 5 , 0 )
end
end , 1000 , 0 )
end
function czyWszyscy ( )
ilosc = 0
for k , v in pairs ( markeryDowozu ) do
if isElement ( v ) then
ilosc = ilosc + 1
end
end
return ilosc
end
addEventHandler ( "onClientRender" , root , function()
keys = getBoundKeys ( "forwards" )
for keyName , state in pairs ( keys ) do
if state and niesiePaczke then
setPedControlState ( localPlayer , "walk" , true )
end
end
end )
addEventHandler ( "onClientMarkerHit" , root , function( plr , dim )
if plr == localPlayer and dim then
if source == wrocDoBazy then
veh = getPedOccupiedVehicle ( localPlayer )
if not veh then return end
if getElementData ( veh , "fedex:owner" ) then
triggerServerEvent ( "pojazd" , resourceRoot , localPlayer , false )
veh = nil
niesiePaczke = false
setPedControlState ( localPlayer , "walk" , false )
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
oddawaniePaczki = nil
pracuje = false
destroyElement ( blip )
blip = nil
oddanychPaczek = 0
destroyElement ( wyciaganiePaczki )
wyciaganiePaczki = nil
destroyElement ( wrocDoBazy )
wrocDoBazy = nil
end
end
if niesiePaczke then
for k , v in pairs ( markeryDowozu ) do
if source == v then
niesiePaczke = false
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
setPedControlState ( localPlayer , "walk" , false )
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , niesiePaczke )
blip , ped = unpack ( getElementData ( v , "pedIblip" ) )
_ , _ , z = getElementRotation ( ped )
setElementRotation ( ped , 0 , 0 , z + 180 )
setPedAnimation ( ped , "ped" , "WOMAN_walknorm" )
triggerServerEvent ( "givePlayerMoney" , localPlayer , 45 )
destroyElement ( blip )
destroyElement ( v )
blip = nil
v = nil
alpha = 255
setTimer ( function()
alpha = alpha - 15
setElementAlpha ( ped , alpha )
end , 100 , 16 )
setTimer ( function()
destroyElement ( ped )
ped = nil
end , 3000 , 1 )
if czyWszyscy () == 0 then
wrocDoBazy = createMarker ( 2153.687 , - 2289.544 , 13.376 , "cylinder" , 3 )
blip = createBlipAttachedTo ( wrocDoBazy , 12 )
exports [ "pystories-notifications" ]: createAlert ( "Wr?? do bazy za?adunkowej." )
end
end
end
end
if source == wyciaganiePaczki then
niesiePaczke = not niesiePaczke
toggleControl ( "sprint" , not niesiePaczke )
toggleControl ( "jump" , not niesiePaczke )
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , niesiePaczke )
end
if source == oddawaniePaczki then
if not niesiePaczke then return end
destroyElement ( oddawaniePaczki )
oddawaniePaczki = nil
niesiePaczke = false
toggleControl ( "sprint" , true )
toggleControl ( "jump" , true )
setPedControlState ( localPlayer , "walk" , false )
oddanychPaczek = oddanychPaczek + 1
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , false )
if oddanychPaczek >= 3 then
startDowoz ( )
exports [ "pystories-notifications" ]: createAlert ( "Zawie? paczki do klient?w." )
else
exports [ "pystories-notifications" ]: createAlert ( "Id? po nastepn? paczk?." )
end
end
if source == pracaKuriera then
if getElementData ( localPlayer , "player:license:pjC" ) ~= 1 and getElementData ( localPlayer , "player:license:pjC" ) ~= true then return exports [ "pystories-notifications" ]: createAlert ( "Nie posiadasz prawajazdy kategorii C." ) end
if not pracuje then
if not veh then
l = math . random ( 1 , #spawny )
l = spawny [ l ]
veh = createVehicle ( 498 , l [ 1 ], l [ 2 ], l [ 3 ], l [ 4 ], l [ 5 ], l [ 6 ] )
setElementData ( veh , "disabledCols" , true )
setVehicleColor ( veh , 255 , 255 , 255 , 255 , 255 , 255 )
setElementFrozen ( veh , true )
end
pracuje = true
oddanychPaczek = 0
nastepnaPaczka ( )
else
if niesiePaczke then return end
if oddanychPaczek < 3 then
nastepnaPaczka ( )
end
end
end
end
end )
setTimer ( function()
if pracuje then
if isElement ( poojazd ) then
x3 , y3 , z3 = getElementPosition ( localPlayer )
x4 , y4 , z4 = getElementPosition ( poojazd )
if getDistanceBetweenPoints2D ( x3 , y3 , x4 , y4 ) > 50 then
triggerServerEvent ( "paczka" , resourceRoot , localPlayer , false )
triggerServerEvent ( "pojazd" , resourceRoot , localPlayer , false )
pracuje = false
niesiePaczke = false
toggleControl ( "sprint" , true )
if isElement ( veh ) then
destroyElement ( veh )
end
toggleControl ( "jump" , true )
setPedControlState ( localPlayer , "walk" , false )
oddanychPaczek = 0
end
end
end
end , 1000 , 0 )
[ Dodano : 2020-05-10, 13:35 ]
tamten kod ja edytowalem i on nie dzialal
Wysłany: 2020-05-10, 16:03
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Wykonujesz zwyk?y warunek sprawdzaj?cy, co w tym jest niezrozumia?ego.
U?ytkownik wy?ej nawet Ci wklei? gotow? linijk? kodu, kt?ra za?atwia Tw?j problem. Po co robi? i edytowa? kod ca?y czas jak mo?na po?wi?ci? ten czas na poradniki LUA...
if getElementData ( el , "player:srp" ) < 2000 then
Tagi: praca :: kurier
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: